summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-07-04 16:27:53 +0900
committersatok <satok@google.com>2011-07-04 17:47:11 +0900
commit4c5fdcc3f70ac5496b21d7db57f62ee9db4e6a19 (patch)
tree8154a8e9248685a6e81cad37929c94f9b09a77e2 /src
parent5c9e37c295a0219731882eca7a8805a08a439c34 (diff)
downloadpackages_apps_settings-4c5fdcc3f70ac5496b21d7db57f62ee9db4e6a19.zip
packages_apps_settings-4c5fdcc3f70ac5496b21d7db57f62ee9db4e6a19.tar.gz
packages_apps_settings-4c5fdcc3f70ac5496b21d7db57f62ee9db4e6a19.tar.bz2
Update settings for aux imes
Change-Id: I7528241eb0882fa5fae2a80e380375683cce2075
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java24
-rw-r--r--src/com/android/settings/inputmethod/InputMethodPreference.java16
2 files changed, 22 insertions, 18 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
index 362fbb5..f62edc4 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
@@ -169,9 +169,10 @@ public class InputMethodAndSubtypeUtil {
final boolean isImeChecked = (pref instanceof CheckBoxPreference) ?
((CheckBoxPreference) pref).isChecked()
: enabledIMEAndSubtypesMap.containsKey(imiId);
- boolean isCurrentInputMethod = imiId.equals(currentInputMethodId);
- boolean systemIme = isSystemIme(imi);
- if (((onlyOneIME || systemIme) && !hasHardKeyboard) || isImeChecked) {
+ final boolean isCurrentInputMethod = imiId.equals(currentInputMethodId);
+ final boolean auxIme = isAuxiliaryIme(imi);
+ final boolean systemIme = isSystemIme(imi);
+ if (((onlyOneIME || (systemIme && !auxIme)) && !hasHardKeyboard) || isImeChecked) {
if (!enabledIMEAndSubtypesMap.containsKey(imiId)) {
// imiId has just been enabled
enabledIMEAndSubtypesMap.put(imiId, new HashSet<String>());
@@ -276,7 +277,7 @@ public class InputMethodAndSubtypeUtil {
List<InputMethodInfo> inputMethodInfos,
final Map<String, List<Preference>> inputMethodPrefsMap) {
HashMap<String, HashSet<String>> enabledSubtypes =
- getEnabledInputMethodsAndSubtypeList(resolver);
+ getEnabledInputMethodsAndSubtypeList(resolver);
for (InputMethodInfo imi : inputMethodInfos) {
final String imiId = imi.getId();
@@ -342,4 +343,19 @@ public class InputMethodAndSubtypeUtil {
return (property.getServiceInfo().applicationInfo.flags
& ApplicationInfo.FLAG_SYSTEM) != 0;
}
+
+ public static boolean isAuxiliaryIme(InputMethodInfo imi) {
+ final int subtypeCount = imi.getSubtypeCount();
+ if (subtypeCount == 0) {
+ return false;
+ } else {
+ for (int i = 0; i < subtypeCount; ++i) {
+ final InputMethodSubtype subtype = imi.getSubtypeAt(i);
+ if (!subtype.isAuxiliary()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
}
diff --git a/src/com/android/settings/inputmethod/InputMethodPreference.java b/src/com/android/settings/inputmethod/InputMethodPreference.java
index 75a32a0..21057a6 100644
--- a/src/com/android/settings/inputmethod/InputMethodPreference.java
+++ b/src/com/android/settings/inputmethod/InputMethodPreference.java
@@ -69,20 +69,8 @@ public class InputMethodPreference extends CheckBoxPreference
mImi = imi;
updateSummary();
mIsSystemIme = InputMethodAndSubtypeUtil.isSystemIme(imi);
- final int subtypeCount = imi.getSubtypeCount();
- boolean onlyAux = true;
- if (subtypeCount == 0) {
- onlyAux = false;
- } else {
- for (int i = 0; i < subtypeCount; ++i) {
- final InputMethodSubtype subtype = imi.getSubtypeAt(i);
- if (!subtype.isAuxiliary()) {
- onlyAux = false;
- break;
- }
- }
- }
- if (imiCount <= 1 || (mIsSystemIme && !onlyAux)) {
+ final boolean isAuxIme = InputMethodAndSubtypeUtil.isAuxiliaryIme(imi);
+ if (imiCount <= 1 || (mIsSystemIme && !isAuxIme)) {
setEnabled(false);
}
}