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

This commit is contained in:
Hao Dong
2023-01-19 21:24:07 +00:00
committed by Android (Google) Code Review
2 changed files with 30 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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);
}