summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Xiao <wxyz@google.com> 2024-09-27 16:49:55 -0700
committer William Xiao <wxyz@google.com> 2024-09-27 16:55:19 -0700
commit6d286382444a6f84a3a88a39f710e3721157679f (patch)
tree1f79827852fa0bf91cad39aae527768589981e76
parent15377e9ba5f5c41bd959500c0e388b907be01c06 (diff)
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
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shared/system/QuickStepContractTest.kt6
2 files changed, 9 insertions, 4 deletions
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 78cd02fed9eb..ab611901328d 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
@@ -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;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shared/system/QuickStepContractTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shared/system/QuickStepContractTest.kt
index 6254fb128859..ef03fab95778 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shared/system/QuickStepContractTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shared/system/QuickStepContractTest.kt
@@ -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(