찾다

 >  Q&A  >  본문

java - 向aosp_shamu, 6.0.1里push一个SystemUI出现的异常

1.买了一个nexus 6, 编译了源码aosp_shamu_userdebug 版, 刷机器为aosp编译出来的rom, 然后修改SystemUI里的东西(只是加了一些log, 为了查看流程), 然后adb push 到手机, 就出现了systemUI异常的问题. 然后把原来编译出来的SystemUI(未做修改)adb push到手机, 依然出现systemUI异常的错误.

  1. 采用的是aosp的源码, 直接在github上可以搜到.github源码地方:https://github.com/android/platform_frameworks_base/tree/master/packages/SystemUI

3.一下出现的错误信息

01-24 06:31:34.464 E/AndroidRuntime( 2176): FATAL EXCEPTION: main
01-24 06:31:34.464 E/AndroidRuntime( 2176): Process: com.android.systemui, PID: 2176
01-24 06:31:34.464 E/AndroidRuntime( 2176): android.view.InflateException: Binary XML file line #87: uid=10017 needs permission android.permission.READ_CONTACTS to read lock_screen_owner_info_enabled for user 0
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.View.inflate(View.java:19790)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:665)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:2815)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:2811)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:601)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:614)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.SystemBars.createStatusBarFromConfig(SystemBars.java:106)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.SystemBars.onNoService(SystemBars.java:58)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.ServiceMonitor.startService(ServiceMonitor.java:230)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.ServiceMonitor.-wrap5(ServiceMonitor.java)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.systemui.statusbar.ServiceMonitor$1.handleMessage(ServiceMonitor.java:73)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.os.Handler.dispatchMessage(Handler.java:102)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.os.Looper.loop(Looper.java:148)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.app.ActivityThread.main(ActivityThread.java:5417)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at java.lang.reflect.Method.invoke(Native Method)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-24 06:31:34.464 E/AndroidRuntime( 2176): Caused by: java.lang.SecurityException: uid=10017 needs permission android.permission.READ_CONTACTS to read lock_screen_owner_info_enabled for user 0
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.os.Parcel.readException(Parcel.java:1620)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.os.Parcel.readException(Parcel.java:1573)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.internal.widget.ILockSettings$Stub$Proxy.getBoolean(ILockSettings.java:368)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.internal.widget.LockPatternUtils.getBoolean(LockPatternUtils.java:1095)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.internal.widget.LockPatternUtils.isOwnerInfoEnabled(LockPatternUtils.java:573)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.keyguard.KeyguardStatusView.getOwnerInfo(KeyguardStatusView.java:203)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.keyguard.KeyguardStatusView.updateOwnerInfo(KeyguardStatusView.java:179)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at com.android.keyguard.KeyguardStatusView.onFinishInflate(KeyguardStatusView.java:119)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:844)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:831)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:831)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
01-24 06:31:34.464 E/AndroidRuntime( 2176):     ... 19 more

4.报错是systemUI发生异常, 然后是不断的重启SystemUI, 不断地发生异常.
5.目前在so上发现一个类似的, 但不全像我的问题. 连接在此:http://stackoverflow.com/questions/32115650/android-app-crashes-when-trying-to-read-contacts-in-android-marshmallow-android

巴扎黑巴扎黑2770일 전1118

모든 응답(2)나는 대답할 것이다

  • ringa_lee

    ringa_lee2017-04-18 09:31:40

    발생 원인: java.lang.SecurityException: uid=10017은 사용자 0에 대해 lock_screen_owner_info_enabled를 읽으려면 android.permission.READ_CONTACTS 권한이 필요합니다.

    권한에 문제가 있습니다. 컴파일 시 잘못된 서명 파일을 사용하셨나요?
    또한 원래 시스템 UI를 푸시한 후 휴대폰을 다시 시작하면 여전히 충돌이 발생합니까?

    회신하다
    0
  • ringa_lee

    ringa_lee2017-04-18 09:31:40

    systemUI를 푸시하는 명령은 무엇입니까? 해당 경로로 푸시하셨나요?

    회신하다
    0
  • 취소회신하다