Loading core/java/android/hardware/iris/IIrisService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -22,5 +22,5 @@ package android.hardware.iris; */ interface IIrisService { // Give IrisService its ID. See AuthService.java void initializeConfiguration(int sensorId); void initializeConfiguration(int sensorId, int strength); } services/core/java/com/android/server/biometrics/AuthService.java +4 −3 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public class AuthService extends SystemService { // initialization from here. AIDL HALs are initialized by FingerprintService since // the HAL interface provides ID, strength, and other configuration information. fingerprintService.initializeConfiguration(config.id, config.strength); authenticator = new FingerprintAuthenticator(fingerprintService, config); authenticator = new FingerprintAuthenticator(fingerprintService, config.id); break; case TYPE_FACE: Loading @@ -348,7 +348,7 @@ public class AuthService extends SystemService { // initialization from here. AIDL HALs are initialized by FaceService since // the HAL interface provides ID, strength, and other configuration information. faceService.initializeConfiguration(config.id, config.strength); authenticator = new FaceAuthenticator(faceService, config); authenticator = new FaceAuthenticator(faceService, config.id); break; case TYPE_IRIS: Loading @@ -359,7 +359,8 @@ public class AuthService extends SystemService { return; } authenticator = new IrisAuthenticator(irisService, config); irisService.initializeConfiguration(config.id, config.strength); authenticator = new IrisAuthenticator(irisService, config.id); break; default: Loading services/core/java/com/android/server/biometrics/BiometricService.java +0 −14 Original line number Diff line number Diff line Loading @@ -594,20 +594,6 @@ public class BiometricService extends SystemService { } } // This happens infrequently enough, not worth caching. final String[] configs = mInjector.getConfiguration(getContext()); boolean idFound = false; for (int i = 0; i < configs.length; i++) { SensorConfig config = new SensorConfig(configs[i]); if (config.id == id) { idFound = true; break; } } if (!idFound) { throw new IllegalStateException("Cannot register unknown id"); } mSensors.add(new BiometricSensor(id, modality, strength, authenticator) { @Override boolean confirmationAlwaysRequired(int userId) { Loading services/core/java/com/android/server/biometrics/Utils.java +15 −1 Original line number Diff line number Diff line Loading @@ -453,7 +453,7 @@ public class Utils { * {@link SensorPropertiesInternal} strength. */ public static @SensorProperties.Strength int authenticatorStrengthToPropertyStrength( @BiometricManager.Authenticators.Types int strength) { @Authenticators.Types int strength) { switch (strength) { case BiometricManager.Authenticators.BIOMETRIC_CONVENIENCE: return SensorProperties.STRENGTH_CONVENIENCE; Loading @@ -465,4 +465,18 @@ public class Utils { throw new IllegalArgumentException("Unknown strength: " + strength); } } public static @Authenticators.Types int propertyStrengthToAuthenticatorStrength( @SensorProperties.Strength int strength) { switch (strength) { case SensorProperties.STRENGTH_CONVENIENCE: return Authenticators.BIOMETRIC_CONVENIENCE; case SensorProperties.STRENGTH_WEAK: return Authenticators.BIOMETRIC_WEAK; case SensorProperties.STRENGTH_STRONG: return Authenticators.BIOMETRIC_STRONG; default: throw new IllegalArgumentException("Unknown strength: " + strength); } } } services/core/java/com/android/server/biometrics/sensors/BiometricServiceCallback.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 com.android.server.biometrics.sensors; /** * System_server services that require BiometricService to load before finishing initialization * should implement this interface. */ public interface BiometricServiceCallback { /** * Notifies the service that BiometricService is initialized. */ void onBiometricServiceReady(); } Loading
core/java/android/hardware/iris/IIrisService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -22,5 +22,5 @@ package android.hardware.iris; */ interface IIrisService { // Give IrisService its ID. See AuthService.java void initializeConfiguration(int sensorId); void initializeConfiguration(int sensorId, int strength); }
services/core/java/com/android/server/biometrics/AuthService.java +4 −3 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public class AuthService extends SystemService { // initialization from here. AIDL HALs are initialized by FingerprintService since // the HAL interface provides ID, strength, and other configuration information. fingerprintService.initializeConfiguration(config.id, config.strength); authenticator = new FingerprintAuthenticator(fingerprintService, config); authenticator = new FingerprintAuthenticator(fingerprintService, config.id); break; case TYPE_FACE: Loading @@ -348,7 +348,7 @@ public class AuthService extends SystemService { // initialization from here. AIDL HALs are initialized by FaceService since // the HAL interface provides ID, strength, and other configuration information. faceService.initializeConfiguration(config.id, config.strength); authenticator = new FaceAuthenticator(faceService, config); authenticator = new FaceAuthenticator(faceService, config.id); break; case TYPE_IRIS: Loading @@ -359,7 +359,8 @@ public class AuthService extends SystemService { return; } authenticator = new IrisAuthenticator(irisService, config); irisService.initializeConfiguration(config.id, config.strength); authenticator = new IrisAuthenticator(irisService, config.id); break; default: Loading
services/core/java/com/android/server/biometrics/BiometricService.java +0 −14 Original line number Diff line number Diff line Loading @@ -594,20 +594,6 @@ public class BiometricService extends SystemService { } } // This happens infrequently enough, not worth caching. final String[] configs = mInjector.getConfiguration(getContext()); boolean idFound = false; for (int i = 0; i < configs.length; i++) { SensorConfig config = new SensorConfig(configs[i]); if (config.id == id) { idFound = true; break; } } if (!idFound) { throw new IllegalStateException("Cannot register unknown id"); } mSensors.add(new BiometricSensor(id, modality, strength, authenticator) { @Override boolean confirmationAlwaysRequired(int userId) { Loading
services/core/java/com/android/server/biometrics/Utils.java +15 −1 Original line number Diff line number Diff line Loading @@ -453,7 +453,7 @@ public class Utils { * {@link SensorPropertiesInternal} strength. */ public static @SensorProperties.Strength int authenticatorStrengthToPropertyStrength( @BiometricManager.Authenticators.Types int strength) { @Authenticators.Types int strength) { switch (strength) { case BiometricManager.Authenticators.BIOMETRIC_CONVENIENCE: return SensorProperties.STRENGTH_CONVENIENCE; Loading @@ -465,4 +465,18 @@ public class Utils { throw new IllegalArgumentException("Unknown strength: " + strength); } } public static @Authenticators.Types int propertyStrengthToAuthenticatorStrength( @SensorProperties.Strength int strength) { switch (strength) { case SensorProperties.STRENGTH_CONVENIENCE: return Authenticators.BIOMETRIC_CONVENIENCE; case SensorProperties.STRENGTH_WEAK: return Authenticators.BIOMETRIC_WEAK; case SensorProperties.STRENGTH_STRONG: return Authenticators.BIOMETRIC_STRONG; default: throw new IllegalArgumentException("Unknown strength: " + strength); } } }
services/core/java/com/android/server/biometrics/sensors/BiometricServiceCallback.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 com.android.server.biometrics.sensors; /** * System_server services that require BiometricService to load before finishing initialization * should implement this interface. */ public interface BiometricServiceCallback { /** * Notifies the service that BiometricService is initialized. */ void onBiometricServiceReady(); }