Loading core/java/android/hardware/face/FaceManager.java +40 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Context; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricFaceConstants; import android.hardware.biometrics.BiometricStateListener; import android.hardware.biometrics.CryptoObject; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.os.Binder; Loading Loading @@ -673,6 +674,45 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan return new ArrayList<>(); } /** * Forwards BiometricStateListener to FaceService. * * @param listener new BiometricStateListener being added * @hide */ public void registerBiometricStateListener(@NonNull BiometricStateListener listener) { try { mService.registerBiometricStateListener(listener); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Adds a callback that gets called when the service registers all of the face * authenticators (HALs). * * If the face authenticators are already registered when the callback is added, the * callback is invoked immediately. * * The callback is automatically removed after it's invoked. * * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void addAuthenticatorsRegisteredCallback( IFaceAuthenticatorsRegisteredCallback callback) { if (mService != null) { try { mService.addAuthenticatorsRegisteredCallback(callback); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } else { Slog.w(TAG, "addAuthenticatorsRegisteredCallback(): Service not connected!"); } } /** * @hide */ Loading core/java/android/hardware/face/IFaceAuthenticatorsRegisteredCallback.aidl 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.face; import android.hardware.face.FaceSensorPropertiesInternal; import java.util.List; /** * Callback to notify FaceManager that FaceService has registered all of the * face authenticators (HALs). * See {@link android.hardware.face.IFaceService#registerAuthenticators}. * * @hide */ oneway interface IFaceAuthenticatorsRegisteredCallback { /** * Notifies FaceManager that all of the face authenticators have been registered. * * @param sensors A consolidated list of sensor properties for all of the authenticators. */ void onAllAuthenticatorsRegistered(in List<FaceSensorPropertiesInternal> sensors); } core/java/android/hardware/face/IFaceService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package android.hardware.face; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.hardware.biometrics.IBiometricStateListener; import android.hardware.biometrics.IInvalidationCallback; import android.hardware.biometrics.ITestSession; import android.hardware.biometrics.ITestSessionCallback; import android.hardware.face.IFaceAuthenticatorsRegisteredCallback; import android.hardware.face.IFaceServiceReceiver; import android.hardware.face.Face; import android.hardware.face.FaceSensorPropertiesInternal; Loading Loading @@ -163,4 +165,11 @@ interface IFaceService { // hidlSensors must be non-null and empty. See AuthService.java @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerAuthenticators(in List<FaceSensorPropertiesInternal> hidlSensors); // Adds a callback which gets called when the service registers all of the face // authenticators. The callback is automatically removed after it's invoked. void addAuthenticatorsRegisteredCallback(IFaceAuthenticatorsRegisteredCallback callback); // Registers BiometricStateListener. void registerBiometricStateListener(IBiometricStateListener listener); } core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -202,8 +202,10 @@ interface IFingerprintService { void setSidefpsController(in ISidefpsController controller); // Registers BiometricStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerBiometricStateListener(IBiometricStateListener listener); // Sends a power button pressed event to all listeners. @EnforcePermission("USE_BIOMETRIC_INTERNAL") oneway void onPowerPressed(); } packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.database.ContentObserver; import android.hardware.SensorPrivacyManager; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricFingerprintConstants; import android.hardware.biometrics.BiometricManager; import android.hardware.biometrics.BiometricSourceType; Loading Loading @@ -2019,12 +2020,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // in case authenticators aren't registered yet at this point: mAuthController.addCallback(new AuthController.Callback() { @Override public void onAllAuthenticatorsRegistered() { public void onAllAuthenticatorsRegistered( @BiometricAuthenticator.Modality int modality) { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } @Override public void onEnrollmentsChanged() { public void onEnrollmentsChanged(@BiometricAuthenticator.Modality int modality) { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } }); Loading Loading
core/java/android/hardware/face/FaceManager.java +40 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Context; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricFaceConstants; import android.hardware.biometrics.BiometricStateListener; import android.hardware.biometrics.CryptoObject; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.os.Binder; Loading Loading @@ -673,6 +674,45 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan return new ArrayList<>(); } /** * Forwards BiometricStateListener to FaceService. * * @param listener new BiometricStateListener being added * @hide */ public void registerBiometricStateListener(@NonNull BiometricStateListener listener) { try { mService.registerBiometricStateListener(listener); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Adds a callback that gets called when the service registers all of the face * authenticators (HALs). * * If the face authenticators are already registered when the callback is added, the * callback is invoked immediately. * * The callback is automatically removed after it's invoked. * * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void addAuthenticatorsRegisteredCallback( IFaceAuthenticatorsRegisteredCallback callback) { if (mService != null) { try { mService.addAuthenticatorsRegisteredCallback(callback); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } else { Slog.w(TAG, "addAuthenticatorsRegisteredCallback(): Service not connected!"); } } /** * @hide */ Loading
core/java/android/hardware/face/IFaceAuthenticatorsRegisteredCallback.aidl 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.face; import android.hardware.face.FaceSensorPropertiesInternal; import java.util.List; /** * Callback to notify FaceManager that FaceService has registered all of the * face authenticators (HALs). * See {@link android.hardware.face.IFaceService#registerAuthenticators}. * * @hide */ oneway interface IFaceAuthenticatorsRegisteredCallback { /** * Notifies FaceManager that all of the face authenticators have been registered. * * @param sensors A consolidated list of sensor properties for all of the authenticators. */ void onAllAuthenticatorsRegistered(in List<FaceSensorPropertiesInternal> sensors); }
core/java/android/hardware/face/IFaceService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package android.hardware.face; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; import android.hardware.biometrics.IBiometricStateListener; import android.hardware.biometrics.IInvalidationCallback; import android.hardware.biometrics.ITestSession; import android.hardware.biometrics.ITestSessionCallback; import android.hardware.face.IFaceAuthenticatorsRegisteredCallback; import android.hardware.face.IFaceServiceReceiver; import android.hardware.face.Face; import android.hardware.face.FaceSensorPropertiesInternal; Loading Loading @@ -163,4 +165,11 @@ interface IFaceService { // hidlSensors must be non-null and empty. See AuthService.java @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerAuthenticators(in List<FaceSensorPropertiesInternal> hidlSensors); // Adds a callback which gets called when the service registers all of the face // authenticators. The callback is automatically removed after it's invoked. void addAuthenticatorsRegisteredCallback(IFaceAuthenticatorsRegisteredCallback callback); // Registers BiometricStateListener. void registerBiometricStateListener(IBiometricStateListener listener); }
core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -202,8 +202,10 @@ interface IFingerprintService { void setSidefpsController(in ISidefpsController controller); // Registers BiometricStateListener. @EnforcePermission("USE_BIOMETRIC_INTERNAL") void registerBiometricStateListener(IBiometricStateListener listener); // Sends a power button pressed event to all listeners. @EnforcePermission("USE_BIOMETRIC_INTERNAL") oneway void onPowerPressed(); }
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.database.ContentObserver; import android.hardware.SensorPrivacyManager; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricFingerprintConstants; import android.hardware.biometrics.BiometricManager; import android.hardware.biometrics.BiometricSourceType; Loading Loading @@ -2019,12 +2020,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // in case authenticators aren't registered yet at this point: mAuthController.addCallback(new AuthController.Callback() { @Override public void onAllAuthenticatorsRegistered() { public void onAllAuthenticatorsRegistered( @BiometricAuthenticator.Modality int modality) { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } @Override public void onEnrollmentsChanged() { public void onEnrollmentsChanged(@BiometricAuthenticator.Modality int modality) { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } }); Loading