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

Commit 41fb975b authored by William Xiao's avatar William Xiao Committed by Android (Google) Code Review
Browse files

Merge "Fix back gesture showing up on hub on lock screen" into main

parents f2e566bd 6d286382
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -347,7 +347,12 @@ public class QuickStepContract {
        }
        // Disable back gesture on the hub, but not when the shade is showing.
        if ((sysuiStateFlags & SYSUI_STATE_COMMUNAL_HUB_SHOWING) != 0) {
            return (sysuiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE) == 0;
            // Use QS expanded signal as the notification panel is always considered visible
            // expanded when on the lock screen and when opening hub over lock screen. This does
            // mean that back gesture is disabled when opening shade over hub while in portrait
            // mode, since QS is not expanded.
            // TODO(b/370108274): allow back gesture on shade over hub in portrait
            return (sysuiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) == 0;
        }
        if ((sysuiStateFlags & SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY) != 0) {
            sysuiStateFlags &= ~SYSUI_STATE_NAV_BAR_HIDDEN;
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_COMMUNAL_HUB_SHOWING
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED
import com.google.common.truth.Truth.assertThat
import kotlin.test.Test
import org.junit.runner.RunWith
@@ -41,9 +41,9 @@ class QuickStepContractTest : SysuiTestCase() {
    }

    @Test
    fun isBackGestureDisabled_hubAndShadeShowing() {
    fun isBackGestureDisabled_hubAndQSExpanded() {
        val sysuiStateFlags =
            SYSUI_STATE_COMMUNAL_HUB_SHOWING and SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE
            SYSUI_STATE_COMMUNAL_HUB_SHOWING and SYSUI_STATE_QUICK_SETTINGS_EXPANDED

        // Gestures are enabled because the shade shows over the hub.
        assertThat(