Skip to content
Commit 81e684b7 authored by Miodrag Dinic's avatar Miodrag Dinic Committed by Luca Stefani
Browse files

Fix random systemui crashes during boot



When trying to boot android in emulator, systemui may crash due
to an uninitialized value of mNavigationBar probably because
of some race condition during initialization caused by emulation
performance issues:

08-24 16:28:43.722  1947  1947 E AndroidRuntime: FATAL EXCEPTION: main
08-24 16:28:43.722  1947  1947 E AndroidRuntime: Process: com.android.systemui, PID: 1947
08-24 16:28:43.722  1947  1947 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.app.Fragment.getView()' on a null object reference
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBar.getNavigationBarView(StatusBar.java:4636)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.updateStates(StatusBarKeyguardViewManager.java:537)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.reset(StatusBarKeyguardViewManager.java:207)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.show(StatusBarKeyguardViewManager.java:145)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator.handleShow(KeyguardViewMediator.java:1721)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator.access$2900(KeyguardViewMediator.java:138)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1482)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:105)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6510)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)

This patches adds an explicit checks for (mNavigationBar != null)
everywhere it is used.

Test: Boot ARM & MIPS emulators to homescreen.

Change-Id: I3af868b9da565c7eb6c6882f65fbda4a34d802c8
Signed-off-by: default avatarMiodrag Dinic <miodrag.dinic@imgtec.com>
parent a9020549
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment