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

Commit 9b8e3876 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Only call onFingerUp if finger was down" into sc-dev am: d35f3f20

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

Change-Id: I9acdafcc742fb0a5573ada5d1588765ae88ed9b7
parents 3c35f44a d35f3f20
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ public class UdfpsController implements DozeReceiver {
    @Nullable private Runnable mCancelAodTimeoutAction;
    private boolean mScreenOn;
    private Runnable mAodInterruptRunnable;
    private boolean mOnFingerDown;

    @VisibleForTesting
    public static final AudioAttributes VIBRATION_SONIFICATION_ATTRIBUTES =
@@ -662,12 +663,12 @@ public class UdfpsController implements DozeReceiver {

    private void showUdfpsOverlay(@NonNull ServerRequest request) {
        mExecution.assertIsMainThread();

        final int reason = request.mRequestReason;
        if (mView == null) {
            try {
                Log.v(TAG, "showUdfpsOverlay | adding window reason=" + reason);
                mView = (UdfpsView) mInflater.inflate(R.layout.udfps_view, null, false);
                mOnFingerDown = false;
                mView.setSensorProperties(mSensorProps);
                mView.setHbmProvider(mHbmProvider);
                UdfpsAnimationViewController animation = inflateUdfpsAnimation(reason);
@@ -826,6 +827,7 @@ public class UdfpsController implements DozeReceiver {
            Log.w(TAG, "Null view in onFingerDown");
            return;
        }
        mOnFingerDown = true;
        mFingerprintManager.onPointerDown(mSensorProps.sensorId, x, y, minor, major);
        Trace.endAsyncSection("UdfpsController.e2e.onPointerDown", 0);
        Trace.beginAsyncSection("UdfpsController.e2e.startIllumination", 0);
@@ -843,7 +845,10 @@ public class UdfpsController implements DozeReceiver {
            Log.w(TAG, "Null view in onFingerUp");
            return;
        }
        if (mOnFingerDown) {
            mFingerprintManager.onPointerUp(mSensorProps.sensorId);
        }
        mOnFingerDown = false;
        if (mView.isIlluminationRequested()) {
            mView.stopIllumination();
        }