title: System UI has stopped emulator when requesting permissions
body: <p>When request permissions, the system show an error message, "System UI has stopped" and keeps restarting until you give the permissions;</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
                Process: com.android.systemui, PID: 3910
                java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.systemui.statusbar.phone.NavigationBarFragment.onKeyguardOccludedChanged(boolean)' on a null object reference
                    at com.android.systemui.statusbar.phone.StatusBar.onKeyguardOccludedChanged(StatusBar.java:3843)
                    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.setOccluded(StatusBarKeyguardViewManager.java:277)
                    at com.android.systemui.keyguard.KeyguardViewMediator.handleSetOccluded(KeyguardViewMediator.java:1176)
                    at com.android.systemui.keyguard.KeyguardViewMediator.-wrap14(Unknown Source:0)
                    at com.android.systemui.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1531)
                    at android.os.Handler.dispatchMessage(Handler.java:105)
                    at android.os.Looper.loop(Looper.java:164)
                    at android.app.ActivityThread.main(ActivityThread.java:6541)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
  </code></pre>
  
  <p>I've tried those answers[1][2], none of them solved my problem.
  This is happening only in the emulator, on physical devices it's OK;</p>
  
  <p>[1] <a href="https://stackoverflow.com/questions/10422275/unfortunately-system-ui-has-stopped">Unfortunately System UI has stopped</a></p>
  
  <p>[2] <a href="https://stackoverflow.com/questions/38654781/android-studio-gradle-error-your-emulator-is-out-of-date">Android Studio gradle Error: your emulator is out of date</a></p>