Remove redundant references to IME Switcher vis

The taskbar and bubble bar were using both the visibility of the IME and
that of the IME Switcher button to determine whether these bars should
be stashed. However, the IME Switcher button will never be visible while
the IME is not visible, so using its visibility is redundant.

This changes the stashing logic to only take into account the IME
visibility. Note, the IME is also considered visible even when a
hardware keyboard is connected, regardless of any UI being visible or
not. This visibility state determines various system behaviours.

Flag: EXEMPT refactor
Bug: 366129400
Test: open the IME and IME Switcher menu on large screen devices;
  observe taskbar behaviour
Change-Id: Ibcd16896582ca575538d8c1c3d2ab879090d075c
This commit is contained in:
Cosmin Băieș
2025-01-15 16:15:07 +01:00
parent ee04a3e0fd
commit c4ddddc2aa
2 changed files with 3 additions and 11 deletions
@@ -35,7 +35,6 @@ import static com.android.quickstep.util.SystemUiFlagUtils.isTaskbarHidden;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DIALOG_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
@@ -261,8 +260,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
private boolean mIsSystemGestureInProgress;
/** Whether the IME is visible. */
private boolean mIsImeShowing;
/** Whether the IME Switcher button is visible. */
private boolean mIsImeSwitcherButtonShowing;
private final Alarm mTimeoutAlarm = new Alarm();
private boolean mEnableBlockingTimeoutDuringTests = false;
@@ -1149,8 +1146,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
SystemUiFlagUtils.isLocked(systemUiStateFlags));
mIsImeShowing = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_SHOWING);
mIsImeSwitcherButtonShowing =
hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING);
if (updateStateForFlag(FLAG_STASHED_IME, shouldStashForIme())) {
animDuration = TASKBAR_STASH_DURATION_FOR_IME;
startDelay = getTaskbarStashStartDelayForIme();
@@ -1166,7 +1161,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
}
/**
* We stash when IME or IME switcher is showing.
* We stash when the IME is showing.
*
* <p>Do not stash if in small screen, with 3 button nav, and in landscape (or seascape).
* <p>Do not stash if taskbar is transient.
@@ -1202,7 +1197,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
return false;
}
return mIsImeShowing || mIsImeSwitcherButtonShowing;
return mIsImeShowing;
}
/**
@@ -1378,7 +1373,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
pw.println(prefix + "\tmState=" + getStateString(mState));
pw.println(prefix + "\tmIsSystemGestureInProgress=" + mIsSystemGestureInProgress);
pw.println(prefix + "\tmIsImeShowing=" + mIsImeShowing);
pw.println(prefix + "\tmIsImeSwitcherButtonShowing=" + mIsImeSwitcherButtonShowing);
}
private static String getStateString(long flags) {
@@ -20,7 +20,6 @@ import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
@@ -94,8 +93,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED
| SYSUI_STATE_IME_SHOWING
| SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED
| SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING;
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
private static final long MASK_HIDE_HANDLE_VIEW = SYSUI_STATE_BOUNCER_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING