From e05eaa3cf0e98b180dba03396e0857b02bb3a455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cosmin=20B=C4=83ie=C8=99?= Date: Thu, 16 Jan 2025 12:57:31 +0100 Subject: [PATCH] Rename IME_SHOWN states to IME_VISIBLE This renames the SysUI states related to the IME and IME Switcher button visibility from "shown" to "visible", to maintain consistency. Flag: EXEMPT refactor Bug: 366129400 Test: n/a Change-Id: I45219e62b633ca984de98df43f5c238604b38109 --- .../taskbar/NavbarButtonsViewController.java | 10 +++++----- .../taskbar/TaskbarStashController.java | 14 +++++++------- .../taskbar/bubbles/BubbleBarController.java | 6 +++--- .../quickstep/RecentsAnimationDeviceState.java | 4 ++-- .../taskbar/TaskbarStashControllerTest.kt | 16 ++++++++-------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index f69d82b2d3..018dca3e27 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -41,8 +41,8 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BACK_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; -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_IME_VISIBLE; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; @@ -331,7 +331,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT // Make sure to remove nav bar buttons translation when any of the following occur: // - Notification shade is expanded - // - IME is showing (add separate translation for IME) + // - IME is visible (add separate translation for IME) // - VoiceInteractionWindow (assistant) is showing // - Keyboard shortcuts helper is showing if (!mContext.isPhoneMode()) { @@ -507,8 +507,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private void parseSystemUiFlags(@SystemUiStateFlags long sysUiStateFlags) { mSysuiStateFlags = sysUiStateFlags; boolean isImeSwitcherButtonVisible = - (sysUiStateFlags & SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING) != 0; - boolean isImeVisible = (sysUiStateFlags & SYSUI_STATE_IME_SHOWING) != 0; + (sysUiStateFlags & SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE) != 0; + boolean isImeVisible = (sysUiStateFlags & SYSUI_STATE_IME_VISIBLE) != 0; boolean a11yVisible = (sysUiStateFlags & SYSUI_STATE_A11Y_BUTTON_CLICKABLE) != 0; boolean isHomeDisabled = (sysUiStateFlags & SYSUI_STATE_HOME_DISABLED) != 0; boolean isRecentsDisabled = (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index b039dbaccb..1ca3dfbd48 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -34,7 +34,7 @@ import static com.android.quickstep.util.SystemActionConstants.SYSTEM_ACTION_ID_ 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_VISIBLE; 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; @@ -259,7 +259,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private @Nullable AnimatorSet mAnimator; private boolean mIsSystemGestureInProgress; /** Whether the IME is visible. */ - private boolean mIsImeShowing; + private boolean mIsImeVisible; private final Alarm mTimeoutAlarm = new Alarm(); private boolean mEnableBlockingTimeoutDuringTests = false; @@ -1119,7 +1119,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba */ @VisibleForTesting long getTaskbarStashStartDelayForIme() { - if (mIsImeShowing) { + if (mIsImeVisible) { // Only delay when IME is exiting, not entering. return 0; } @@ -1145,7 +1145,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba updateStateForFlag(FLAG_STASHED_DEVICE_LOCKED, SystemUiFlagUtils.isLocked(systemUiStateFlags)); - mIsImeShowing = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_SHOWING); + mIsImeVisible = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_VISIBLE); if (updateStateForFlag(FLAG_STASHED_IME, shouldStashForIme())) { animDuration = TASKBAR_STASH_DURATION_FOR_IME; startDelay = getTaskbarStashStartDelayForIme(); @@ -1161,7 +1161,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } /** - * We stash when the IME is showing. + * We stash when the IME is visible. * *

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

