summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aeric <aeric.lin@nothing.tech> 2024-09-02 15:19:30 +0800
committer Aeric Lin <aeric.lin@nothing.tech> 2024-09-07 16:38:04 +0000
commitf19b45e12f397576d961f03bf0de013e5127ce1f (patch)
tree32894af5494ea65e5a900d5c38c5092a71255167
parent952d16a946806b182c530b22717819453dd71908 (diff)
AuthService registerFaceSensor for hidl should only focus on face hidlConfigStrings
registerFaceSensor will register for FaceUnclok HIDL and AIDL, and in the begining setup FaceSensorConfigurations, it will mistake parser all the hidlConfigStrings. And that will cause some buggy if device implement with fingerprint HIDL and FaceUnlock AIDL, the FaceUnlock AIDL will be treated as HIDL. Bug: 363894516 Test: Manual see the log of AuthService when booting. Change-Id: I48ba228a258e56fb9db92dadb33339f52183242a
-rw-r--r--services/core/java/com/android/server/biometrics/AuthService.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index 2a1687209aad..de8aa2d6c246 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -850,10 +850,28 @@ public class AuthService extends SystemService {
return;
}
+ boolean tempResetLockoutRequiresChallenge = false;
+
+ if (hidlConfigStrings != null && hidlConfigStrings.length > 0) {
+ for (String configString : hidlConfigStrings) {
+ try {
+ SensorConfig sensor = new SensorConfig(configString);
+ switch (sensor.modality) {
+ case BiometricAuthenticator.TYPE_FACE:
+ tempResetLockoutRequiresChallenge = true;
+ break;
+ }
+ } catch (Exception e) {
+ Slog.e(TAG, "Error parsing configString: " + configString, e);
+ }
+ }
+ }
+
+ final boolean resetLockoutRequiresChallenge = tempResetLockoutRequiresChallenge;
+
handlerProvider.getFaceHandler().post(() -> {
final FaceSensorConfigurations mFaceSensorConfigurations =
- new FaceSensorConfigurations(hidlConfigStrings != null
- && hidlConfigStrings.length > 0);
+ new FaceSensorConfigurations(resetLockoutRequiresChallenge);
if (hidlConfigStrings != null && hidlConfigStrings.length > 0) {
mFaceSensorConfigurations.addHidlConfigs(hidlConfigStrings, context);