Hook up Ctrl + '/' to SysUI for a Keyboard Shortcuts screen
This CL adds the necessary hooks between PhoneWindowManager
and SysUI to show a keyboard shortcuts screen given a specific
shortcut combination. SysUI for now just shows a Toast.
Change-Id: Icf43a81776b04a2e96a540f45b7cd3464342d679
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index a55256d..3a96626 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -135,6 +135,7 @@
protected static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 1023;
protected static final int MSG_SHOW_NEXT_AFFILIATED_TASK = 1024;
protected static final int MSG_SHOW_PREV_AFFILIATED_TASK = 1025;
+ protected static final int MSG_SHOW_KEYBOARD_SHORTCUTS_MENU = 1026;
protected static final boolean ENABLE_HEADS_UP = true;
// scores above this threshold should be displayed in heads up mode.
@@ -1066,6 +1067,13 @@
mHandler.sendEmptyMessage(msg);
}
+ @Override
+ public void showKeyboardShortcutsMenu() {
+ int msg = MSG_SHOW_KEYBOARD_SHORTCUTS_MENU;
+ mHandler.removeMessages(msg);
+ mHandler.sendEmptyMessage(msg);
+ }
+
/** Jumps to the next affiliated task in the group. */
public void showNextAffiliatedTask() {
int msg = MSG_SHOW_NEXT_AFFILIATED_TASK;
@@ -1143,6 +1151,10 @@
}
}
+ protected void showKeyboardShortcuts() {
+ Toast.makeText(mContext, "Show keyboard shortcuts screen", Toast.LENGTH_LONG).show();
+ }
+
protected void cancelPreloadingRecents() {
if (mRecents != null) {
mRecents.cancelPreloadingRecents();
@@ -1253,6 +1265,9 @@
case MSG_SHOW_PREV_AFFILIATED_TASK:
showRecentsPreviousAffiliatedTask();
break;
+ case MSG_SHOW_KEYBOARD_SHORTCUTS_MENU:
+ showKeyboardShortcuts();
+ break;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index a1b07b5..d0cd6cb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -64,6 +64,7 @@
private static final int MSG_APP_TRANSITION_STARTING = 21 << MSG_SHIFT;
private static final int MSG_ASSIST_DISCLOSURE = 22 << MSG_SHIFT;
private static final int MSG_START_ASSIST = 23 << MSG_SHIFT;
+ private static final int MSG_SHOW_KEYBOARD_SHORTCUTS = 24 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -98,6 +99,7 @@
public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
public void toggleRecentApps();
public void preloadRecentApps();
+ public void showKeyboardShortcutsMenu();
public void cancelPreloadRecentApps();
public void setWindowState(int window, int state);
public void buzzBeepBlinked();
@@ -224,6 +226,14 @@
}
}
+ @Override
+ public void showKeyboardShortcutsMenu() {
+ synchronized (mList) {
+ mHandler.removeMessages(MSG_SHOW_KEYBOARD_SHORTCUTS);
+ mHandler.obtainMessage(MSG_SHOW_KEYBOARD_SHORTCUTS).sendToTarget();
+ }
+ }
+
public void setWindowState(int window, int state) {
synchronized (mList) {
// don't coalesce these
@@ -360,6 +370,9 @@
case MSG_CANCEL_PRELOAD_RECENT_APPS:
mCallbacks.cancelPreloadRecentApps();
break;
+ case MSG_SHOW_KEYBOARD_SHORTCUTS:
+ mCallbacks.showKeyboardShortcutsMenu();
+ break;
case MSG_SET_WINDOW_STATE:
mCallbacks.setWindowState(msg.arg1, msg.arg2);
break;