Merge "Keyboard Shortcuts: protect against NPE in WindowManagerService" into nyc-dev

This commit is contained in:
Andrei Stingaceanu
2016-04-06 14:26:03 +00:00
committed by Android (Google) Code Review

View File

@@ -10625,7 +10625,10 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId) {
try {
getFocusedWindow().mClient.requestAppKeyboardShortcuts(receiver, deviceId);
WindowState focusedWindow = getFocusedWindow();
if (focusedWindow != null && focusedWindow.mClient != null) {
getFocusedWindow().mClient.requestAppKeyboardShortcuts(receiver, deviceId);
}
} catch (RemoteException e) {
}
}