Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cf45a33 authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Propagate IME back disposition state to SystemUI" into main

parents f12aefc4 4df4934e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ 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_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_SCREEN_PINNING;
@@ -502,6 +503,7 @@ public class NavigationBarTest extends SysuiTestCase {
                BACK_DISPOSITION_DEFAULT, true /* showImeSwitcher */);
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(true));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_ALT_BACK), eq(true));
    }

    /**
@@ -516,6 +518,7 @@ public class NavigationBarTest extends SysuiTestCase {
                BACK_DISPOSITION_DEFAULT, false /* showImeSwitcher */);
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(false));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_ALT_BACK), eq(true));
    }

    /**
@@ -533,6 +536,7 @@ public class NavigationBarTest extends SysuiTestCase {
                BACK_DISPOSITION_DEFAULT, true /* showImeSwitcher */);
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(false));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(false));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_ALT_BACK), eq(false));
    }

    /**
@@ -547,6 +551,7 @@ public class NavigationBarTest extends SysuiTestCase {
                BACK_DISPOSITION_ADJUST_NOTHING, true /* showImeSwitcher */);
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_VISIBLE), eq(true));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE), eq(true));
        verify(mMockSysUiState).setFlag(eq(SYSUI_STATE_IME_ALT_BACK), eq(false));
    }

    @Test
+6 −0
Original line number Diff line number Diff line
@@ -134,6 +134,8 @@ public class QuickStepContract {
    public static final long SYSUI_STATE_DISABLE_GESTURE_PIP_ANIMATING = 1L << 34;
    // Communal hub is showing
    public static final long SYSUI_STATE_COMMUNAL_HUB_SHOWING = 1L << 35;
    // The back button is adjusted for the IME.
    public static final long SYSUI_STATE_IME_ALT_BACK = 1L << 36;

    // Mask for SystemUiStateFlags to isolate SYSUI_STATE_AWAKE and
    // SYSUI_STATE_WAKEFULNESS_TRANSITION, to match WAKEFULNESS_* constants
@@ -185,6 +187,7 @@ public class QuickStepContract {
            SYSUI_STATE_TOUCHPAD_GESTURES_DISABLED,
            SYSUI_STATE_DISABLE_GESTURE_PIP_ANIMATING,
            SYSUI_STATE_COMMUNAL_HUB_SHOWING,
            SYSUI_STATE_IME_ALT_BACK,
    })
    public @interface SystemUiStateFlags {}

@@ -295,6 +298,9 @@ public class QuickStepContract {
        if ((flags & SYSUI_STATE_COMMUNAL_HUB_SHOWING) != 0) {
            str.add("communal_hub_showing");
        }
        if ((flags & SYSUI_STATE_IME_ALT_BACK) != 0) {
            str.add("ime_alt_back");
        }

        return str.toString();
    }
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.navigationbar;

import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED;
import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT;
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;
@@ -30,6 +31,7 @@ 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_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;
@@ -366,6 +368,8 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
                        (mNavigationIconHints & NAVIGATION_HINT_IME_VISIBLE) != 0)
                .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE,
                        (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0)
                .setFlag(SYSUI_STATE_IME_ALT_BACK,
                        (mNavigationIconHints & NAVIGATION_HINT_BACK_ALT) != 0)
                .setFlag(SYSUI_STATE_OVERVIEW_DISABLED,
                        (mDisabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0)
                .setFlag(SYSUI_STATE_HOME_DISABLED,
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.navigationbar.views;

import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED;
import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT;
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;
@@ -43,6 +44,7 @@ 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_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;
@@ -1688,6 +1690,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
                        (mNavigationIconHints & NAVIGATION_HINT_IME_VISIBLE) != 0)
                .setFlag(SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE,
                        (mNavigationIconHints & NAVIGATION_HINT_IME_SWITCHER_BUTTON_VISIBLE) != 0)
                .setFlag(SYSUI_STATE_IME_ALT_BACK,
                        (mNavigationIconHints & NAVIGATION_HINT_BACK_ALT) != 0)
                .setFlag(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY,
                        allowSystemGestureIgnoringBarVisibility())
                .commitUpdate(mDisplayId);