Add onUdfpsPointer* callbacks to FingerprintManager
Fixes: 175717879 Test: manual Change-Id: Ib1091ae1f0fc2d661a7fafba2aa804a257e7413b
This commit is contained in:
@@ -89,6 +89,8 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
private static final int MSG_REMOVED = 105;
|
||||
private static final int MSG_CHALLENGE_GENERATED = 106;
|
||||
private static final int MSG_FINGERPRINT_DETECTED = 107;
|
||||
private static final int MSG_UDFPS_POINTER_DOWN = 108;
|
||||
private static final int MSG_UDFPS_POINTER_UP = 109;
|
||||
|
||||
/**
|
||||
* Request authentication with any single sensor.
|
||||
@@ -338,6 +340,20 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
*/
|
||||
@Override
|
||||
public void onAuthenticationAcquired(int acquireInfo) {}
|
||||
|
||||
/**
|
||||
* Invoked for under-display fingerprint sensors when a touch has been detected on the
|
||||
* sensor area.
|
||||
* @hide
|
||||
*/
|
||||
public void onUdfpsPointerDown(int sensorId) {}
|
||||
|
||||
/**
|
||||
* Invoked for under-display fingerprint sensors when a touch has been removed from the
|
||||
* sensor area.
|
||||
* @hide
|
||||
*/
|
||||
public void onUdfpsPointerUp(int sensorId) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1005,6 +1021,12 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
sendFingerprintDetected(msg.arg1 /* sensorId */, msg.arg2 /* userId */,
|
||||
(boolean) msg.obj /* isStrongBiometric */);
|
||||
break;
|
||||
case MSG_UDFPS_POINTER_DOWN:
|
||||
sendUdfpsPointerDown(msg.arg1 /* sensorId */);
|
||||
break;
|
||||
case MSG_UDFPS_POINTER_UP:
|
||||
sendUdfpsPointerUp(msg.arg1 /* sensorId */);
|
||||
break;
|
||||
default:
|
||||
Slog.w(TAG, "Unknown message: " + msg.what);
|
||||
|
||||
@@ -1103,6 +1125,22 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
mFingerprintDetectionCallback.onFingerprintDetected(sensorId, userId, isStrongBiometric);
|
||||
}
|
||||
|
||||
private void sendUdfpsPointerDown(int sensorId) {
|
||||
if (mAuthenticationCallback == null) {
|
||||
Slog.e(TAG, "sendUdfpsPointerDown, callback null");
|
||||
return;
|
||||
}
|
||||
mAuthenticationCallback.onUdfpsPointerDown(sensorId);
|
||||
}
|
||||
|
||||
private void sendUdfpsPointerUp(int sensorId) {
|
||||
if (mAuthenticationCallback == null) {
|
||||
Slog.e(TAG, "sendUdfpsPointerUp, callback null");
|
||||
return;
|
||||
}
|
||||
mAuthenticationCallback.onUdfpsPointerUp(sensorId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@@ -1280,6 +1318,17 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
mHandler.obtainMessage(MSG_CHALLENGE_GENERATED, sensorId, 0, challenge)
|
||||
.sendToTarget();
|
||||
}
|
||||
|
||||
@Override // binder call
|
||||
public void onUdfpsPointerDown(int sensorId) {
|
||||
mHandler.obtainMessage(MSG_UDFPS_POINTER_DOWN, sensorId, 0).sendToTarget();
|
||||
}
|
||||
|
||||
@Override // binder call
|
||||
public void onUdfpsPointerUp(int sensorId) {
|
||||
mHandler.obtainMessage(MSG_UDFPS_POINTER_UP, sensorId, 0).sendToTarget();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -30,4 +30,6 @@ oneway interface IFingerprintServiceReceiver {
|
||||
void onError(int error, int vendorCode);
|
||||
void onRemoved(in Fingerprint fp, int remaining);
|
||||
void onChallengeGenerated(int sensorId, long challenge);
|
||||
void onUdfpsPointerDown(int sensorId);
|
||||
void onUdfpsPointerUp(int sensorId);
|
||||
}
|
||||
|
||||
@@ -1314,6 +1314,16 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
public void onAuthenticationAcquired(int acquireInfo) {
|
||||
handleFingerprintAcquired(acquireInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerDown(int sensorId) {
|
||||
Log.d(TAG, "onUdfpsPointerDown, sensorId: " + sensorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerUp(int sensorId) {
|
||||
Log.d(TAG, "onUdfpsPointerUp, sensorId: " + sensorId);
|
||||
}
|
||||
};
|
||||
|
||||
private final FaceManager.FaceDetectionCallback mFaceDetectionCallback
|
||||
|
||||
@@ -160,4 +160,18 @@ public class ClientMonitorCallbackConverter {
|
||||
mFaceServiceReceiver.onChallengeInterruptFinished(sensorId);
|
||||
}
|
||||
}
|
||||
|
||||
// Fingerprint-specific callbacks for FingerprintManager only
|
||||
|
||||
public void onUdfpsPointerDown(int sensorId, int cookie) throws RemoteException {
|
||||
if (mFingerprintServiceReceiver != null) {
|
||||
mFingerprintServiceReceiver.onUdfpsPointerDown(sensorId);
|
||||
}
|
||||
}
|
||||
|
||||
public void onUdfpsPointerUp(int sensorId, int cookie) throws RemoteException {
|
||||
if (mFingerprintServiceReceiver != null) {
|
||||
mFingerprintServiceReceiver.onUdfpsPointerUp(sensorId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,16 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
|
||||
public void onChallengeGenerated(int sensorId, long challenge) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerDown(int sensorId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerUp(int sensorId) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
BiometricTestSessionImpl(@NonNull Context context, int sensorId,
|
||||
|
||||
@@ -110,6 +110,9 @@ class FingerprintAuthenticationClient extends AuthenticationClient<ISession> imp
|
||||
public void onPointerDown(int x, int y, float minor, float major) {
|
||||
try {
|
||||
getFreshDaemon().onPointerDown(0 /* pointerId */, x, y, minor, major);
|
||||
if (getListener() != null) {
|
||||
getListener().onUdfpsPointerDown(getSensorId(), getCookie());
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
}
|
||||
@@ -119,6 +122,9 @@ class FingerprintAuthenticationClient extends AuthenticationClient<ISession> imp
|
||||
public void onPointerUp() {
|
||||
try {
|
||||
getFreshDaemon().onPointerUp(0 /* pointerId */);
|
||||
if (getListener() != null) {
|
||||
getListener().onUdfpsPointerUp(getSensorId(), getCookie());
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,16 @@ public class BiometricTestSessionImpl extends ITestSession.Stub {
|
||||
public void onChallengeGenerated(int sensorId, long challenge) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerDown(int sensorId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUdfpsPointerUp(int sensorId) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
BiometricTestSessionImpl(@NonNull Context context, int sensorId,
|
||||
|
||||
@@ -143,11 +143,25 @@ class FingerprintAuthenticationClient extends AuthenticationClient<IBiometricsFi
|
||||
@Override
|
||||
public void onPointerDown(int x, int y, float minor, float major) {
|
||||
UdfpsHelper.onFingerDown(getFreshDaemon(), x, y, minor, major);
|
||||
if (getListener() != null) {
|
||||
try {
|
||||
getListener().onUdfpsPointerDown(getSensorId(), getCookie());
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPointerUp() {
|
||||
UdfpsHelper.onFingerUp(getFreshDaemon());
|
||||
if (getListener() != null) {
|
||||
try {
|
||||
getListener().onUdfpsPointerUp(getSensorId(), getCookie());
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isKeyguard() {
|
||||
|
||||
Reference in New Issue
Block a user