summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-09-04 20:27:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-04 20:27:50 -0700
commit0d727c714b75b9d9c927eca83aacba8938b08537 (patch)
tree37077b3466fb75cde12aefdcdd7ed78460a32f96 /services/java
parentb326fa046b64b05b9969e0a6e89cf48577bfdae1 (diff)
parente62e6d8731ab1e02c1632ebc011792d07b902af8 (diff)
downloadframeworks_base-0d727c714b75b9d9c927eca83aacba8938b08537.zip
frameworks_base-0d727c714b75b9d9c927eca83aacba8938b08537.tar.gz
frameworks_base-0d727c714b75b9d9c927eca83aacba8938b08537.tar.bz2
Merge "Add subtypeId for keeping enabled "InputMethodSubtype"s even if subtype parameters are changed" into jb-mr1-dev
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 747cf0b..c685473 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -3579,7 +3579,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
private static final String ATTR_IS_AUXILIARY = "isAuxiliary";
private final AtomicFile mAdditionalInputMethodSubtypeFile;
private final HashMap<String, InputMethodInfo> mMethodMap;
- private final HashMap<String, List<InputMethodSubtype>> mSubtypesMap =
+ private final HashMap<String, List<InputMethodSubtype>> mAdditionalSubtypesMap =
new HashMap<String, List<InputMethodSubtype>>();
public InputMethodFileManager(HashMap<String, InputMethodInfo> methodMap) {
if (methodMap == null) {
@@ -3595,18 +3595,19 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mAdditionalInputMethodSubtypeFile = new AtomicFile(subtypeFile);
if (!subtypeFile.exists()) {
// If "subtypes.xml" doesn't exist, create a blank file.
- writeAdditionalInputMethodSubtypes(mSubtypesMap, mAdditionalInputMethodSubtypeFile,
- methodMap);
+ writeAdditionalInputMethodSubtypes(
+ mAdditionalSubtypesMap, mAdditionalInputMethodSubtypeFile, methodMap);
} else {
- readAdditionalInputMethodSubtypes(mSubtypesMap, mAdditionalInputMethodSubtypeFile);
+ readAdditionalInputMethodSubtypes(
+ mAdditionalSubtypesMap, mAdditionalInputMethodSubtypeFile);
}
}
private void deleteAllInputMethodSubtypes(String imiId) {
synchronized (mMethodMap) {
- mSubtypesMap.remove(imiId);
- writeAdditionalInputMethodSubtypes(mSubtypesMap, mAdditionalInputMethodSubtypeFile,
- mMethodMap);
+ mAdditionalSubtypesMap.remove(imiId);
+ writeAdditionalInputMethodSubtypes(
+ mAdditionalSubtypesMap, mAdditionalInputMethodSubtypeFile, mMethodMap);
}
}
@@ -3619,17 +3620,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
final InputMethodSubtype subtype = additionalSubtypes[i];
if (!subtypes.contains(subtype)) {
subtypes.add(subtype);
+ } else {
+ Slog.w(TAG, "Duplicated subtype definition found: "
+ + subtype.getLocale() + ", " + subtype.getMode());
}
}
- mSubtypesMap.put(imi.getId(), subtypes);
- writeAdditionalInputMethodSubtypes(mSubtypesMap, mAdditionalInputMethodSubtypeFile,
- mMethodMap);
+ mAdditionalSubtypesMap.put(imi.getId(), subtypes);
+ writeAdditionalInputMethodSubtypes(
+ mAdditionalSubtypesMap, mAdditionalInputMethodSubtypeFile, mMethodMap);
}
}
public HashMap<String, List<InputMethodSubtype>> getAllAdditionalInputMethodSubtypes() {
synchronized (mMethodMap) {
- return mSubtypesMap;
+ return mAdditionalSubtypesMap;
}
}