diff options
| author | 2024-01-09 10:20:38 +0000 | |
|---|---|---|
| committer | 2024-01-09 10:20:38 +0000 | |
| commit | 6f689ff3c0d7fcd79a5ee216b2e10ab01c1572b5 (patch) | |
| tree | 98cce4f462d1d2f17e144f4538fe58c9c3924d52 | |
| parent | c796e8e989b5925a8fa690dd78f297f4dbad276b (diff) | |
| parent | a4b957015697b6ade58291245a076c96e0c3cb4c (diff) | |
Merge "Skip IMM#ensureDefaultInstance in system_server" into main
| -rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index feccc6bef7a4..3bc02a6c8fd1 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -354,7 +354,11 @@ public final class InputMethodManager { * @hide */ public static void ensureDefaultInstanceForDefaultDisplayIfNecessary() { - forContextInternal(Display.DEFAULT_DISPLAY, Looper.getMainLooper()); + // Skip this call if we are in system_server, as the system code should not use this + // deprecated instance. + if (!ActivityThread.isSystem()) { + forContextInternal(Display.DEFAULT_DISPLAY, Looper.getMainLooper()); + } } private static final Object sLock = new Object(); |