java - 向aosp_shamu, 6.0.1里push一个SystemUI出现的异常
巴扎黑
巴扎黑 2017-04-18 09:29:40
0
2
1034

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

巴扎黑
巴扎黑

reply all (2)
左手右手慢动作

Caused by: java.lang.SecurityException: uid=10017 needs permission android.permission.READ_CONTACTS to read lock_screen_owner_info_enabled for user 0

There is a problem with permissions. Did you use the wrong signature file when compiling?
Also, after you push the original systemui, will it still crash when you restart the phone?

    左手右手慢动作

    What is your command to push systemUI? Have you pushed it to the corresponding path?

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!