diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-04-19 12:41:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-19 12:41:58 +0000 |
commit | 1e40a6c1261cf643c8d9405da2746f284e29ca2f (patch) | |
tree | 68c332eb6527f07aeedb0abfb58fa22fbba4e13b | |
parent | 7171819017ce7b2b50de6dc7ddcc30ca98c0cbc4 (diff) | |
parent | babdfbcb0a0630c1c4c23c9c24d10c19312e989c (diff) | |
download | base-1e40a6c1261cf643c8d9405da2746f284e29ca2f.tar.gz |
Merge "BiometricService: put the mthod of resetLockoutFor into handler when binder called and keep thread-safe in RingBuffer." into main
-rw-r--r-- | services/core/java/com/android/server/biometrics/BiometricService.java | 4 | ||||
-rw-r--r-- | services/core/java/com/android/server/biometrics/sensors/AuthSessionCoordinator.java | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index bccbee90e234..d10223fddbae 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -848,8 +848,10 @@ public class BiometricService extends SystemService { Slog.d(TAG, "resetLockout(userId=" + userId + ", hat=" + (hardwareAuthToken == null ? "null " : "present") + ")"); - mBiometricContext.getAuthSessionCoordinator() + mHandler.post(() -> { + mBiometricContext.getAuthSessionCoordinator() .resetLockoutFor(userId, Authenticators.BIOMETRIC_STRONG, -1); + }); } @android.annotation.EnforcePermission(android.Manifest.permission.USE_BIOMETRIC_INTERNAL) diff --git a/services/core/java/com/android/server/biometrics/sensors/AuthSessionCoordinator.java b/services/core/java/com/android/server/biometrics/sensors/AuthSessionCoordinator.java index d9947ddedcef..dc2eff4847f7 100644 --- a/services/core/java/com/android/server/biometrics/sensors/AuthSessionCoordinator.java +++ b/services/core/java/com/android/server/biometrics/sensors/AuthSessionCoordinator.java @@ -235,7 +235,7 @@ public class AuthSessionCoordinator implements AuthSessionListener { mApiCallNumber = 0; } - void addApiCall(String str) { + synchronized void addApiCall(String str) { mApiCalls[mCurr] = str; mCurr++; mCurr %= mSize; @@ -243,7 +243,7 @@ public class AuthSessionCoordinator implements AuthSessionListener { } @Override - public String toString() { + public synchronized String toString() { String buffer = ""; int apiCall = mApiCallNumber > mSize ? mApiCallNumber - mSize : 0; for (int i = 0; i < mSize; i++) { |