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

Commit d33284a2 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Analyze vertical swipes on QS's Scroll View.

When media controls are shown, the full qs+media controls often takes
up more than one full screen. Swiping up on this causes the qs to
vertically scroll instead of collapse.

Prior to this cl, we weren't analyzing such swipes in the
FalsingManager. Now we do.

No explicit action is taken in the event of a false swipe. It simply
gives us more signal. Enough bad swipes may implicitly cause the
lock screen to reset itself.

Fixes: 241708312
Test: manual
Change-Id: I5adfb3a22b2f0f51efb87d56a6cfc5459cd67006
parent a33f6c1c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ public class BrightLineFalsingManager implements FalsingManager {
            return r;
        }).collect(Collectors.toList());

        logDebug("False Gesture: " + localResult[0]);
        logDebug("False Gesture (type: " + interactionType + "): " + localResult[0]);

        return localResult[0];
    }
@@ -454,6 +454,12 @@ public class BrightLineFalsingManager implements FalsingManager {
        }
    }

    static void logVerbose(String msg) {
        if (DEBUG) {
            Log.v(TAG, msg);
        }
    }

    static void logInfo(String msg) {
        Log.i(TAG, msg);
        RECENT_INFO_LOG.add(msg);
+4 −2
Original line number Diff line number Diff line
@@ -42,8 +42,9 @@ public abstract class Classifier {
    public static final int QS_COLLAPSE = 12;
    public static final int UDFPS_AUTHENTICATION = 13;
    public static final int LOCK_ICON = 14;
    public static final int QS_SWIPE = 15;
    public static final int QS_SWIPE_SIDE = 15;
    public static final int BACK_GESTURE = 16;
    public static final int QS_SWIPE_NESTED = 17;

    @IntDef({
            QUICK_SETTINGS,
@@ -62,7 +63,8 @@ public abstract class Classifier {
            BRIGHTNESS_SLIDER,
            UDFPS_AUTHENTICATION,
            LOCK_ICON,
            QS_SWIPE,
            QS_SWIPE_SIDE,
            QS_SWIPE_NESTED,
            BACK_GESTURE
    })
    @Retention(RetentionPolicy.SOURCE)
+3 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHT
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_DISTANCE_VERTICAL_SWIPE_THRESHOLD_IN;
import static com.android.systemui.classifier.Classifier.BRIGHTNESS_SLIDER;
import static com.android.systemui.classifier.Classifier.QS_COLLAPSE;
import static com.android.systemui.classifier.Classifier.QS_SWIPE_NESTED;
import static com.android.systemui.classifier.Classifier.SHADE_DRAG;

import android.provider.DeviceConfig;
@@ -156,7 +157,8 @@ class DistanceClassifier extends FalsingClassifier {
                || interactionType == QS_COLLAPSE
                || interactionType == Classifier.UDFPS_AUTHENTICATION
                || interactionType == Classifier.LOCK_ICON
                || interactionType == Classifier.QS_SWIPE) {
                || interactionType == Classifier.QS_SWIPE_SIDE
                || interactionType == QS_SWIPE_NESTED) {
            return Result.passed(0);
        }

+5 −0
Original line number Diff line number Diff line
@@ -147,6 +147,11 @@ public abstract class FalsingClassifier {
        BrightLineFalsingManager.logDebug(msg);
    }

    /** */
    public static void logVerbose(String msg) {
        BrightLineFalsingManager.logVerbose(msg);
    }

    /** */
    public static void logInfo(String msg) {
        BrightLineFalsingManager.logInfo(msg);
+3 −3
Original line number Diff line number Diff line
@@ -78,10 +78,10 @@ public class FalsingDataProvider {

    void onMotionEvent(MotionEvent motionEvent) {
        List<MotionEvent> motionEvents = unpackMotionEvent(motionEvent);
        FalsingClassifier.logDebug("Unpacked into: " + motionEvents.size());
        FalsingClassifier.logVerbose("Unpacked into: " + motionEvents.size());
        if (BrightLineFalsingManager.DEBUG) {
            for (MotionEvent m : motionEvents) {
                FalsingClassifier.logDebug(
                FalsingClassifier.logVerbose(
                        "x,y,t: " + m.getX() + "," + m.getY() + "," + m.getEventTime());
            }
        }
@@ -92,7 +92,7 @@ public class FalsingDataProvider {
        }
        mRecentMotionEvents.addAll(motionEvents);

        FalsingClassifier.logDebug("Size: " + mRecentMotionEvents.size());
        FalsingClassifier.logVerbose("Size: " + mRecentMotionEvents.size());

        mMotionEventListeners.forEach(listener -> listener.onMotionEvent(motionEvent));

Loading