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

Commit 97834b3c authored by Beverly's avatar Beverly
Browse files

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
parent b78bf4e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+4 −1
Original line number Diff line number Diff line
@@ -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
        }