summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2015-05-04 13:02:22 -0700
committerSeigo Nonaka <nona@google.com>2015-05-06 20:29:05 +0000
commit80ff4ed6bb8dbdad7192d679a01096aa888e090b (patch)
treef9f1262ed2fa489d30c431e824241c09a27f3641 /core/java/com
parentd4474cb9454c7a8b907c0be07236ffed4ecf3fd8 (diff)
downloadframeworks_base-80ff4ed6bb8dbdad7192d679a01096aa888e090b.zip
frameworks_base-80ff4ed6bb8dbdad7192d679a01096aa888e090b.tar.gz
frameworks_base-80ff4ed6bb8dbdad7192d679a01096aa888e090b.tar.bz2
Always show auxiliary subtypes from NavBar keyboard icon.
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: I1e50ee42838a1bf64a612da4904aa93458d44ea4
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java14
-rw-r--r--core/java/com/android/internal/view/IInputMethodManager.aidl3
2 files changed, 12 insertions, 5 deletions
diff --git a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java
index 52485dd..ce94727 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java
@@ -196,7 +196,7 @@ public class InputMethodSubtypeSwitchingController {
}
public List<ImeSubtypeListItem> getSortedInputMethodAndSubtypeList(
- boolean showSubtypes, boolean inputShown, boolean isScreenLocked) {
+ boolean showSubtypes, boolean includeAuxiliarySubtypes, boolean isScreenLocked) {
final ArrayList<ImeSubtypeListItem> imList =
new ArrayList<ImeSubtypeListItem>();
final HashMap<InputMethodInfo, List<InputMethodSubtype>> immis =
@@ -205,6 +205,12 @@ public class InputMethodSubtypeSwitchingController {
if (immis == null || immis.size() == 0) {
return Collections.emptyList();
}
+ if (isScreenLocked && includeAuxiliarySubtypes) {
+ if (DEBUG) {
+ Slog.w(TAG, "Auxiliary subtypes are not allowed to be shown in lock screen.");
+ }
+ includeAuxiliarySubtypes = false;
+ }
mSortedImmis.clear();
mSortedImmis.putAll(immis);
for (InputMethodInfo imi : mSortedImmis.keySet()) {
@@ -227,7 +233,7 @@ public class InputMethodSubtypeSwitchingController {
final String subtypeHashCode = String.valueOf(subtype.hashCode());
// We show all enabled IMEs and subtypes when an IME is shown.
if (enabledSubtypeSet.contains(subtypeHashCode)
- && ((inputShown && !isScreenLocked) || !subtype.isAuxiliary())) {
+ && (includeAuxiliarySubtypes || !subtype.isAuxiliary())) {
final CharSequence subtypeLabel =
subtype.overridesImplicitlyEnabledSubtype() ? null : subtype
.getDisplayName(mContext, imi.getPackageName(),
@@ -516,8 +522,8 @@ public class InputMethodSubtypeSwitchingController {
}
public List<ImeSubtypeListItem> getSortedInputMethodAndSubtypeListLocked(boolean showSubtypes,
- boolean inputShown, boolean isScreenLocked) {
+ boolean includingAuxiliarySubtypes, boolean isScreenLocked) {
return mSubtypeList.getSortedInputMethodAndSubtypeList(
- showSubtypes, inputShown, isScreenLocked);
+ showSubtypes, includingAuxiliarySubtypes, isScreenLocked);
}
}
diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl
index 6f104dd..60c5e42 100644
--- a/core/java/com/android/internal/view/IInputMethodManager.aidl
+++ b/core/java/com/android/internal/view/IInputMethodManager.aidl
@@ -59,7 +59,8 @@ interface IInputMethodManager {
int controlFlags, int softInputMode, int windowFlags,
in EditorInfo attribute, IInputContext inputContext);
- void showInputMethodPickerFromClient(in IInputMethodClient client);
+ void showInputMethodPickerFromClient(in IInputMethodClient client,
+ int auxiliarySubtypeMode);
void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
void setInputMethod(in IBinder token, String id);
void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);