E FATAL EXCEPTION: main
Process: com.android.systemui, PID: 646
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.updateLockIcon(StatusBarKeyguardViewManager.java:320)
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.onStateChanged(StatusBarKeyguardViewManager.java:1019)
at com.android.systemui.statusbar.StatusBarStateControllerImpl.setState(StatusBarStateControllerImpl.java:163)
at com.android.systemui.statusbar.phone.StatusBar.showKeyguardImpl(StatusBar.java:3242)
at com.android.systemui.statusbar.phone.StatusBar.updateIsKeyguard(StatusBar.java:3221)
at com.android.systemui.statusbar.phone.StatusBar.showKeyguard(StatusBar.java:3181)
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncerOrKeyguard(StatusBarKeyguardViewManager.java:366)
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.reset(StatusBarKeyguardViewManager.java:459)
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.show(StatusBarKeyguardViewManager.java:351)
at com.android.systemui.keyguard.KeyguardViewMediator.handleShow(KeyguardViewMediator.java:1865)
at com.android.systemui.keyguard.KeyguardViewMediator.access$3100(KeyguardViewMediator.java:151)
at com.android.systemui.keyguard.KeyguardViewMediator$6.handleMessage(KeyguardViewMediator.java:1611)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7677)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
开机显示Keyguard的流程:
KeyguardService的onSystemReady调用KeyguardViewMediator的 onSystemReady ,
然后到KeyguardViewMediator的handleSystemReady调用以下来显示:
doKeyguardLocked
showLocked
然后发送SHOW 给 Handler
handleShow
然后到StatusBarKeyguardViewManager的show
StatusBar 的
showKeyguardImpl
updatePanelExpansionForKeyguard
updatePanelExpansionForKeyguard 到
mShadeController.instantExpandNotificationsPanel(); 到
makeExpandedVisible 到
mNotificationShadeWindowController.setPanelVisible(true);
最终调用NotificationShadeWindowController的mNotificationShadeView.setVisibility(View.VISIBLE)
设置为可见.
同时 :
lock_icon_container 何时显示为可见?
StatusBar的mStatusBarStateController.setState(StatusBarState.KEYGUARD);
然后到 StatusBarKeyguardViewManager 的 StatusBarKeyguardViewManager
到 updateLockIcon 来判断 mStatusBarStateController.getState() == StatusBarState.KEYGUARD
如果是true ,则显示 lock_icon_container 。
StatusBarKeyguardViewManager 是一个Listener .
开机是否显示Keyguard?
客户端调用 KeyguardService的onSystemReady 方法,后者调用 KeyguardViewMediator的onSystemReady()方法,
继续到doKeyguardLocked中的LockPatternUtils.isLockScreenDisabled来判断是否要显示锁屏界面。
何处调用KeyguardService的onSystemReady方法
WindowManagerService的systemReady调用PhoneWindowManager的systemReady ,KeyguardDelegate.onSystemReady()
然后通过binder到
KeyguardService的onSystemReady。