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

Commit e035b3c9 authored by Android Build Prod User's avatar Android Build Prod User Committed by Automerger Merge Worker
Browse files

Merge "Remove ZigZagClassifer from lock-icon longpress falsing algo" into...

Merge "Remove ZigZagClassifer from lock-icon longpress falsing algo" into sc-qpr1-dev am: 1751bd89

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15685188

Change-Id: I7caa332dfe3ac47e23a4fb93a1f945df85a79c2f
parents 513e53d8 1751bd89
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -501,8 +501,10 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                    if (!wasClickableOnDownEvent()) {
                        return;
                    }
                    mDetectedLongPress = true;

                    if (mVibrator != null) {
                    if (onAffordanceClick() && mVibrator != null) {
                        // only vibrate if the click went through and wasn't intercepted by falsing
                        mVibrator.vibrate(
                                Process.myUid(),
                                getContext().getOpPackageName(),
@@ -510,8 +512,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                                "lockIcon-onLongPress",
                                VIBRATION_SONIFICATION_ATTRIBUTES);
                    }
                    mDetectedLongPress = true;
                    onAffordanceClick();
                }

                public boolean onSingleTapUp(MotionEvent e) {
@@ -535,9 +535,14 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                    return mDownDetected;
                }

                private void onAffordanceClick() {
                /**
                 * Whether we tried to launch the affordance.
                 *
                 * If falsing intercepts the click, returns false.
                 */
                private boolean onAffordanceClick() {
                    if (mFalsingManager.isFalseTouch(LOCK_ICON)) {
                        return;
                        return false;
                    }

                    // pre-emptively set to true to hide view
@@ -547,6 +552,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                    }
                    updateVisibility();
                    mKeyguardViewController.showBouncer(/* scrim */ true);
                    return true;
                }
            });

+4 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHT
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_ZIGZAG_Y_PRIMARY_DEVIANCE;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_ZIGZAG_Y_SECONDARY_DEVIANCE;
import static com.android.systemui.classifier.Classifier.BRIGHTNESS_SLIDER;
import static com.android.systemui.classifier.Classifier.LOCK_ICON;
import static com.android.systemui.classifier.Classifier.SHADE_DRAG;

import android.graphics.Point;
@@ -89,7 +90,9 @@ class ZigZagClassifier extends FalsingClassifier {
    Result calculateFalsingResult(
            @Classifier.InteractionType int interactionType,
            double historyBelief, double historyConfidence) {
        if (interactionType == BRIGHTNESS_SLIDER || interactionType == SHADE_DRAG) {
        if (interactionType == BRIGHTNESS_SLIDER
                || interactionType == SHADE_DRAG
                || interactionType == LOCK_ICON) {
            return Result.passed(0);
        }