summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-07-25 04:06:20 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-07-25 04:06:20 +0000
commit5faf43ad730e0126449b64e5df7a8fb47752bdea (patch)
tree492c277410dde1821d534e76271f61e64010bc21
parent14d150e595fd8d9f0da21974c33809d06bcbd7d8 (diff)
parenta4772064dfb6c463eebb831563a7dd8182010cc2 (diff)
Merge "Fixed race condition with different profiles" into qt-r1-dev
-rw-r--r--services/core/java/com/android/server/biometrics/BiometricServiceBase.java8
-rw-r--r--services/core/java/com/android/server/biometrics/face/FaceService.java32
2 files changed, 26 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
index 91a32f48ec9a..f3f9754bd32b 100644
--- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
+++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
@@ -912,8 +912,12 @@ public abstract class BiometricServiceBase extends SystemService
}
protected void setActiveUserInternal(int userId) {
- // Do not put on handler, since it should finish before returning to caller.
- updateActiveGroup(userId, null /* clientPackage */);
+ mHandler.post(() -> {
+ if (DEBUG) {
+ Slog.d(getTag(), "setActiveUser(" + userId + ")");
+ }
+ updateActiveGroup(userId, null /* clientPackage */);
+ });
}
protected void removeInternal(RemovalClient client) {
diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java
index c26e53ff8583..9d51abeed114 100644
--- a/services/core/java/com/android/server/biometrics/face/FaceService.java
+++ b/services/core/java/com/android/server/biometrics/face/FaceService.java
@@ -611,27 +611,32 @@ public class FaceService extends BiometricServiceBase {
public void resetLockout(byte[] token) {
checkPermission(MANAGE_BIOMETRIC);
- if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) {
- Slog.w(TAG, "Ignoring lockout reset, no templates enrolled");
- return;
- }
+ mHandler.post(() -> {
+ if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) {
+ Slog.w(TAG, "Ignoring lockout reset, no templates enrolled");
+ return;
+ }
- Slog.d(TAG, "Resetting lockout for user: " + mCurrentUserId);
+ Slog.d(TAG, "Resetting lockout for user: " + mCurrentUserId);
- try {
- mDaemonWrapper.resetLockout(token);
- } catch (RemoteException e) {
- Slog.e(getTag(), "Unable to reset lockout", e);
- }
+ try {
+ mDaemonWrapper.resetLockout(token);
+ } catch (RemoteException e) {
+ Slog.e(getTag(), "Unable to reset lockout", e);
+ }
+ });
}
@Override
public void setFeature(int userId, int feature, boolean enabled, final byte[] token,
IFaceServiceReceiver receiver, final String opPackageName) {
checkPermission(MANAGE_BIOMETRIC);
- updateActiveGroup(userId, opPackageName);
mHandler.post(() -> {
+ if (DEBUG) {
+ Slog.d(TAG, "setFeature for user(" + userId + ")");
+ }
+ updateActiveGroup(userId, opPackageName);
if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) {
Slog.e(TAG, "No enrolled biometrics while setting feature: " + feature);
return;
@@ -662,9 +667,12 @@ public class FaceService extends BiometricServiceBase {
public void getFeature(int userId, int feature, IFaceServiceReceiver receiver,
final String opPackageName) {
checkPermission(MANAGE_BIOMETRIC);
- updateActiveGroup(userId, opPackageName);
mHandler.post(() -> {
+ if (DEBUG) {
+ Slog.d(TAG, "getFeature for user(" + userId + ")");
+ }
+ updateActiveGroup(userId, opPackageName);
// This should ideally return tri-state, but the user isn't shown settings unless
// they are enrolled so it's fine for now.
if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) {