Loading core/proto/android/server/biometrics.proto +9 −4 Original line number Diff line number Diff line Loading @@ -120,18 +120,23 @@ message SensorStateProto { optional Modality modality = 2; // The current strength (see {@link BiometricManager.Authenticators}) of this sensor, taking any // downgraded strengths into effect. It may be different from the sensor's original strength but // can never be stronger than that. optional int32 current_strength = 3; // State of the sensor's scheduler. optional BiometricSchedulerProto scheduler = 3; optional BiometricSchedulerProto scheduler = 4; // User states for this sensor. repeated UserStateProto user_states = 4; repeated UserStateProto user_states = 5; // True if resetLockout requires a HAT to be verified in the TEE or equivalent. optional bool reset_lockout_requires_hardware_auth_token = 5; optional bool reset_lockout_requires_hardware_auth_token = 6; // True if a HAT is required (field above) AND a challenge needs to be generated by the // biometric TEE (or equivalent), and wrapped within the HAT. optional bool reset_lockout_requires_challenge = 6; optional bool reset_lockout_requires_challenge = 7; } // State of a specific user for a specific sensor. Loading services/core/java/com/android/server/biometrics/BiometricStrengthController.java +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ public class BiometricStrengthController { final int id = sensor.id; if (idToStrength.containsKey(id)) { final int newStrength = idToStrength.get(id); Slog.d(TAG, "updateStrengths: update sensorId=" + id + " to newStrength=" + newStrength); sensor.updateStrength(newStrength); } } Loading services/core/java/com/android/server/biometrics/Utils.java +17 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,23 @@ public class Utils { } } /** * Returns the sensor's current strength, taking any updated strengths into effect. * * @param sensorId The sensor Id * @return see {@link BiometricManager.Authenticators} */ public static @Authenticators.Types int getCurrentStrength(int sensorId) { IBiometricService service = IBiometricService.Stub.asInterface( ServiceManager.getService(Context.BIOMETRIC_SERVICE)); try { return service.getCurrentStrength(sensorId); } catch (RemoteException e) { Slog.e(TAG, "RemoteException", e); return Authenticators.EMPTY_SET; } } /** * Checks if a client package matches Keyguard and can perform internal biometric operations. * Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java +2 −0 Original line number Diff line number Diff line Loading @@ -557,6 +557,8 @@ public class Sensor { proto.write(SensorStateProto.SENSOR_ID, mSensorProperties.sensorId); proto.write(SensorStateProto.MODALITY, SensorStateProto.FACE); proto.write(SensorStateProto.CURRENT_STRENGTH, Utils.getCurrentStrength(mSensorProperties.sensorId)); proto.write(SensorStateProto.SCHEDULER, mScheduler.dumpProtoState(clearSchedulerBuffer)); for (UserInfo user : UserManager.get(mContext).getUsers()) { Loading services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java +2 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,8 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider { proto.write(SensorStateProto.SENSOR_ID, mSensorProperties.sensorId); proto.write(SensorStateProto.MODALITY, SensorStateProto.FACE); proto.write(SensorStateProto.CURRENT_STRENGTH, Utils.getCurrentStrength(mSensorProperties.sensorId)); proto.write(SensorStateProto.SCHEDULER, mScheduler.dumpProtoState(clearSchedulerBuffer)); for (UserInfo user : UserManager.get(mContext).getUsers()) { Loading Loading
core/proto/android/server/biometrics.proto +9 −4 Original line number Diff line number Diff line Loading @@ -120,18 +120,23 @@ message SensorStateProto { optional Modality modality = 2; // The current strength (see {@link BiometricManager.Authenticators}) of this sensor, taking any // downgraded strengths into effect. It may be different from the sensor's original strength but // can never be stronger than that. optional int32 current_strength = 3; // State of the sensor's scheduler. optional BiometricSchedulerProto scheduler = 3; optional BiometricSchedulerProto scheduler = 4; // User states for this sensor. repeated UserStateProto user_states = 4; repeated UserStateProto user_states = 5; // True if resetLockout requires a HAT to be verified in the TEE or equivalent. optional bool reset_lockout_requires_hardware_auth_token = 5; optional bool reset_lockout_requires_hardware_auth_token = 6; // True if a HAT is required (field above) AND a challenge needs to be generated by the // biometric TEE (or equivalent), and wrapped within the HAT. optional bool reset_lockout_requires_challenge = 6; optional bool reset_lockout_requires_challenge = 7; } // State of a specific user for a specific sensor. Loading
services/core/java/com/android/server/biometrics/BiometricStrengthController.java +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ public class BiometricStrengthController { final int id = sensor.id; if (idToStrength.containsKey(id)) { final int newStrength = idToStrength.get(id); Slog.d(TAG, "updateStrengths: update sensorId=" + id + " to newStrength=" + newStrength); sensor.updateStrength(newStrength); } } Loading
services/core/java/com/android/server/biometrics/Utils.java +17 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,23 @@ public class Utils { } } /** * Returns the sensor's current strength, taking any updated strengths into effect. * * @param sensorId The sensor Id * @return see {@link BiometricManager.Authenticators} */ public static @Authenticators.Types int getCurrentStrength(int sensorId) { IBiometricService service = IBiometricService.Stub.asInterface( ServiceManager.getService(Context.BIOMETRIC_SERVICE)); try { return service.getCurrentStrength(sensorId); } catch (RemoteException e) { Slog.e(TAG, "RemoteException", e); return Authenticators.EMPTY_SET; } } /** * Checks if a client package matches Keyguard and can perform internal biometric operations. * Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java +2 −0 Original line number Diff line number Diff line Loading @@ -557,6 +557,8 @@ public class Sensor { proto.write(SensorStateProto.SENSOR_ID, mSensorProperties.sensorId); proto.write(SensorStateProto.MODALITY, SensorStateProto.FACE); proto.write(SensorStateProto.CURRENT_STRENGTH, Utils.getCurrentStrength(mSensorProperties.sensorId)); proto.write(SensorStateProto.SCHEDULER, mScheduler.dumpProtoState(clearSchedulerBuffer)); for (UserInfo user : UserManager.get(mContext).getUsers()) { Loading
services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java +2 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,8 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider { proto.write(SensorStateProto.SENSOR_ID, mSensorProperties.sensorId); proto.write(SensorStateProto.MODALITY, SensorStateProto.FACE); proto.write(SensorStateProto.CURRENT_STRENGTH, Utils.getCurrentStrength(mSensorProperties.sensorId)); proto.write(SensorStateProto.SCHEDULER, mScheduler.dumpProtoState(clearSchedulerBuffer)); for (UserInfo user : UserManager.get(mContext).getUsers()) { Loading