Merge "Add additional cancel logs." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-07-02 01:25:17 +00:00
committed by Android (Google) Code Review
4 changed files with 9 additions and 5 deletions

View File

@@ -261,7 +261,7 @@ public class AuthService extends SystemService {
private void authenticateFastFail(String message, IBiometricServiceReceiver receiver) {
// notify caller in cases where authentication is aborted before calling into
// IBiometricService without raising an exception
Slog.e(TAG, message);
Slog.e(TAG, "authenticateFastFail: " + message);
try {
receiver.onError(TYPE_NONE, BIOMETRIC_ERROR_CANCELED, 0 /*vendorCode */);
} catch (RemoteException e) {

View File

@@ -382,9 +382,7 @@ public final class AuthSession implements IBinder.DeathRecipient {
*/
boolean onErrorReceived(int sensorId, int cookie, @BiometricConstants.Errors int error,
int vendorCode) throws RemoteException {
if (DEBUG) {
Slog.v(TAG, "onErrorReceived sensor: " + sensorId + " error: " + error);
}
Slog.d(TAG, "onErrorReceived sensor: " + sensorId + " error: " + error);
if (!containsCookie(cookie)) {
Slog.e(TAG, "Unknown/expired cookie: " + cookie);

View File

@@ -87,6 +87,8 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement
* operation still needs to wait for the HAL to send ERROR_CANCELED.
*/
public void onUserCanceled() {
Slog.d(TAG, "onUserCanceled");
// Send USER_CANCELED, but do not finish. Wait for the HAL to respond with ERROR_CANCELED,
// which then finishes the AcquisitionClient's lifecycle.
onErrorInternal(BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED, 0 /* vendorCode */,
@@ -95,6 +97,8 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement
}
protected void onErrorInternal(int errorCode, int vendorCode, boolean finish) {
Slog.d(TAG, "onErrorInternal code: " + errorCode + ", finish: " + finish);
// In some cases, the framework will send an error to the caller before a true terminal
// case (success, failure, or error) is received from the HAL (e.g. versions of fingerprint
// that do not handle lockout under the HAL. In these cases, ensure that the framework only
@@ -133,6 +137,8 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement
@Override
public void cancelWithoutStarting(@NonNull Callback callback) {
Slog.d(TAG, "cancelWithoutStarting: " + this);
final int errorCode = BiometricConstants.BIOMETRIC_ERROR_CANCELED;
try {
if (getListener() != null) {

View File

@@ -308,7 +308,7 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
mActivityTaskManager.registerTaskStackListener(mTaskStackListener);
}
if (DEBUG) Slog.w(TAG, "Requesting auth for " + getOwnerString());
Slog.d(TAG, "Requesting auth for " + getOwnerString());
mStartTimeMs = System.currentTimeMillis();
mAuthAttempted = true;