场景:
Settings应用的界面,拉起Dialer的界面报错。
问题描述:
//Fail log:Settings->ApnEditorActivity 01-11 16:46:07.938 1044 6380 W ActivityTaskManager: Permission Denial: package=com.android.settings does not belong to uid=1001
//Pass log: Settings->ApnSettingsActivity 01-11 16:46:03.997 1044 1694 I ActivityTaskManager: START u0 {act=android.intent.action.CALL_BUTTON flg=0x10000000 cmp=com.android.dialer/.app.DialpadActivity} from uid 1000
UI对应的进程配置
<!--AndroidManifest.xml-->
<activity?android:name="Settings$ApnEditorActivity"
android:process="com.android.phone">
原因分析:
UI在com.android.settings, 配置了android:process="com.android.phone",两者处于不同的进程。
源码参考:xref: /packages/apps/Settings/AndroidManifest.xml?(revision 939136b)
<!--xref: /packages/apps/Settings/AndroidManifest.xml (revision 939136b3)-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
? ? ? ? xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
? ? ? ? package="com.android.settings"
? ? ? ? coreApp="true"
? ? ? ? android:sharedUserId="android.uid.system">
Settings应用处于system,phone属于radio
adb shell
top # 查看进程信息
// top 部分结果 PID USER ????????PR ?NI VIRT ?RES ?SHR S[%CPU] %MEM ????TIME+ ARGS 6558 system? ? 20 0 1.0G 137M 110M S 0.0 15.6 0:06.92 com.android.settings 6138 radio ? ? ? ?20 ? 0 1.1G 113M ?98M S ?0.3 ?12.9 ? 1:19.43 com.android.phone
解决方案:
根据日志?ActivityTaskManager: Permission Denial: package=com.android.settings does not belong to uid=1001,应该是包与进程不匹配。去掉android:process="com.android.phone"配置。
|