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

Commit 7d1d7322 authored by Jane Ha's avatar Jane Ha
Browse files

Keep IME's visible state while interacting with other screens

when the background user is visible

Bug: 352081116
Test: atest SystemUITests
Flag: EXEMPT bugfix

Change-Id: Ib291815ac980529cd2e817670b601c15276e9630
parent a312222c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Pair;
import android.util.SparseArray;
import android.view.KeyEvent;
@@ -200,6 +201,7 @@ public class CommandQueue extends IStatusBar.Stub implements
     * event.
     */
    private int mLastUpdatedImeDisplayId = INVALID_DISPLAY;
    private final Context mContext;
    private final DisplayTracker mDisplayTracker;
    private final @Nullable CommandRegistry mRegistry;
    private final @Nullable DumpHandler mDumpHandler;
@@ -571,6 +573,7 @@ public class CommandQueue extends IStatusBar.Stub implements
            DumpHandler dumpHandler,
            Lazy<PowerInteractor> powerInteractor
    ) {
        mContext = context;
        mDisplayTracker = displayTracker;
        mRegistry = registry;
        mDumpHandler = dumpHandler;
@@ -1209,7 +1212,12 @@ public class CommandQueue extends IStatusBar.Stub implements
            boolean showImeSwitcher) {
        if (displayId == INVALID_DISPLAY) return;

        if (mLastUpdatedImeDisplayId != displayId
        boolean isConcurrentMultiUserModeEnabled = UserManager.isVisibleBackgroundUsersEnabled()
                && mContext.getResources().getBoolean(android.R.bool.config_perDisplayFocusEnabled)
                && android.view.inputmethod.Flags.concurrentInputMethods();

        if (!isConcurrentMultiUserModeEnabled
                && mLastUpdatedImeDisplayId != displayId
                && mLastUpdatedImeDisplayId != INVALID_DISPLAY) {
            // Set previous NavBar's IME window status as invisible when IME
            // window switched to another display for single-session IME case.