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

Commit e6d78d48 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Only call onFingerUp if finger was down

This avoids no-op calls to onPointerUp which may delay future calls
to the Fingerprint/FaceManager (saves 20ms delay on FaceAuth start).

Test: manual
Fixes: 186050490
Change-Id: I791a323d8f67426dda5ecb965d4227dd7841b25a
parent 2b142939
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();
        }