Merge "Prevent IMEs from switching to another IME that isn't enabled" into tm-qpr-dev am: 1b2695237b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21342766 Change-Id: Ief5e884a8ebe39cd20cfda8e938e5263ade2888e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -4831,6 +4831,13 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
Slog.w(TAG, "Ignoring setInputMethod of uid " + Binder.getCallingUid()
|
Slog.w(TAG, "Ignoring setInputMethod of uid " + Binder.getCallingUid()
|
||||||
+ " token: " + token);
|
+ " token: " + token);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
// Called with current IME's token.
|
||||||
|
if (mMethodMap.get(id) != null
|
||||||
|
&& mSettings.getEnabledInputMethodListWithFilterLocked(
|
||||||
|
(info) -> info.getId().equals(id)).isEmpty()) {
|
||||||
|
throw new IllegalStateException("Requested IME is not enabled: " + id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final long ident = Binder.clearCallingIdentity();
|
final long ident = Binder.clearCallingIdentity();
|
||||||
|
|||||||
Reference in New Issue
Block a user