Do not stash if taskbar is transient. @@ -1197,7 +1197,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba return false; } - return mIsImeShowing; + return mIsImeVisible; } /** @@ -1372,7 +1372,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba pw.println(prefix + "\tappliedState=" + getStateString(mStatePropertyHolder.mPrevFlags)); pw.println(prefix + "\tmState=" + getStateString(mState)); pw.println(prefix + "\tmIsSystemGestureInProgress=" + mIsSystemGestureInProgress); - pw.println(prefix + "\tmIsImeShowing=" + mIsImeShowing); + pw.println(prefix + "\tmIsImeVisible=" + mIsImeVisible); } 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 777e467a2e..4e029e32be 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -19,7 +19,7 @@ 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_VISIBLE; 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; @@ -91,7 +91,7 @@ public class BubbleBarController extends IBubblesListener.Stub { private static final long MASK_HIDE_BUBBLE_BAR = SYSUI_STATE_BOUNCER_SHOWING | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED - | SYSUI_STATE_IME_SHOWING + | SYSUI_STATE_IME_VISIBLE | SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; @@ -237,7 +237,7 @@ public class BubbleBarController extends IBubblesListener.Stub { boolean sysuiLocked = (flags & MASK_SYSUI_LOCKED) != 0; mBubbleStashController.setSysuiLocked(sysuiLocked); - mIsImeVisible = (flags & SYSUI_STATE_IME_SHOWING) != 0; + mIsImeVisible = (flags & SYSUI_STATE_IME_VISIBLE) != 0; if (mIsImeVisible) { mBubbleBarViewController.onImeVisible(); } diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index 0c89a80703..e1e962add6 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -37,7 +37,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_D import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_PIP_ANIMATING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; -import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_VISIBLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_MAGNIFICATION_OVERLAP; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; @@ -586,7 +586,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener, E /** Returns whether IME is rendering nav buttons, and IME is currently showing. */ public boolean isImeRenderingNavButtons() { return mCanImeRenderGesturalNavButtons && mMode == NO_BUTTON - && ((mSystemUiStateFlags & SYSUI_STATE_IME_SHOWING) != 0); + && ((mSystemUiStateFlags & SYSUI_STATE_IME_VISIBLE) != 0); } /** diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarStashControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarStashControllerTest.kt index 588c22c02b..021e1e417c 100644 --- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarStashControllerTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarStashControllerTest.kt @@ -53,7 +53,7 @@ import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext import com.android.launcher3.util.LauncherMultivalentJUnit import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED -import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING +import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_VISIBLE import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_BAR import com.google.common.truth.Truth.assertThat import com.google.common.truth.TruthJUnit.assume @@ -542,7 +542,7 @@ class TaskbarStashControllerTest { assume().that(activityContext.isHardwareKeyboard).isFalse() getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, false) animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME) } assertThat(viewController.areIconsVisible()).isFalse() @@ -555,7 +555,7 @@ class TaskbarStashControllerTest { assume().that(activityContext.isHardwareKeyboard).isFalse() getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, true) animatorTestRule.advanceTimeBy(0) } @@ -574,7 +574,7 @@ class TaskbarStashControllerTest { // Start with IME shown. getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, true) animatorTestRule.advanceTimeBy(0) } @@ -600,7 +600,7 @@ class TaskbarStashControllerTest { assume().that(activityContext.isHardwareKeyboard).isFalse() getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, false) animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME) } assertThat(viewController.areIconsVisible()).isFalse() @@ -613,7 +613,7 @@ class TaskbarStashControllerTest { assume().that(activityContext.isHardwareKeyboard).isFalse() getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, false) animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME) } @@ -633,7 +633,7 @@ class TaskbarStashControllerTest { assume().that(activityContext.isHardwareKeyboard).isFalse() getInstrumentation().runOnMainSync { - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, true) animatorTestRule.advanceTimeBy(0) } @@ -653,7 +653,7 @@ class TaskbarStashControllerTest { getInstrumentation().runOnMainSync { stashController.updateStateForFlag(FLAG_IN_APP, true) - stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true) + stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_VISIBLE, true) } assertThat(stashController.isStashed).isFalse()