Merge "Move synchronous generateChallenge to implementation-specific classes"
This commit is contained in:
@@ -27,8 +27,6 @@ public abstract class GenerateChallengeClient<T> extends ClientMonitor<T> {
|
||||
|
||||
private static final String TAG = "GenerateChallengeClient";
|
||||
|
||||
protected long mChallenge;
|
||||
|
||||
public GenerateChallengeClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
|
||||
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
|
||||
@NonNull String owner, int sensorId) {
|
||||
@@ -51,12 +49,5 @@ public abstract class GenerateChallengeClient<T> extends ClientMonitor<T> {
|
||||
super.start(callback);
|
||||
|
||||
startHalOperation();
|
||||
try {
|
||||
getListener().onChallengeGenerated(getSensorId(), mChallenge);
|
||||
mCallback.onClientFinished(this, true /* success */);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
mCallback.onClientFinished(this, false /* success */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,14 @@ public class FaceGenerateChallengeClient extends GenerateChallengeClient<IBiomet
|
||||
@Override
|
||||
protected void startHalOperation() {
|
||||
try {
|
||||
mChallenge = getFreshDaemon().generateChallenge(CHALLENGE_TIMEOUT_SEC).value;
|
||||
final long challenge = getFreshDaemon().generateChallenge(CHALLENGE_TIMEOUT_SEC).value;
|
||||
try {
|
||||
getListener().onChallengeGenerated(getSensorId(), challenge);
|
||||
mCallback.onClientFinished(this, true /* success */);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
mCallback.onClientFinished(this, false /* success */);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "generateChallenge failed", e);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,14 @@ public class FingerprintGenerateChallengeClient
|
||||
@Override
|
||||
protected void startHalOperation() {
|
||||
try {
|
||||
mChallenge = getFreshDaemon().preEnroll();
|
||||
final long challenge = getFreshDaemon().preEnroll();
|
||||
try {
|
||||
getListener().onChallengeGenerated(getSensorId(), challenge);
|
||||
mCallback.onClientFinished(this, true /* success */);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Remote exception", e);
|
||||
mCallback.onClientFinished(this, false /* success */);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "preEnroll failed", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user