diff options
| author | 2025-01-26 14:37:02 -0800 | |
|---|---|---|
| committer | 2025-01-26 14:37:02 -0800 | |
| commit | f12aefc4499e78af94b277f3074b085b1857ef6c (patch) | |
| tree | 75f399ddeef59e8582c9c6ca248ef82721864eaf | |
| parent | ee6220900cec3d6de6f171f0ef39fe3a7278d344 (diff) | |
| parent | 30f5e0c7a7d6610853d0cc960465f2087a0ceb3e (diff) | |
Merge "Rename IME_SHOWN states to IME_VISIBLE" into main
10 files changed, 102 insertions, 102 deletions
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index 7454c44997d6..039f7b6a86ba 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -211,13 +211,13 @@ public class StatusBarManager { * * @hide */ - public static final int NAVIGATION_HINT_IME_SHOWN = 1 << 1; + public static final int NAVIGATION_HINT_IME_VISIBLE = 1 << 1; /** * The IME Switcher button is visible. This only takes effect while the IME is visible. * * @hide */ - public static final int NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN = 1 << 2; + public static final int NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE = 1 << 2; /** * Navigation bar flags related to the IME state. * @@ -225,8 +225,8 @@ public class StatusBarManager { */ @IntDef(flag = true, prefix = { "NAVIGATION_HINT_" }, value = { NAVIGATION_HINT_BACK_ALT, - NAVIGATION_HINT_IME_SHOWN, - NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN, + NAVIGATION_HINT_IME_VISIBLE, + NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE, }) @Retention(RetentionPolicy.SOURCE) public @interface NavigationHint {} @@ -1360,11 +1360,11 @@ public class StatusBarManager { if ((hints & NAVIGATION_HINT_BACK_ALT) != 0) { hintStrings.add("NAVIGATION_HINT_BACK_ALT"); } - if ((hints & NAVIGATION_HINT_IME_SHOWN) != 0) { - hintStrings.add("NAVIGATION_HINT_IME_SHOWN"); + if ((hints & NAVIGATION_HINT_IME_VISIBLE) != 0) { + hintStrings.add("NAVIGATION_HINT_IME_VISIBLE"); } - if ((hints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0) { - hintStrings.add("NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN"); + if ((hints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0) { + hintStrings.add("NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE"); } return String.join(" | ", hintStrings); } diff --git a/core/java/android/inputmethodservice/NavigationBarController.java b/core/java/android/inputmethodservice/NavigationBarController.java index edc5cb7cdf6a..8ca139fdf9b9 100644 --- a/core/java/android/inputmethodservice/NavigationBarController.java +++ b/core/java/android/inputmethodservice/NavigationBarController.java @@ -17,8 +17,8 @@ package android.inputmethodservice; import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.view.WindowInsets.Type.captionBar; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; @@ -242,10 +242,10 @@ final class NavigationBarController { NavigationBarView.class::isInstance); if (navigationBarView != null) { // TODO(b/213337792): Support InputMethodService#setBackDisposition(). - // TODO(b/213337792): Set NAVIGATION_HINT_IME_SHOWN only when necessary. - final int hints = NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_SHOWN + // TODO(b/213337792): Set NAVIGATION_HINT_IME_VISIBLE only when necessary. + final int hints = NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_VISIBLE | (mShouldShowImeSwitcherWhenImeIsShown - ? NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN : 0); + ? NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE : 0); navigationBarView.setNavigationIconHints(hints); navigationBarView.prepareNavButtons(this); } @@ -515,10 +515,10 @@ final class NavigationBarController { NavigationBarView.class::isInstance); if (navigationBarView != null) { // TODO(b/213337792): Support InputMethodService#setBackDisposition(). - // TODO(b/213337792): Set NAVIGATION_HINT_IME_SHOWN only when necessary. - final int hints = NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_SHOWN + // TODO(b/213337792): Set NAVIGATION_HINT_IME_VISIBLE only when necessary. + final int hints = NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_VISIBLE | (mShouldShowImeSwitcherWhenImeIsShown - ? NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN : 0); + ? NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE : 0); navigationBarView.setNavigationIconHints(hints); } } else { diff --git a/core/java/android/inputmethodservice/navigationbar/NavigationBarView.java b/core/java/android/inputmethodservice/navigationbar/NavigationBarView.java index 622d5d1b1c5a..5c0977115e36 100644 --- a/core/java/android/inputmethodservice/navigationbar/NavigationBarView.java +++ b/core/java/android/inputmethodservice/navigationbar/NavigationBarView.java @@ -17,7 +17,7 @@ package android.inputmethodservice.navigationbar; import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.inputmethodservice.navigationbar.NavigationBarConstants.DARK_MODE_ICON_COLOR_SINGLE_TONE; import static android.inputmethodservice.navigationbar.NavigationBarConstants.LIGHT_MODE_ICON_COLOR_SINGLE_TONE; import static android.inputmethodservice.navigationbar.NavigationBarConstants.NAVBAR_BACK_BUTTON_IME_OFFSET; @@ -316,9 +316,10 @@ public final class NavigationBarView extends FrameLayout { getImeSwitchButton().setImageDrawable(mImeSwitcherIcon); - // Update IME button visibility, a11y and rotate button always overrides the appearance + // Update IME switcher button visibility, a11y and rotate button always overrides + // the appearance. final boolean isImeSwitcherButtonVisible = - (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0; + (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0; getImeSwitchButton() .setVisibility(isImeSwitcherButtonVisible ? View.VISIBLE : View.INVISIBLE); diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/navigationbar/views/NavigationBarTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/navigationbar/views/NavigationBarTest.java index 83b68fed768e..203457b442c7 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/navigationbar/views/NavigationBarTest.java +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/navigationbar/views/NavigationBarTest.java @@ -17,8 +17,8 @@ package com.android.systemui.navigationbar.views; import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.inputmethodservice.InputMethodService.BACK_DISPOSITION_ADJUST_NOTHING; import static android.inputmethodservice.InputMethodService.BACK_DISPOSITION_DEFAULT; import static android.inputmethodservice.InputMethodService.IME_VISIBLE; @@ -31,8 +31,8 @@ import static com.android.systemui.assist.AssistManager.INVOCATION_TYPE_HOME_BUT import static com.android.systemui.navigationbar.views.NavigationBar.NavBarActionEvent.NAVBAR_ASSIST_LONGPRESS; import static com.android.systemui.navigationbar.views.buttons.KeyButtonView.NavBarButtonEvent.NAVBAR_IME_SWITCHER_BUTTON_LONGPRESS; import static com.android.systemui.navigationbar.views.buttons.KeyButtonView.NavBarButtonEvent.NAVBAR_IME_SWITCHER_BUTTON_TAP; -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_SCREEN_PINNING; import static com.google.common.truth.Truth.assertThat; @@ -500,8 +500,8 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true /* showImeSwitcher */); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SHOWING), eq(true)); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING), eq(true)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(true)); } /** @@ -514,8 +514,8 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, false /* showImeSwitcher */); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SHOWING), eq(true)); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING), eq(false)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(false)); } /** @@ -531,8 +531,8 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, 0 /* vis */, BACK_DISPOSITION_DEFAULT, true /* showImeSwitcher */); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SHOWING), eq(false)); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING), eq(false)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(false)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(false)); } /** @@ -545,8 +545,8 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_ADJUST_NOTHING, true /* showImeSwitcher */); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SHOWING), eq(true)); - verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING), eq(true)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true)); + verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(true)); } @Test @@ -567,26 +567,26 @@ public class NavigationBarTest extends SysuiTestCase { BACK_DISPOSITION_DEFAULT, true); // Verify IME window state will be updated in default NavBar & external NavBar state reset. - assertEquals(NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_SHOWN - | NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN, + assertEquals(NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_VISIBLE + | NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE, defaultNavBar.getNavigationIconHints()); assertFalse((externalNavBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); - assertFalse((externalNavBar.getNavigationIconHints() & NAVIGATION_HINT_IME_SHOWN) != 0); + assertFalse((externalNavBar.getNavigationIconHints() & NAVIGATION_HINT_IME_VISIBLE) != 0); assertFalse((externalNavBar.getNavigationIconHints() - & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0); + & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0); externalNavBar.setImeWindowStatus(EXTERNAL_DISPLAY_ID, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true); defaultNavBar.setImeWindowStatus(DEFAULT_DISPLAY, 0 /* vis */, BACK_DISPOSITION_DEFAULT, false); // Verify IME window state will be updated in external NavBar & default NavBar state reset. - assertEquals(NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_SHOWN - | NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN, + assertEquals(NAVIGATION_HINT_BACK_ALT | NAVIGATION_HINT_IME_VISIBLE + | NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE, externalNavBar.getNavigationIconHints()); assertFalse((defaultNavBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); - assertFalse((defaultNavBar.getNavigationIconHints() & NAVIGATION_HINT_IME_SHOWN) != 0); + assertFalse((defaultNavBar.getNavigationIconHints() & NAVIGATION_HINT_IME_VISIBLE) != 0); assertFalse((defaultNavBar.getNavigationIconHints() - & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0); + & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0); } @Test @@ -603,9 +603,9 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true); assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); - assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_SHOWN) != 0); + assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_VISIBLE) != 0); assertTrue((mNavigationBar.getNavigationIconHints() - & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0); + & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0); // Verify navbar didn't alter and showing back icon when the keyguard is showing without // requesting IME insets visible. @@ -613,9 +613,9 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true); assertFalse((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); - assertFalse((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_SHOWN) != 0); + assertFalse((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_VISIBLE) != 0); assertFalse((mNavigationBar.getNavigationIconHints() - & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0); + & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0); // Verify navbar altered and showing back icon when the keyguard is showing and // requesting IME insets visible. @@ -624,9 +624,9 @@ public class NavigationBarTest extends SysuiTestCase { mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true); assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); - assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_SHOWN) != 0); + assertTrue((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_IME_VISIBLE) != 0); assertTrue((mNavigationBar.getNavigationIconHints() - & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0); + & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0); } @Test diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java index aee90802437b..32a76fb8439a 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java @@ -17,8 +17,8 @@ package com.android.systemui.shared.recents.utilities; import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import android.annotation.TargetApi; import android.app.StatusBarManager.NavigationHint; @@ -108,20 +108,21 @@ public class Utilities { * * @param oldHints current navigation icon hints. * @param backDisposition the IME back disposition mode. Only takes effect if - * {@code imeShown} is {@code true}. - * @param imeShown whether the IME is currently visible. + * {@code isImeVisible} is {@code true}. + * @param isImeVisible whether the IME is currently visible. * @param showImeSwitcher whether the IME Switcher button should be shown. Only takes effect if - * {@code imeShown} is {@code true}. + * {@code isImeVisible} is {@code true}. */ @NavigationHint public static int calculateNavigationIconHints(@NavigationHint int oldHints, - @BackDispositionMode int backDisposition, boolean imeShown, boolean showImeSwitcher) { + @BackDispositionMode int backDisposition, boolean isImeVisible, + boolean showImeSwitcher) { int hints = oldHints; switch (backDisposition) { case InputMethodService.BACK_DISPOSITION_DEFAULT: case InputMethodService.BACK_DISPOSITION_WILL_NOT_DISMISS: case InputMethodService.BACK_DISPOSITION_WILL_DISMISS: - if (imeShown) { + if (isImeVisible) { hints |= NAVIGATION_HINT_BACK_ALT; } else { hints &= ~NAVIGATION_HINT_BACK_ALT; @@ -131,15 +132,15 @@ public class Utilities { hints &= ~NAVIGATION_HINT_BACK_ALT; break; } - if (imeShown) { - hints |= NAVIGATION_HINT_IME_SHOWN; + if (isImeVisible) { + hints |= NAVIGATION_HINT_IME_VISIBLE; } else { - hints &= ~NAVIGATION_HINT_IME_SHOWN; + hints &= ~NAVIGATION_HINT_IME_VISIBLE; } - if (showImeSwitcher && imeShown) { - hints |= NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; + if (showImeSwitcher && isImeVisible) { + hints |= NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; } else { - hints &= ~NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; + hints &= ~NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; } return hints; diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java index f87d9b05d795..656ae100e20e 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -99,11 +99,11 @@ public class QuickStepContract { // Allow system gesture no matter the system bar(s) is visible or not public static final long SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY = 1L << 17; // The IME is visible. - public static final long SYSUI_STATE_IME_SHOWING = 1L << 18; + public static final long SYSUI_STATE_IME_VISIBLE = 1L << 18; // The window magnification is overlapped with system gesture insets at the bottom. public static final long SYSUI_STATE_MAGNIFICATION_OVERLAP = 1L << 19; // The IME Switcher button is visible. - public static final long SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING = 1L << 20; + public static final long SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE = 1L << 20; // Device dozing/AOD state public static final long SYSUI_STATE_DEVICE_DOZING = 1L << 21; // The home feature is disabled (either by SUW/SysUI/device policy) @@ -168,9 +168,9 @@ public class QuickStepContract { SYSUI_STATE_DIALOG_SHOWING, SYSUI_STATE_ONE_HANDED_ACTIVE, SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY, - SYSUI_STATE_IME_SHOWING, + SYSUI_STATE_IME_VISIBLE, SYSUI_STATE_MAGNIFICATION_OVERLAP, - SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING, + SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE, SYSUI_STATE_DEVICE_DOZING, SYSUI_STATE_BACK_DISABLED, SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED, @@ -244,13 +244,13 @@ public class QuickStepContract { if ((flags & SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY) != 0) { str.add("allow_gesture"); } - if ((flags & SYSUI_STATE_IME_SHOWING) != 0) { + if ((flags & SYSUI_STATE_IME_VISIBLE) != 0) { str.add("ime_visible"); } if ((flags & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0) { str.add("magnification_overlap"); } - if ((flags & SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING) != 0) { + if ((flags & SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE) != 0) { str.add("ime_switcher_button_visible"); } if ((flags & SYSUI_STATE_DEVICE_DOZING) != 0) { diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java index 40197b2daf49..0de8c40bddaa 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java @@ -536,12 +536,12 @@ public final class NavBarHelper implements } /** - * Checks whether the IME is shown on top of the screen, based on the given IME window + * Checks whether the IME is visible on top of the screen, based on the given IME window * visibility flags, and the current keyguard state. * * @param vis the IME window visibility. */ - public boolean isImeShown(@ImeWindowVisibility int vis) { + public boolean isImeVisible(@ImeWindowVisibility int vis) { View shadeWindowView = mNotificationShadeWindowController.getWindowRootView(); boolean isKeyguardShowing = mKeyguardStateController.isShowing(); boolean imeVisibleOnShade = shadeWindowView != null && shadeWindowView.isAttachedToWindow() diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java index 8f97cb70d08b..f6cc589a22ae 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java @@ -17,8 +17,8 @@ package com.android.systemui.navigationbar; import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; @@ -30,8 +30,8 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY; 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_OVERVIEW_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; @@ -362,10 +362,10 @@ public class TaskbarDelegate implements CommandQueue.Callbacks, mSysUiState.setFlag(SYSUI_STATE_A11Y_BUTTON_CLICKABLE, clickable) .setFlag(SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE, longClickable) - .setFlag(SYSUI_STATE_IME_SHOWING, - (mNavigationIconHints & NAVIGATION_HINT_IME_SHOWN) != 0) - .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING, - (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0) + .setFlag(SYSUI_STATE_IME_VISIBLE, + (mNavigationIconHints & NAVIGATION_HINT_IME_VISIBLE) != 0) + .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE, + (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0) .setFlag(SYSUI_STATE_OVERVIEW_DISABLED, (mDisabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0) .setFlag(SYSUI_STATE_HOME_DISABLED, @@ -485,13 +485,11 @@ public class TaskbarDelegate implements CommandQueue.Callbacks, @Override public void setImeWindowStatus(int displayId, @ImeWindowVisibility int vis, @BackDispositionMode int backDisposition, boolean showImeSwitcher) { - boolean imeShown = mNavBarHelper.isImeShown(vis); - if (!imeShown) { - // Count imperceptible changes as visible so we transition taskbar out quickly. - imeShown = (vis & InputMethodService.IME_VISIBLE_IMPERCEPTIBLE) != 0; - } - int hints = Utilities.calculateNavigationIconHints(mNavigationIconHints, backDisposition, - imeShown, showImeSwitcher); + // Count imperceptible changes as visible so we transition taskbar out quickly. + final boolean isImeVisible = mNavBarHelper.isImeVisible(vis) + || (vis & InputMethodService.IME_VISIBLE_IMPERCEPTIBLE) != 0; + final int hints = Utilities.calculateNavigationIconHints(mNavigationIconHints, + backDisposition, isImeVisible, showImeSwitcher); if (hints == mNavigationIconHints) { return; } diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java index 7b9afa43475f..0ac3c619c381 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java @@ -17,8 +17,8 @@ package com.android.systemui.navigationbar.views; import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN; import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.app.StatusBarManager.WindowType; @@ -43,8 +43,8 @@ import static com.android.systemui.shared.statusbar.phone.BarTransitions.Transit import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY; -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_SCREEN_PINNING; import static com.android.systemui.shared.system.QuickStepContract.isGesturalMode; @@ -652,18 +652,18 @@ public class NavigationBar extends ViewController<NavigationBarView> implements if (!mEdgeBackGestureHandler.isHandlingGestures()) { // We're in 2/3 button mode OR back button force-shown in SUW if (!mImeVisible) { - // IME not showing, take all touches + // IME is not visible, take all touches info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_FRAME); return; } if (!mView.isImeRenderingNavButtons()) { - // IME showing but not drawing any buttons, take all touches + // IME is visible but not drawing any buttons, take all touches info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_FRAME); return; } } - // When in gestural and the IME is showing, don't use the nearest region since it will + // When in gestural and the IME is visible, don't use the nearest region since it will // take gesture space away from the IME info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION); info.touchableRegion.set( @@ -1138,9 +1138,9 @@ public class NavigationBar extends ViewController<NavigationBarView> implements if (displayId != mDisplayId) { return; } - boolean imeShown = mNavBarHelper.isImeShown(vis); - int hints = Utilities.calculateNavigationIconHints(mNavigationIconHints, backDisposition, - imeShown, showImeSwitcher); + final boolean isImeVisible = mNavBarHelper.isImeVisible(vis); + final int hints = Utilities.calculateNavigationIconHints(mNavigationIconHints, + backDisposition, isImeVisible, showImeSwitcher); if (hints == mNavigationIconHints) { return; } @@ -1684,10 +1684,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implements mSysUiFlagsContainer.setFlag(SYSUI_STATE_A11Y_BUTTON_CLICKABLE, clickable) .setFlag(SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE, longClickable) .setFlag(SYSUI_STATE_NAV_BAR_HIDDEN, !isNavBarWindowVisible()) - .setFlag(SYSUI_STATE_IME_SHOWING, - (mNavigationIconHints & NAVIGATION_HINT_IME_SHOWN) != 0) - .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_SHOWING, - (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0) + .setFlag(SYSUI_STATE_IME_VISIBLE, + (mNavigationIconHints & NAVIGATION_HINT_IME_VISIBLE) != 0) + .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE, + (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0) .setFlag(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY, allowSystemGestureIgnoringBarVisibility()) .commitUpdate(mDisplayId); @@ -1952,7 +1952,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements if (newBackAlt != oldBackAlt) { mView.onBackAltChanged(newBackAlt); } - mImeVisible = (hints & NAVIGATION_HINT_IME_SHOWN) != 0; + mImeVisible = (hints & NAVIGATION_HINT_IME_VISIBLE) != 0; mView.setNavigationIconHints(hints); } diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarView.java index ed8e538cc895..de61d404b1e8 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarView.java @@ -17,8 +17,8 @@ package com.android.systemui.navigationbar.views; import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN; -import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_VISIBLE; +import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE; import static android.inputmethodservice.InputMethodService.canImeRenderGesturalNavButtons; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; @@ -612,9 +612,9 @@ public class NavigationBarView extends FrameLayout { updateRecentsIcon(); // Update IME switcher button visibility, a11y and rotate button always overrides - // the appearance - boolean isImeSwitcherButtonVisible = - (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_SHOWN) != 0 + // the appearance. + final boolean isImeSwitcherButtonVisible = + (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0 && !isImeRenderingNavButtons(); mContextualButtonGroup.setButtonVisibility(R.id.ime_switcher, isImeSwitcherButtonVisible); @@ -670,7 +670,7 @@ public class NavigationBarView extends FrameLayout { boolean isImeRenderingNavButtons() { return mImeDrawsImeNavBar && mImeCanRenderGesturalNavButtons - && (mNavigationIconHints & NAVIGATION_HINT_IME_SHOWN) != 0; + && (mNavigationIconHints & NAVIGATION_HINT_IME_VISIBLE) != 0; } @VisibleForTesting |