Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f0cae9 authored by Peeyush Agarwal's avatar Peeyush Agarwal
Browse files

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
parent 155c3a88
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -381,13 +381,8 @@ 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);
                    }
                        }
                    }
                }, deviceId);
    }

@@ -585,8 +580,13 @@ public final class KeyboardShortcuts {
        mKeyboardShortcutsDialog.setCanceledOnTouchOutside(true);
        Window keyboardShortcutsWindow = mKeyboardShortcutsDialog.getWindow();
        keyboardShortcutsWindow.setType(TYPE_SYSTEM_DIALOG);
        synchronized (sLock) {
            // showKeyboardShortcutsDialog only if it has not been dismissed already
            if (sInstance != null) {
                mKeyboardShortcutsDialog.show();
            }
        }
    }

    private void populateKeyboardShortcuts(LinearLayout keyboardShortcutsLayout,
            List<KeyboardShortcutGroup> keyboardShortcutGroups) {