[RK3399][Android7.1] 调试笔记 --- Sending non-protected broadcast ...

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

使用自定义的广播,然后用命令行测试的时候出现如下warning:

 1300 D AndroidRuntime: Calling main entry com.android.commands.am.Am
01-01 08:00:36.945   610  1072 E ActivityManager: Sending non-protected broadcast android.intent.action.SHOW_NAVIGATION_BAR from system uid 0 pkg null
01-01 08:00:36.945   610  1072 E ActivityManager: java.lang.Throwable
01-01 08:00:36.945   610  1072 E ActivityManager: 	at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:18137)
01-01 08:00:36.945   610  1072 E ActivityManager: 	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:18704)
01-01 08:00:36.945   610  1072 E ActivityManager: 	at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18795)
01-01 08:00:36.945   610  1072 E ActivityManager: 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:499)
01-01 08:00:36.945   610  1072 E ActivityManager: 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2909)
01-01 08:00:36.945   610  1072 E ActivityManager: 	at android.os.Binder.execTransact(Binder.java:565)
01-01 08:00:36.957  1300  1300 D AndroidRuntime: Shutting down VM
01-01 08:00:37.284  1167  1227 D RKUpdateService: WorkHandler::handleMessage() : To perform 'COMMAND_CHECK_LOCAL_UPDATING'.
01-01 08:00:37.284  1167  1227 D RKUpdateService: getValidFirmwareImageFile() : Target image file path : /data/media/0/update.zip
01-01 08:00:37.284  1167  1227 D RKUpdateService: getValidFirmwareImageFile() : Target image file path : /storage/emulated/0/update.zip

原因:

系统对自定义广播做了保护限制,对广播做了保护限定之后,只有一定权限的用户才可以使用。否则用一次就会打印一次warning,并且保存异常信息到文件中。


解决方法:

framework/base目录:
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 45086c0..d8f3a9a 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -495,6 +495,10 @@
     
     
 
+    
+    
+
+
     
     
     

参考:

Android受限广播(protected-broadcast)
[Q]Sending non-protected broadcast问题分析
protected-broadcast 规范使用系统应用组件自定义广播
protected-broadcast 的一些细节

你可能感兴趣的:(子类__Android,RK3399,protected,broadcast,permission,manifest.xml)