阻止进程启动并阻止其启动

发布于 2024-12-06 06:44:12 字数 1170 浏览 0 评论 0原文

我的问题是下一个:

当用户按住 Android 手机上的搜索按钮时,当进度条处于运行状态时,会显示以下错误消息:

 ERROR / AndroidRuntime ( 16794 ): java.lang. SecurityException: Requesting codes from com.google.android.voicesearch (with uid 10028) to be run in process com.xxxx.myApplication (with uid 10088)

因此,除了此消息之外,我尝试了几件事:终止进程' com.google.android.voicesearch ':

JAVA 代码:

if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH)
{           
if (!event.isLongPress() && !Utils.getMyProgress().isShowing())
{
searchProducts();
}
else  
{   
android.os.Process.killProcess(android.os.Process.getUidForName("com.google.android.voicesearch"));
}
return true;
}

不成功!因此,我们的想法是阻止进程“com.google.android.voicesearch”启动 每当电话用户长时间保持电话的按键(触摸)“寻找”其电话时(例如在 htc 上,这个按键(触摸)就存在。而是一个物理而非触觉的按键(触摸)!)

当我的应用程序启动时,也许可以在manifest.xml中阻止此进程(“com.google.android.voicesearch”)的启动:

manifest.xml:

<application 
android:debuggable="false"
android:enabled="false"
android:killAfterRestore="false"
android:process="com.google.android.voicesearch">
</application>

有什么想法吗? 感谢您的回答!

My problem is the next :

When an user hold search's button on an android phone, and this, while a progress bar is in action, the following error message is displayed:

 ERROR / AndroidRuntime ( 16794 ): java.lang. SecurityException: Requesting codes from com.google.android.voicesearch (with uid 10028) to be run in process com.xxxx.myApplication (with uid 10088)

Thus, further to this message I tried several things: kill the process ' com.google.android.voicesearch ' :

JAVA code :

if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH)
{           
if (!event.isLongPress() && !Utils.getMyProgress().isShowing())
{
searchProducts();
}
else  
{   
android.os.Process.killProcess(android.os.Process.getUidForName("com.google.android.voicesearch"));
}
return true;
}

Unsuccessfully! Thus the idea is to prevent the process 'com.google.android.voicesearch' from being started
every time the user of the telephone maintainings for a long time the key(touch) "to look for" of its telephone (example on htc, this key(touch) exists. Rather, a physical and not tactile key(touch)!)

Maybe is it possible to block the launch of this process ('com.google.android.voicesearch') in the in the manifest.xml, while my application is launched :

manifest.xml :

<application 
android:debuggable="false"
android:enabled="false"
android:killAfterRestore="false"
android:process="com.google.android.voicesearch">
</application>

Any idea ?
Thanks for answers !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最单纯的乌龟 2024-12-13 06:44:12

为了在 Android 系统的帮助下实现搜索(将搜索查询传递给 Activity 并提供搜索建议),您的应用程序必须以名为 可搜索配置。它配置搜索对话框或小部件的某些 UI 方面,并定义建议和语音搜索等功能的行为方式。该文件传统上命名为 searchable.xml,并且必须保存在 res/xml/ 项目目录中。

根据此页面,您只需删除语音条目从该文件。

In order to implement search with assistance from the Android system (to deliver search queries to an activity and provide search suggestions), your application must provide a search configuration in the form of an XML file called the searchable configuration. It configures certain UI aspects of the search dialog or widget and defines how features such as suggestions and voice search behave. This file is traditionally named searchable.xml and must be saved in the res/xml/ project directory.

According to this page, you only have to remove the voice entries from that file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文