summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@gogole.com>2015-05-06 21:04:13 -0700
committerYohei Yukawa <yukawa@google.com>2015-05-06 21:34:07 -0700
commit14e139179be7daab6ed452105387a3922752c219 (patch)
tree67bb61296b49a2e56d30c617c8756b1d329c89ff /services
parent9132c5ab0746f56909ed5630a6e93c9fadefabd0 (diff)
downloadframeworks_base-14e139179be7daab6ed452105387a3922752c219.zip
frameworks_base-14e139179be7daab6ed452105387a3922752c219.tar.gz
frameworks_base-14e139179be7daab6ed452105387a3922752c219.tar.bz2
Retry "Always show auxiliary subtypes from NavBar keyboard icon."
This CL relands I1e50ee42838a1bf64a612da4904aa93458d44ea4, which was reverted by I3decaf37198e5864a1763a059df4a36ebc70c5a7 due to the build breakage in 'layoutlib' target, with a proper fix. Hereafter the original CL description is repeated. The auxiliary subtypes should be listed if the input method picker is opened from NavBar keyboard icon. However there is only IMM#showInputMethodPicker() API to open input method picker and this is also used from LockScreen or Settings UI. Auxiliary subtypes should not be listed there(Id7cf5d122). Thus framework shows auxiliary subtypes based on IMMS#mInputShown and LockScreen state, but it is not a perfect solution. If a physical keyboard is connected, the soft input may be gone. As the result, auxiliary subtypes won't be listed even if it is opened from NavBar keyboard icon. To fix this issue, this CL introduces IMM#showInputMethodPicker(boolean) to be able to decide showing auxiliary subtypes by caller. Note that IMM#showInputMethodPicker(boolean) is still hidden with @hide. There is no public API change in this CL. Bug: 20763994 Change-Id: Id156c85535a221235737ea6dcc15a67f1c4b9f71
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java32
1 files changed, 26 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 638965a..9511f54 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -2236,7 +2236,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
@Override
- public void showInputMethodPickerFromClient(IInputMethodClient client) {
+ public void showInputMethodPickerFromClient(
+ IInputMethodClient client, int auxiliarySubtypeMode) {
if (!calledFromValidUser()) {
return;
}
@@ -2249,7 +2250,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
// Always call subtype picker, because subtype picker is a superset of input method
// picker.
- mHandler.sendEmptyMessage(MSG_SHOW_IM_SUBTYPE_PICKER);
+ mHandler.sendMessage(mCaller.obtainMessageI(
+ MSG_SHOW_IM_SUBTYPE_PICKER, auxiliarySubtypeMode));
}
}
@@ -2595,7 +2597,25 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
SomeArgs args;
switch (msg.what) {
case MSG_SHOW_IM_SUBTYPE_PICKER:
- showInputMethodMenu();
+ final boolean showAuxSubtypes;
+ switch (msg.arg1) {
+ case InputMethodManager.SHOW_IM_PICKER_MODE_AUTO:
+ // This is undocumented so far, but IMM#showInputMethodPicker() has been
+ // implemented so that auxiliary subtypes will be excluded when the soft
+ // keyboard is invisible.
+ showAuxSubtypes = mInputShown;
+ break;
+ case InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES:
+ showAuxSubtypes = true;
+ break;
+ case InputMethodManager.SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES:
+ showAuxSubtypes = false;
+ break;
+ default:
+ Slog.e(TAG, "Unknown subtype picker mode = " + msg.arg1);
+ return false;
+ }
+ showInputMethodMenu(showAuxSubtypes);
return true;
case MSG_SHOW_IM_SUBTYPE_ENABLER:
@@ -2878,8 +2898,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
&& mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure();
}
- private void showInputMethodMenu() {
- if (DEBUG) Slog.v(TAG, "Show switching menu");
+ private void showInputMethodMenu(boolean showAuxSubtypes) {
+ if (DEBUG) Slog.v(TAG, "Show switching menu. showAuxSubtypes=" + showAuxSubtypes);
final Context context = mContext;
final boolean isScreenLocked = isScreenLocked();
@@ -2900,7 +2920,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
final List<ImeSubtypeListItem> imList =
mSwitchingController.getSortedInputMethodAndSubtypeListLocked(
- true /* showSubtypes */, mInputShown, isScreenLocked);
+ true /* showSubtypes */, showAuxSubtypes, isScreenLocked);
if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) {
final InputMethodSubtype currentSubtype = getCurrentInputMethodSubtypeLocked();