diff options
| author | 2023-12-19 15:04:27 -0800 | |
|---|---|---|
| committer | 2023-12-21 10:33:40 -0800 | |
| commit | 2169737d2f4e464e01cfc0858d09c4c5d5076b67 (patch) | |
| tree | 6f4cdc98612f42f096b5a101b0fe446db0ae13c1 | |
| parent | c5a688f0a7498ec7e23a21777cccaa0e4c7ddf4e (diff) | |
Fix issues when opening glanceable hub slowly
When opening the glanceable hub with a slow drag, it seems that
SceneContainerLayout may not consume all touches. Instead of returning
the result of dispatchTouchEvent, we just return true from our touch
handling logic as the touch should not be seen by anyone else.
Bug: 315207481
Test: atest NotificationShadeWindowViewControllerTest GlanceableHubContainerControllerTest
Flag: ACONFIG com.android.systemui.communal_hub DEVELOPMENT
Change-Id: I7d5964e0ed7d62c9ff71d9bdf51452080cc81ced
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt index ab69acbc6e9d..3be60b74af21 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt @@ -157,7 +157,10 @@ constructor( // If the hub is fully visible, send all touch events to it. val communalVisible = hubShowing && !hubOccluded if (communalVisible) { - return communalContainerView.dispatchTouchEvent(ev) + communalContainerView.dispatchTouchEvent(ev) + // Return true regardless of dispatch result as some touches at the start of a gesture + // may return false from dispatchTouchEvent. + return true } if (edgeSwipeRegionWidth == 0) { @@ -172,13 +175,19 @@ constructor( x >= communalContainerView.width - edgeSwipeRegionWidth if (inOpeningSwipeRegion && !hubOccluded) { isTrackingOpenGesture = true - return communalContainerView.dispatchTouchEvent(ev) + communalContainerView.dispatchTouchEvent(ev) + // Return true regardless of dispatch result as some touches at the start of a + // gesture may return false from dispatchTouchEvent. + return true } } else if (isTrackingOpenGesture) { if (isUp || isCancel) { isTrackingOpenGesture = false } - return communalContainerView.dispatchTouchEvent(ev) + communalContainerView.dispatchTouchEvent(ev) + // Return true regardless of dispatch result as some touches at the start of a gesture + // may return false from dispatchTouchEvent. + return true } return false |