Loading services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java +4 −8 Original line number Diff line number Diff line Loading @@ -112,10 +112,8 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement getLogger().logOnError(getContext(), getOperationContext(), errorCode, vendorCode, getTargetUserId()); try { if (getListener() != null) { mShouldSendErrorToClient = false; getListener().onError(getSensorId(), getCookie(), errorCode, vendorCode); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading Loading @@ -147,9 +145,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement final int errorCode = BiometricConstants.BIOMETRIC_ERROR_CANCELED; try { if (getListener() != null) { getListener().onError(getSensorId(), getCookie(), errorCode, 0 /* vendorCode */); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading Loading @@ -181,7 +177,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement } try { if (getListener() != null && shouldSend) { if (shouldSend) { getListener().onAcquired(getSensorId(), acquiredInfo, vendorCode); } } catch (RemoteException e) { Loading services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java +7 −15 Original line number Diff line number Diff line Loading @@ -265,7 +265,6 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> Slog.d(TAG, "Skipping addAuthToken"); } try { if (listener != null) { if (!mIsRestricted) { listener.onAuthenticationSucceeded(getSensorId(), identifier, byteToken, getTargetUserId(), mIsStrongBiometric); Loading @@ -274,9 +273,6 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> byteToken, getTargetUserId(), mIsStrongBiometric); } } else { Slog.e(TAG, "Received successful auth, but client was not listening"); } } catch (RemoteException e) { Slog.e(TAG, "Unable to notify listener", e); mCallback.onClientFinished(this, false); Loading @@ -301,11 +297,7 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> } try { if (listener != null) { listener.onAuthenticationFailed(getSensorId()); } else { Slog.e(TAG, "Received failed auth, but client was not listening"); } } catch (RemoteException e) { Slog.e(TAG, "Unable to notify listener", e); mCallback.onClientFinished(this, false); Loading services/core/java/com/android/server/biometrics/sensors/BaseClientMonitor.java +8 −8 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.IBiometricSensorReceiver; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; Loading Loading @@ -55,7 +56,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { @Nullable private IBinder mToken; private long mRequestId; @Nullable private ClientMonitorCallbackConverter mListener; @NonNull private ClientMonitorCallbackConverter mListener; // Currently only used for authentication client. The cookie generated by BiometricService // is never 0. private final int mCookie; Loading Loading @@ -95,7 +96,8 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { mContext = context; mToken = token; mRequestId = -1; mListener = listener; mListener = listener == null ? new ClientMonitorCallbackConverter( new IBiometricSensorReceiver.Default()) : listener; mTargetUserId = userId; mOwner = owner; mCookie = cookie; Loading Loading @@ -199,7 +201,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { } mToken = null; if (clearListener) { mListener = null; mListener = new ClientMonitorCallbackConverter(new IBiometricSensorReceiver.Default()); } } Loading Loading @@ -233,8 +235,8 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { return mOwner; } @Nullable public final ClientMonitorCallbackConverter getListener() { @NonNull protected ClientMonitorCallbackConverter getListener() { return mListener; } Loading Loading @@ -312,9 +314,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { final int errorCode = BiometricConstants.BIOMETRIC_ERROR_CANCELED; try { ClientMonitorCallbackConverter listener = getListener(); if (listener != null) { listener.onError(getSensorId(), getCookie(), errorCode, 0 /* vendorCode */); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading services/core/java/com/android/server/biometrics/sensors/EnrollClient.java +1 −3 Original line number Diff line number Diff line Loading @@ -82,9 +82,7 @@ public abstract class EnrollClient<T> extends AcquisitionClient<T> implements En final ClientMonitorCallbackConverter listener = getListener(); try { if (listener != null) { listener.onEnrollResult(identifier, remaining); } } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } Loading services/core/java/com/android/server/biometrics/sensors/RemovalClient.java +4 −10 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier, if (identifier == null) { Slog.e(TAG, "identifier was null, skipping onRemove()"); try { if (getListener() != null) { getListener().onError(getSensorId(), getCookie(), BiometricConstants.BIOMETRIC_ERROR_UNABLE_TO_REMOVE, 0 /* vendorCode */); } else { Slog.e(TAG, "Error, listener was null, not sending onError callback"); } } catch (RemoteException e) { Slog.w(TAG, "Failed to send error to client for onRemoved", e); } Loading @@ -93,9 +89,7 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier, identifier.getBiometricId()); try { if (getListener() != null) { getListener().onRemoved(identifier, remaining); } } catch (RemoteException e) { Slog.w(TAG, "Failed to notify Removed:", e); } Loading Loading
services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java +4 −8 Original line number Diff line number Diff line Loading @@ -112,10 +112,8 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement getLogger().logOnError(getContext(), getOperationContext(), errorCode, vendorCode, getTargetUserId()); try { if (getListener() != null) { mShouldSendErrorToClient = false; getListener().onError(getSensorId(), getCookie(), errorCode, vendorCode); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading Loading @@ -147,9 +145,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement final int errorCode = BiometricConstants.BIOMETRIC_ERROR_CANCELED; try { if (getListener() != null) { getListener().onError(getSensorId(), getCookie(), errorCode, 0 /* vendorCode */); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading Loading @@ -181,7 +177,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement } try { if (getListener() != null && shouldSend) { if (shouldSend) { getListener().onAcquired(getSensorId(), acquiredInfo, vendorCode); } } catch (RemoteException e) { Loading
services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java +7 −15 Original line number Diff line number Diff line Loading @@ -265,7 +265,6 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> Slog.d(TAG, "Skipping addAuthToken"); } try { if (listener != null) { if (!mIsRestricted) { listener.onAuthenticationSucceeded(getSensorId(), identifier, byteToken, getTargetUserId(), mIsStrongBiometric); Loading @@ -274,9 +273,6 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> byteToken, getTargetUserId(), mIsStrongBiometric); } } else { Slog.e(TAG, "Received successful auth, but client was not listening"); } } catch (RemoteException e) { Slog.e(TAG, "Unable to notify listener", e); mCallback.onClientFinished(this, false); Loading @@ -301,11 +297,7 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions> } try { if (listener != null) { listener.onAuthenticationFailed(getSensorId()); } else { Slog.e(TAG, "Received failed auth, but client was not listening"); } } catch (RemoteException e) { Slog.e(TAG, "Unable to notify listener", e); mCallback.onClientFinished(this, false); Loading
services/core/java/com/android/server/biometrics/sensors/BaseClientMonitor.java +8 −8 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.IBiometricSensorReceiver; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; Loading Loading @@ -55,7 +56,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { @Nullable private IBinder mToken; private long mRequestId; @Nullable private ClientMonitorCallbackConverter mListener; @NonNull private ClientMonitorCallbackConverter mListener; // Currently only used for authentication client. The cookie generated by BiometricService // is never 0. private final int mCookie; Loading Loading @@ -95,7 +96,8 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { mContext = context; mToken = token; mRequestId = -1; mListener = listener; mListener = listener == null ? new ClientMonitorCallbackConverter( new IBiometricSensorReceiver.Default()) : listener; mTargetUserId = userId; mOwner = owner; mCookie = cookie; Loading Loading @@ -199,7 +201,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { } mToken = null; if (clearListener) { mListener = null; mListener = new ClientMonitorCallbackConverter(new IBiometricSensorReceiver.Default()); } } Loading Loading @@ -233,8 +235,8 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { return mOwner; } @Nullable public final ClientMonitorCallbackConverter getListener() { @NonNull protected ClientMonitorCallbackConverter getListener() { return mListener; } Loading Loading @@ -312,9 +314,7 @@ public abstract class BaseClientMonitor implements IBinder.DeathRecipient { final int errorCode = BiometricConstants.BIOMETRIC_ERROR_CANCELED; try { ClientMonitorCallbackConverter listener = getListener(); if (listener != null) { listener.onError(getSensorId(), getCookie(), errorCode, 0 /* vendorCode */); } } catch (RemoteException e) { Slog.w(TAG, "Failed to invoke sendError", e); } Loading
services/core/java/com/android/server/biometrics/sensors/EnrollClient.java +1 −3 Original line number Diff line number Diff line Loading @@ -82,9 +82,7 @@ public abstract class EnrollClient<T> extends AcquisitionClient<T> implements En final ClientMonitorCallbackConverter listener = getListener(); try { if (listener != null) { listener.onEnrollResult(identifier, remaining); } } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } Loading
services/core/java/com/android/server/biometrics/sensors/RemovalClient.java +4 −10 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier, if (identifier == null) { Slog.e(TAG, "identifier was null, skipping onRemove()"); try { if (getListener() != null) { getListener().onError(getSensorId(), getCookie(), BiometricConstants.BIOMETRIC_ERROR_UNABLE_TO_REMOVE, 0 /* vendorCode */); } else { Slog.e(TAG, "Error, listener was null, not sending onError callback"); } } catch (RemoteException e) { Slog.w(TAG, "Failed to send error to client for onRemoved", e); } Loading @@ -93,9 +89,7 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier, identifier.getBiometricId()); try { if (getListener() != null) { getListener().onRemoved(identifier, remaining); } } catch (RemoteException e) { Slog.w(TAG, "Failed to notify Removed:", e); } Loading