Loading core/java/android/hardware/biometrics/AuthenticationStateListener.aidl +16 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,20 @@ oneway interface AuthenticationStateListener { * Defines behavior in response to authentication stopping */ void onAuthenticationStopped(); /** * Defines behavior in response to a successful authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ void onAuthenticationSucceeded(int requestReason, int userId); /** * Defines behavior in response to a failed authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ void onAuthenticationFailed(int requestReason, int userId); } core/java/android/hardware/face/IFaceService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.hardware.face; import android.hardware.biometrics.AuthenticationStateListener; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.hardware.biometrics.IBiometricStateListener; Loading Loading @@ -181,6 +182,14 @@ interface IFaceService { // authenticators. The callback is automatically removed after it's invoked. void addAuthenticatorsRegisteredCallback(IFaceAuthenticatorsRegisteredCallback callback); // Registers AuthenticationStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerAuthenticationStateListener(AuthenticationStateListener listener); // Unregisters AuthenticationStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void unregisterAuthenticationStateListener(AuthenticationStateListener listener); // Registers BiometricStateListener. void registerBiometricStateListener(IBiometricStateListener listener); Loading packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ constructor( override fun onAuthenticationStopped() { updateFingerprintAuthenticateReason(AuthenticationReason.NotRunning) } override fun onAuthenticationSucceeded(requestReason: Int, userId: Int) {} override fun onAuthenticationFailed(requestReason: Int, userId: Int) {} } updateFingerprintAuthenticateReason(AuthenticationReason.NotRunning) Loading services/core/java/com/android/server/biometrics/AuthService.java +8 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ public class AuthService extends SystemService { if (fingerprintService != null) { fingerprintService.registerAuthenticationStateListener(listener); } final IFaceService faceService = mInjector.getFaceService(); if (faceService != null) { faceService.registerAuthenticationStateListener(listener); } } @Override Loading @@ -449,6 +453,10 @@ public class AuthService extends SystemService { if (fingerprintService != null) { fingerprintService.unregisterAuthenticationStateListener(listener); } final IFaceService faceService = mInjector.getFaceService(); if (faceService != null) { faceService.unregisterAuthenticationStateListener(listener); } } @Override Loading services/core/java/com/android/server/biometrics/sensors/AuthenticationStateListeners.java +34 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,40 @@ public class AuthenticationStateListeners implements IBinder.DeathRecipient { } } /** * Defines behavior in response to a successful authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ public void onAuthenticationSucceeded(int requestReason, int userId) { for (AuthenticationStateListener listener: mAuthenticationStateListeners) { try { listener.onAuthenticationSucceeded(requestReason, userId); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in notifying listener that authentication " + "succeeded", e); } } } /** * Defines behavior in response to a failed authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ public void onAuthenticationFailed(int requestReason, int userId) { for (AuthenticationStateListener listener: mAuthenticationStateListeners) { try { listener.onAuthenticationFailed(requestReason, userId); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in notifying listener that authentication " + "failed", e); } } } @Override public void binderDied() { // Do nothing, handled below Loading Loading
core/java/android/hardware/biometrics/AuthenticationStateListener.aidl +16 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,20 @@ oneway interface AuthenticationStateListener { * Defines behavior in response to authentication stopping */ void onAuthenticationStopped(); /** * Defines behavior in response to a successful authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ void onAuthenticationSucceeded(int requestReason, int userId); /** * Defines behavior in response to a failed authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ void onAuthenticationFailed(int requestReason, int userId); }
core/java/android/hardware/face/IFaceService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.hardware.face; import android.hardware.biometrics.AuthenticationStateListener; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.hardware.biometrics.IBiometricStateListener; Loading Loading @@ -181,6 +182,14 @@ interface IFaceService { // authenticators. The callback is automatically removed after it's invoked. void addAuthenticatorsRegisteredCallback(IFaceAuthenticatorsRegisteredCallback callback); // Registers AuthenticationStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerAuthenticationStateListener(AuthenticationStateListener listener); // Unregisters AuthenticationStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void unregisterAuthenticationStateListener(AuthenticationStateListener listener); // Registers BiometricStateListener. void registerBiometricStateListener(IBiometricStateListener listener); Loading
packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ constructor( override fun onAuthenticationStopped() { updateFingerprintAuthenticateReason(AuthenticationReason.NotRunning) } override fun onAuthenticationSucceeded(requestReason: Int, userId: Int) {} override fun onAuthenticationFailed(requestReason: Int, userId: Int) {} } updateFingerprintAuthenticateReason(AuthenticationReason.NotRunning) Loading
services/core/java/com/android/server/biometrics/AuthService.java +8 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ public class AuthService extends SystemService { if (fingerprintService != null) { fingerprintService.registerAuthenticationStateListener(listener); } final IFaceService faceService = mInjector.getFaceService(); if (faceService != null) { faceService.registerAuthenticationStateListener(listener); } } @Override Loading @@ -449,6 +453,10 @@ public class AuthService extends SystemService { if (fingerprintService != null) { fingerprintService.unregisterAuthenticationStateListener(listener); } final IFaceService faceService = mInjector.getFaceService(); if (faceService != null) { faceService.unregisterAuthenticationStateListener(listener); } } @Override Loading
services/core/java/com/android/server/biometrics/sensors/AuthenticationStateListeners.java +34 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,40 @@ public class AuthenticationStateListeners implements IBinder.DeathRecipient { } } /** * Defines behavior in response to a successful authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ public void onAuthenticationSucceeded(int requestReason, int userId) { for (AuthenticationStateListener listener: mAuthenticationStateListeners) { try { listener.onAuthenticationSucceeded(requestReason, userId); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in notifying listener that authentication " + "succeeded", e); } } } /** * Defines behavior in response to a failed authentication * @param requestReason Reason from [BiometricRequestConstants.RequestReason] for the requested * authentication * @param userId The user Id for the requested authentication */ public void onAuthenticationFailed(int requestReason, int userId) { for (AuthenticationStateListener listener: mAuthenticationStateListeners) { try { listener.onAuthenticationFailed(requestReason, userId); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in notifying listener that authentication " + "failed", e); } } } @Override public void binderDied() { // Do nothing, handled below Loading