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

Commit 6d286382 authored by William Xiao's avatar William Xiao
Browse files

Fix back gesture showing up on hub on lock screen

The notification shade is always considered expanded and visible while
on the lock screen, causing the back gesture to show up on the hub.

This CL adjusts the criteria to look for quick settings being expanded,
which is always true on tablet when the shade is opened in landscape.

This does mean that back gesture will not work when opening the shade
over the hub in portrait mode, filed 370108274 to track.

Bug: 370108262
Fixed: 370108262
Test: atest QuickStepContractTest
      also manually verified on device
Flag: com.android.systemui.communal_hub
Change-Id: I5762166e51b49e8233f6e9cc7f085bdf732d1d9e
parent 15377e9b
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(