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

Commit 0d2313c2 authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Android (Google) Code Review
Browse files

Merge "Allow any non-touchscreen device click to bypass long-press need for shortcuts" into main

parents e3323b7d 61564444
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -18,13 +18,12 @@ package com.android.systemui.keyguard.ui.binder

import android.annotation.SuppressLint
import android.graphics.PointF
import android.view.InputDevice
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import android.view.ViewPropertyAnimator
import androidx.core.animation.CycleInterpolator
import androidx.core.animation.ObjectAnimator
import com.android.systemui.res.R
import com.android.systemui.Flags
import com.android.systemui.animation.Expandable
import com.android.systemui.common.ui.view.rawDistanceFrom
import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordanceViewModel
@@ -71,8 +70,7 @@ class KeyguardQuickAffordanceOnTouchListener(
                    // Moving too far while performing a long-press gesture cancels that
                    // gesture.
                    if (
                        event
                            .rawDistanceFrom(
                        event.rawDistanceFrom(
                            downDisplayCoords.x,
                            downDisplayCoords.y,
                        ) > ViewConfiguration.getTouchSlop()
@@ -151,7 +149,10 @@ class KeyguardQuickAffordanceOnTouchListener(
            event: MotionEvent,
            pointerIndex: Int = 0,
        ): Boolean {
            return when (event.getToolType(pointerIndex)) {
            return if (Flags.nonTouchscreenDevicesBypassFalsing()) {
                event.device?.supportsSource(InputDevice.SOURCE_TOUCHSCREEN) == false
            } else {
                when (event.getToolType(pointerIndex)) {
                    MotionEvent.TOOL_TYPE_STYLUS -> true
                    MotionEvent.TOOL_TYPE_MOUSE -> true
                    else -> false
@@ -159,3 +160,4 @@ class KeyguardQuickAffordanceOnTouchListener(
            }
        }
    }
}