Skip to content
Commit f6711474 authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

Keyboard Shortcuts: protect against NPE in WindowManagerService

Using an unresponsive app [while (true) { Thread.sleep(1000) }]
produces NPE:

WindowManager: Window Manager Crash
WindowManager: java.lang.NullPointerException: Attempt to read
               from field 'android.view.IWindow
               com.android.server.wm.WindowState.mClient' on a
               null object reference
WindowManager: at com.android.server.wm.WindowManagerService
               .requestAppKeyboardShortcuts
               (WindowManagerService.java:10628)

Which puts down SysUI (and requires restarting SysUI).

Protect against this by checking for nulls. The end result
is that the dialog is no longer shown for unresponsive apps
and SysUI does not break.

Bug: 27914463
Change-Id: I37f0b0d5980f6ddc50f3bb778582d23ee1c7e9c3
parent 36712853
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