Propagate IME back disposition state to SystemUI
Previously the navigation bar and taskbar were incorrectly using the
back dispositon state as the source of truth for the IME visibility.
While this can only be set while the IME is visible, it can (and is)
also unset despite the IME still being visible. This was fixed in [1].
While the taskbar previously did not take into account the back
dispositon state, by the IME visibility changing, the rotation of the
back button would also change, leading to an equivalent state. However,
with the fix from [1], this would no longer happen, with one scenario
being showing the IME and then the IME swithcer menu, which temporarily
unsets the back disposition mode while the menu is visible.
This propagates the back disposition state to SystemUI, so taskbar can
respond to changes in this value, rather than in the IME visibility.
[1]: Ic57cea49f5ff49132802083b4f0c9b0e82db1cf7
Flag: EXEMPT bugfix
Test: switch to 3 button nav, show IME, show IME Switcher menu,
observe back button rotation
atest NavigationBarTest#testSetImeWindowStatusSysuiState_ImeVisibleImeSwitcherButtonVisible
NavigationBarTest#testSetImeWindowStatusSysuiState_ImeVisibleImeSwitcherButtonNotVisible
NavigationBarTest#testSetImeWindowStatusSysuiState_ImeNotVisibleImeSwitcherButtonVisible
NavigationBarTest#testSetImeWindowStatusSysuiState_ImeVisibleBackDispositionAdjustNothing
Bug: 366129400
Change-Id: Ib05f9263afb754724021b5f3e48520eff5dad398
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index 018dca3..927254d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -41,6 +41,7 @@
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_ALT_BACK;
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;
@@ -133,19 +134,21 @@
private static final int FLAG_IME_SWITCHER_BUTTON_VISIBLE = 1 << 0;
/** Whether the IME is visible. */
private static final int FLAG_IME_VISIBLE = 1 << 1;
- private static final int FLAG_A11Y_VISIBLE = 1 << 2;
- private static final int FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE = 1 << 3;
- private static final int FLAG_KEYGUARD_VISIBLE = 1 << 4;
- private static final int FLAG_KEYGUARD_OCCLUDED = 1 << 5;
- private static final int FLAG_DISABLE_HOME = 1 << 6;
- private static final int FLAG_DISABLE_RECENTS = 1 << 7;
- private static final int FLAG_DISABLE_BACK = 1 << 8;
- private static final int FLAG_NOTIFICATION_SHADE_EXPANDED = 1 << 9;
- private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 10;
- private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 11;
- private static final int FLAG_SMALL_SCREEN = 1 << 12;
- private static final int FLAG_SLIDE_IN_VIEW_VISIBLE = 1 << 13;
- private static final int FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING = 1 << 14;
+ /** Whether the back button is adjusted for the IME. */
+ private static final int FLAG_IME_ALT_BACK = 1 << 2;
+ private static final int FLAG_A11Y_VISIBLE = 1 << 3;
+ private static final int FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE = 1 << 4;
+ private static final int FLAG_KEYGUARD_VISIBLE = 1 << 5;
+ private static final int FLAG_KEYGUARD_OCCLUDED = 1 << 6;
+ private static final int FLAG_DISABLE_HOME = 1 << 7;
+ private static final int FLAG_DISABLE_RECENTS = 1 << 8;
+ private static final int FLAG_DISABLE_BACK = 1 << 9;
+ private static final int FLAG_NOTIFICATION_SHADE_EXPANDED = 1 << 10;
+ private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11;
+ private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12;
+ private static final int FLAG_SMALL_SCREEN = 1 << 13;
+ private static final int FLAG_SLIDE_IN_VIEW_VISIBLE = 1 << 14;
+ private static final int FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING = 1 << 15;
/**
* Flags where a UI could be over Taskbar surfaces, so the color override should be disabled.
@@ -447,7 +450,7 @@
flags -> (flags & FLAG_IME_VISIBLE) == 0));
}
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
- flags -> (flags & FLAG_IME_VISIBLE) != 0,
+ flags -> (flags & FLAG_IME_ALT_BACK) != 0,
ROTATION_DRAWABLE_PERCENT, 1f, 0f));
// Translate back button to be at end/start of other buttons for keyguard (only after SUW
// since it is laid to align with SUW actions while in that state)
@@ -509,6 +512,7 @@
boolean isImeSwitcherButtonVisible =
(sysUiStateFlags & SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE) != 0;
boolean isImeVisible = (sysUiStateFlags & SYSUI_STATE_IME_VISIBLE) != 0;
+ boolean useImeAltBack = (sysUiStateFlags & SYSUI_STATE_IME_ALT_BACK) != 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;
@@ -524,6 +528,7 @@
updateStateForFlag(FLAG_IME_SWITCHER_BUTTON_VISIBLE, isImeSwitcherButtonVisible);
updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
+ updateStateForFlag(FLAG_IME_ALT_BACK, useImeAltBack);
updateStateForFlag(FLAG_A11Y_VISIBLE, a11yVisible);
updateStateForFlag(FLAG_DISABLE_HOME, isHomeDisabled);
updateStateForFlag(FLAG_DISABLE_RECENTS, isRecentsDisabled);
@@ -1228,6 +1233,7 @@
appendFlag(str, flags, FLAG_IME_SWITCHER_BUTTON_VISIBLE,
"FLAG_IME_SWITCHER_BUTTON_VISIBLE");
appendFlag(str, flags, FLAG_IME_VISIBLE, "FLAG_IME_VISIBLE");
+ appendFlag(str, flags, FLAG_IME_ALT_BACK, "FLAG_IME_ALT_BACK");
appendFlag(str, flags, FLAG_A11Y_VISIBLE, "FLAG_A11Y_VISIBLE");
appendFlag(str, flags, FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE,
"FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE");