From c4ddddc2aa537fdc487fa63849cdf356dd49da28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cosmin=20B=C4=83ie=C8=99?= Date: Wed, 15 Jan 2025 16:15:07 +0100 Subject: [PATCH] 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 --- .../launcher3/taskbar/TaskbarStashController.java | 10 ++-------- .../launcher3/taskbar/bubbles/BubbleBarController.java | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 68114f18f6..b039dbaccb 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -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. * *

Do not stash if in small screen, with 3 button nav, and in landscape (or seascape). *

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) { diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index aff879e601..777e467a2e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -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