简体   繁体   English

adb命令设置语音助手

[英]adb command to set voice assistant

I'm working on a voice assistant, and every time the app is deployed on the phone, I need to change again the default assistant to my app.我正在开发语音助手,每次在手机上部署该应用程序时,我都需要再次将默认助手更改为我的应用程序。 Just a few clicks, but 100 times a day, that's some time gone !!只需点击几下,但每天 100 次,时间已经过去了!!

Something similar exists for setting the default launcher设置默认启动器存在类似的东西

adb shell cmd package set-home-activity "the.package/.TheLauncherActivity"

So I tried所以我试过了

adb shell cmd package set-assistant "the.package/.TheLauncherActivity"
adb shell cmd package set-voice-assistant "the.package/.TheLauncherActivity"
adb shell cmd package set-assist "the.package/.TheLauncherActivity"
adb shell cmd package set-voice-assist "the.package/.TheLauncherActivity"

It's weird because the assistant itself is more a service than an activity, but anyways, all I got is:这很奇怪,因为助手本身更像是一种服务而不是一项活动,但无论如何,我得到的只是:

Unknown command: set-voice-assist (and the others)

So I guess I'm not even close.所以我想我什至不接近。

I'm not sure if you were looking for something like this:我不确定您是否正在寻找这样的东西:

$ adb shell cmd role remove-role-holder --user 10 android.app.role.ASSISTANT com.google.android.carassistant

$ adb shell cmd role add-role-holder --user 10 android.app.role.ASSISTANT CUSTOM.PACKAGE.NAME

Good information about Role managing can be found here: http://aospxref.com/android-12.0.0_r3/xref/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/Role.md and list of the roles: http://aospxref.com/android-12.0.0_r3/xref/packages/modules/Permission/framework-s/api/current.txt#8关于角色管理的好信息可以在这里找到: http://aospxref.com/android-12.0.0_r3/xref/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/Role.md和列表角色: http://aospxref.com/android-12.0.0_r3/xref/packages/modules/Permission/framework-s/api/current.txt#8

If your device contains custom build of AOSP and you have the platform key you are able write own app which will change role holders with method RoleManager.addRoleHolderAsUser.如果您的设备包含 AOSP 的自定义构建并且您拥有平台密钥,则您可以编写自己的应用程序,该应用程序将使用 RoleManager.addRoleHolderAsUser 方法更改角色持有者。

I am still looking for a solution to the same issue, did you found one?我仍在寻找相同问题的解决方案,您找到了吗? I know this is to answer, but I cannot comment unfortunately.我知道这是为了回答,但不幸的是我无法发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM