diff options
| author | 2015-05-19 22:15:02 -0700 | |
|---|---|---|
| committer | 2015-05-19 23:21:17 -0700 | |
| commit | 54d512c9acc44484b7baa8d8cf02067d175dde11 (patch) | |
| tree | f3ba3230b94bac2b22d21124df43efd61f9cfc95 | |
| parent | 1c5bf7f1ddc8c9c9844a1bc1a7e4ce53dcc5d5bd (diff) | |
Invalidate IMMS#mCurrentSubtype when upgrading the current IME.
Whenever the package to which the current IME belongs is
modified, IMMS#mCurrentSubtype needs to be invalidated.
Otherwize, InputMethodManager#getCurrentInputMethodSubtype()
continues to return the previously selected subtype.
One example scenario would be to update metadata of a subtype
in a new version of an IME with keeping the same subtypeId.
Suppose imeSubtypeExtraValue was updated from "ABC" to "XYZ".
In this scenario, the subtype in question retrieved with
IMM#getInputMethodList() then InputMethodInfo#getSubtypeAt()
has imeSubtypeExtraValue "XYZ", while the subtype returned
from InputMethodManager#getCurrentInputMethodSubtype() still
has imeSubtypeExtraValue "ABC".
With this CL, IMMS#mCurrentSubtype will be invalidate when
the active IME package is modified.
Bug: 21310194
Bug: 20708002
Change-Id: Ifbb35034d9c8e477ebb5353d2a470dfc1627bbd5
| -rw-r--r-- | services/core/java/com/android/server/InputMethodManagerService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 1f6c47371e97..ab0c8a97fa0f 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -675,6 +675,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // We currently don't have a default input method... is // one now available? changed = chooseNewDefaultIMELocked(); + } else if (!changed && isPackageModified(curIm.getPackageName())) { + // Even if the current input method is still available, mCurrentSubtype could + // be obsolete when the package is modified in practice. + changed = true; } if (changed) { |