Keyboard shortcuts: one instance refactor

Make all the instance public methods private
and add static methods to control the behavior:
* show
* dismiss
* toggle

Make sure we only deal with one instance of the
KeyboardShortcuts (previously both the
KeyboardShortcutsReceiver and BaseStatusBar were
creating instances).

Makes sure the instance is destroyed when dismissing
and when showing it either creates a new one if none
exists or reuses the existing one.

Also fixes an existing nasty issue where in order
to dismiss the dialog from BaseStatusBar we were
always first creating a new instance.

Bug: 28012198
Change-Id: I207553dd45ae535edc64b6292a472fa0899029b0
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java
index 5d22faf..5f4ebd8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java
@@ -26,8 +26,7 @@
     @Override
     public void onReceive(Context context, Intent intent) {
         if (Intent.ACTION_SHOW_KEYBOARD_SHORTCUTS.equals(intent.getAction())) {
-            final KeyboardShortcuts keyboardShortcuts = new KeyboardShortcuts(context);
-            keyboardShortcuts.toggleKeyboardShortcuts(-1 /* deviceId unknown */);
+            KeyboardShortcuts.show(context, -1 /* deviceId unknown */);
         }
     }
 }