From 97834b3c303f31ed5abb5f89566e50e8911a467f Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 15 Mar 2022 20:17:53 +0000 Subject: [PATCH] Don't expand shade when pulsing w/o tracking notif When pulsing, we only allow dragging down anywhere to expand the shade when the keyguard can be bypassed. Else, the user needs to drag the notification itself to expansion. Why? Devices with UDFPS can wakeup the display to the pulsing state without notifications. In this state, users shouldn't be able to swipe to expand the notification shade while pulsing. Test: atest SystemUITests Fixes: 217247200 Change-Id: Ieb6bf058bac95a4e7259703d1e87e99f910b40c8 --- .../statusbar/LockscreenShadeTransitionController.kt | 2 +- .../com/android/systemui/statusbar/PulseExpansionHandler.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt index ab4d0dd355f34..730b8f203132a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt @@ -34,11 +34,11 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.notification.stack.AmbientState import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.LSShadeTransitionLogger import com.android.systemui.statusbar.phone.NotificationPanelViewController import com.android.systemui.statusbar.phone.ScrimController -import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.util.Utils import java.io.FileDescriptor diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt index 3fe108f2c9511..f0e01a33fc997 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt @@ -192,7 +192,10 @@ constructor( override fun onTouchEvent(event: MotionEvent): Boolean { val finishExpanding = (event.action == MotionEvent.ACTION_CANCEL || event.action == MotionEvent.ACTION_UP) && isExpanding - if (!canHandleMotionEvent() && !finishExpanding) { + + val isDraggingNotificationOrCanBypass = mStartingChild?.showingPulsing() == true || + bypassController.canBypass() + if ((!canHandleMotionEvent() || !isDraggingNotificationOrCanBypass) && !finishExpanding) { // We allow cancellations/finishing to still go through here to clean up the state return false }