Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4b95701 authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Skip IMM#ensureDefaultInstance in system_server

The system code should not rely on/use the static instance of
InputMethodManager, so we should skip this call entirely when running in
system_server.

Bug: 318819032
Test: n/a
Change-Id: Ie7d409cb32b577e788ef8870677576955d615efd
parent 970067a4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -354,8 +354,12 @@ public final class InputMethodManager {
     * @hide
     */
    public static void ensureDefaultInstanceForDefaultDisplayIfNecessary() {
        // 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();