Store the current IME's token in the system bar for changing the current IME to a shortcut IME from the system bar
Bug: 3212206
Bug: 3201828
- Added a shortcut IME button. This will be used for calling a shortcut IME (e.g. Voice input)
- Made the positions of IME buttons left aligned
- IME token is required to change IME because of the security reasons.
Change-Id: I48ba5e2509b3aa1bfd2394f9201427fa6b93c6d3
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index a934cd7..6db5b2b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -107,7 +107,8 @@
View mMenuButton;
View mRecentButton;
- InputMethodButton mInputMethodButton;
+ InputMethodButton mInputMethodSwitchButton;
+ InputMethodButton mInputMethodShortcutButton;
NotificationPanel mNotificationPanel;
NotificationPeekPanel mNotificationPeekWindow;
@@ -294,7 +295,8 @@
mRecentButton.setOnClickListener(mOnClickListener);
// The bar contents buttons
- mInputMethodButton = (InputMethodButton) sb.findViewById(R.id.imeButton);
+ mInputMethodSwitchButton = (InputMethodButton) sb.findViewById(R.id.imeSwitchButton);
+ mInputMethodShortcutButton = (InputMethodButton) sb.findViewById(R.id.imeShortcutButton);
// "shadows" of the status bar features, for lights-out mode
mBackShadow = sb.findViewById(R.id.back_shadow);
@@ -645,11 +647,12 @@
mMenuButton.setVisibility(visible ? View.VISIBLE : View.GONE);
}
- public void setIMEButtonVisible(boolean visible) {
+ public void setIMEButtonVisible(IBinder token, boolean visible) {
if (DEBUG) {
Slog.d(TAG, (visible?"showing":"hiding") + " the IME button");
}
- mInputMethodButton.setIMEButtonVisible(visible);
+ mInputMethodSwitchButton.setIMEButtonVisible(token, visible);
+ mInputMethodShortcutButton.setIMEButtonVisible(token, visible);
}
private void setAreThereNotifications() {