Android 在没有合格用户错误的情况下调用系统进程中的方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20850476/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:34:56  来源:igfitidea点击:

Calling a method in the system process without a qualified user error

androidandroid-framework

提问by Andrew

I'm using the notification listener service in android 4.4 and I'm coming across an error that causes my app to stop getting notifications posted.

我在 android 4.4 中使用通知侦听器服务,但遇到一个错误,导致我的应用停止接收通知。

It's fairly random, but when it happens I'm seeing:

这是相当随机的,但当它发生时,我看到:

12-31 01:40:44.080  21680-21680/? W/ContextImpl﹕ Calling a method in the system process without a qualified user: 
android.app.ContextImpl.sendOrderedBroadcast:1192 
android.app.ContextImpl.sendOrderedBroadcast:1183       
android.content.ContextWrapper.sendOrderedBroadcast:390 
com.android.settings.applications.ProcessStatsDetail.checkForceStop:314 
com.android.settings.applications.ProcessStatsDetail.onResume:108

in the logs. I can even recreate this by just entering the "process stats" section of the developer tools on the phone. As soon as I select an app that uses the notification listener the puts up this warning and unbinds and destroys the service and when it recreates is it doesn't always pick up on events again.

在日志中。我什至可以通过在手机上输入开发人员工具的“进程统计”部分来重新创建它。一旦我选择了一个使用通知侦听器的应用程序,它就会发出这个警告并解除绑定和破坏服务,当它重新创建时,它并不总是再次接收事件。

I'm not sure why this would happen, can anyone shed any light?

我不确定为什么会发生这种情况,有人可以解释一下吗?

回答by Gabe

1) the NotificationListenerService is started by the system and the code for sendOrderedBroadcastthrows a warning if it was called by the system process (here)

1) NotificationListenerService 由系统启动,如果被系统进程调用,sendOrderedBroadcast的代码抛出警告(这里

2) That is just a warning though. There is probably a crash somewhere else in your code. When a NotificationListenerServicecrashes, Android doesn't restart it unless you toggle the permission or restart your phone. Look for another crash and try either of those methods to restart it if it has. Starting it yourself will notwork.

2)这只是一个警告。您的代码中的其他地方可能发生了崩溃。当NotificationListenerService崩溃时,除非您切换权限或重新启动手机,否则 Android 不会重新启动它。寻找另一次崩溃并尝试其中任何一种方法来重新启动它(如果有)。开始它自己将不会工作。