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

Commit 368f1c05 authored by Hao Dong's avatar Hao Dong Committed by Android (Google) Code Review
Browse files

Merge "Fix UI bugs for udfps enroll in settings."

parents 77153538 3c41539e
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -470,6 +470,16 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
         * @param isAcquiredGood whether the fingerprint image was good.
         */
        public void onAcquired(boolean isAcquiredGood){ }

        /**
         * Called when a pointer down event has occurred.
         */
        public void onPointerDown(int sensorId){ }

        /**
         * Called when a pointer up event has occurred.
         */
        public void onPointerUp(int sensorId){ }
    }

    /**
@@ -1398,7 +1408,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        if (mAuthenticationCallback != null) {
            mAuthenticationCallback.onAuthenticationAcquired(acquireInfo);
        }
        if (mEnrollmentCallback != null) {
        if (mEnrollmentCallback != null && acquireInfo != FINGERPRINT_ACQUIRED_START) {
            mEnrollmentCallback.onAcquired(acquireInfo == FINGERPRINT_ACQUIRED_GOOD);
        }
        final String msg = getAcquiredString(mContext, acquireInfo, vendorCode);
@@ -1454,18 +1464,25 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
    private void sendUdfpsPointerDown(int sensorId) {
        if (mAuthenticationCallback == null) {
            Slog.e(TAG, "sendUdfpsPointerDown, callback null");
            return;
        }
        } else {
            mAuthenticationCallback.onUdfpsPointerDown(sensorId);
        }

        if (mEnrollmentCallback != null) {
            mEnrollmentCallback.onPointerDown(sensorId);
        }
    }

    private void sendUdfpsPointerUp(int sensorId) {
        if (mAuthenticationCallback == null) {
            Slog.e(TAG, "sendUdfpsPointerUp, callback null");
            return;
        }
        } else {
            mAuthenticationCallback.onUdfpsPointerUp(sensorId);
        }
        if (mEnrollmentCallback != null) {
            mEnrollmentCallback.onPointerUp(sensorId);
        }
    }

    private void sendPowerPressed() {
        try {
+8 −0
Original line number Diff line number Diff line
@@ -230,6 +230,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
                session.getSession().onPointerDown(pc.pointerId, (int) pc.x, (int) pc.y, pc.minor,
                        pc.major);
            }

            if (getListener() != null) {
                getListener().onUdfpsPointerDown(getSensorId());
            }
        } catch (RemoteException e) {
            Slog.e(TAG, "Unable to send pointer down", e);
        }
@@ -246,6 +250,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
            } else {
                session.getSession().onPointerUp(pc.pointerId);
            }

            if (getListener() != null) {
                getListener().onUdfpsPointerUp(getSensorId());
            }
        } catch (RemoteException e) {
            Slog.e(TAG, "Unable to send pointer up", e);
        }