获取:不允许启动服务Intent...未经许可服务进程不好
ACRA 的挤压报告向我发送了此错误。
java.lang.SecurityException: Not allowed to start service Intent { act=auto_update cmp=net.DailyTimer.CalendarAlarmHelperFree/net.DailyTimer.CalendarAlarmHelper.CalendarAlarmService } without permission Service process is bad
我在有限的设备上看到此错误,并且无法重现。我猜这个错误取决于运行环境。
我的问题是:
- 什么权限是错误的?我不明白“服务流程很糟糕”是什么意思。
编辑:
调用 startService(intent) 启动远程服务时出现此错误。在许多设备上它都可以正常工作。
ACRA's crush report sends me this error.
java.lang.SecurityException: Not allowed to start service Intent { act=auto_update cmp=net.DailyTimer.CalendarAlarmHelperFree/net.DailyTimer.CalendarAlarmHelper.CalendarAlarmService } without permission Service process is bad
I see this error on limited devices and I can't reproduce. I guess this error depends on running environment.
My question is:
- What permission is wrong? I could not find out what "Service process is bad" mean.
EDIT:
I'm getting this error when calling startService(intent) to start remote service. And on many devices it works fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然我自己没有经历过这种情况,但我环顾四周,我认为这些可能对你有用。 此处,用户 Jomia 说道:
另外,请考虑查看此页面,特别是在
公共静态最终int CONTEXT_INCLUDE_CODE
。这是相关部分:我希望我能提供一些帮助。如果这些回复与您的问题无关,您可能想尝试发布相关代码等。干杯。
Although I have not experienced this myself, I did some looking around and I think these might be useful to you. Here, user Jomia says:
Also, consider taking a look at this page, specifically under
public static final int CONTEXT_INCLUDE_CODE
. Here is the relevant part:I hope I could be of some help. If these responses are unrelated to your issue, you might want to try posting relevant code, etc. Cheers.
参见源代码第10494行,如果方法“bringUpServiceLocked”返回false,则会抛出“Service process is bad”异常
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/com/android/server/am/ActivityManagerService.java# ActivityManagerService.startProcessLocked%28com.android.server.am.ProcessRecord%2Cjava.lang.String%2Cjava.lang.String%29
see Source code Line 10494,if method "bringUpServiceLocked" return false, it would throw "Service process is bad" Exception
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/com/android/server/am/ActivityManagerService.java#ActivityManagerService.startProcessLocked%28com.android.server.am.ProcessRecord%2Cjava.lang.String%2Cjava.lang.String%29