summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shu Chen <shuchen@google.com> 2023-03-10 12:37:04 +0800
committer Shu Chen <shuchen@google.com> 2023-03-10 12:37:04 +0800
commitdc2a2ea7fef5286ec1c8fc8e98134b1febe72071 (patch)
tree1fcdc4fd347289d22816f4cfe41f10d10d048d77
parentbdf9aaf0e933d4065a6017061deb31775f4e71c3 (diff)
Don't remove additional subtypes when ACTION_PACKAGE_CHANGED.
Instead, remove additional subtypes when package is updating. Bug: 269678483 Test: Locally verified the bug. Change-Id: I94261ffaa6e11b5a21af6c5ac831dab66d8459f2
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 91f91f86d275..e32bf1beb300 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -1488,16 +1488,19 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
}
int change = isPackageDisappearing(imi.getPackageName());
- if (isPackageModified(imi.getPackageName())) {
- mAdditionalSubtypeMap.remove(imi.getId());
- AdditionalSubtypeUtils.save(mAdditionalSubtypeMap, mMethodMap,
- mSettings.getCurrentUserId());
- }
if (change == PACKAGE_TEMPORARY_CHANGE
|| change == PACKAGE_PERMANENT_CHANGE) {
Slog.i(TAG, "Input method uninstalled, disabling: "
+ imi.getComponent());
setInputMethodEnabledLocked(imi.getId(), false);
+ } else if (change == PACKAGE_UPDATING) {
+ Slog.i(TAG,
+ "Input method reinstalling, clearing additional subtypes: "
+ + imi.getComponent());
+ mAdditionalSubtypeMap.remove(imi.getId());
+ AdditionalSubtypeUtils.save(mAdditionalSubtypeMap,
+ mMethodMap,
+ mSettings.getCurrentUserId());
}
}
}