From 64f0cae9f44a71eaae2f5809cdd9627e2e809edf Mon Sep 17 00:00:00 2001 From: Peeyush Agarwal Date: Thu, 9 Feb 2017 19:55:20 +0000 Subject: [PATCH] Fix KeyboardShortcuts show The keyboard shortcuts should be shown only if they have not been dismissed already (by using the dismiss method). Check that sInstance is not null just before displaying the shortcuts popup. Test: Manual Bug: 35163857 Change-Id: I17079bc893808c84ccee8e9a6e31130921b7db28 --- .../systemui/statusbar/KeyboardShortcuts.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java index bd5fb923cb840..0ea56b876d923 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java @@ -381,12 +381,7 @@ public final class KeyboardShortcuts { if (appShortcuts != null) { result.add(appShortcuts); } - synchronized (sLock) { - // showKeyboardShortcutsDialog only if it has not been dismissed already - if (sInstance != null) { - showKeyboardShortcutsDialog(result); - } - } + showKeyboardShortcutsDialog(result); } }, deviceId); } @@ -585,7 +580,12 @@ public final class KeyboardShortcuts { mKeyboardShortcutsDialog.setCanceledOnTouchOutside(true); Window keyboardShortcutsWindow = mKeyboardShortcutsDialog.getWindow(); keyboardShortcutsWindow.setType(TYPE_SYSTEM_DIALOG); - mKeyboardShortcutsDialog.show(); + synchronized (sLock) { + // showKeyboardShortcutsDialog only if it has not been dismissed already + if (sInstance != null) { + mKeyboardShortcutsDialog.show(); + } + } } private void populateKeyboardShortcuts(LinearLayout keyboardShortcutsLayout,