diff options
| author | 2023-01-19 21:24:07 +0000 | |
|---|---|---|
| committer | 2023-01-19 21:24:07 +0000 | |
| commit | 368f1c05e78b5f21fb8b33b498e0141133b11d10 (patch) | |
| tree | 9f892c114ec64d61a3acc773d555e4bc437e6984 | |
| parent | 771535388abe02a0e71a8e57965aa4861903537f (diff) | |
| parent | 3c41539eaab6463ef5796d7025a5f4e028036394 (diff) | |
Merge "Fix UI bugs for udfps enroll in settings."
| -rw-r--r-- | core/java/android/hardware/fingerprint/FingerprintManager.java | 27 | ||||
| -rw-r--r-- | services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java | 8 |
2 files changed, 30 insertions, 5 deletions
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java index 04a204a09f5e..b24b30e33f17 100644 --- a/core/java/android/hardware/fingerprint/FingerprintManager.java +++ b/core/java/android/hardware/fingerprint/FingerprintManager.java @@ -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,17 +1464,24 @@ 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); } - mAuthenticationCallback.onUdfpsPointerDown(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); } - mAuthenticationCallback.onUdfpsPointerUp(sensorId); } private void sendPowerPressed() { diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java index 2ac8b433b3af..513b3e3e6e86 100644 --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java @@ -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); } |