Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fadc2ade authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Automerger Merge Worker
Browse files

Merge "Read and cache features when user switches" into rvc-qpr-dev am: acbb253b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12622350

Change-Id: I526da9f67f1fa1eb9e288f2d3e26f52d3dfaa11e
parents 90281441 acbb253b
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.Intent;
import android.content.pm.UserInfo;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.hardware.biometrics.IBiometricServiceReceiverInternal;
@@ -604,6 +605,8 @@ public class FaceService extends BiometricServiceBase {
                return false;
            }

            getFeature(userId, BiometricFaceConstants.FEATURE_REQUIRE_ATTENTION,
                    null /* receiver */, opPackageName);
            return FaceService.this.hasEnrolledBiometrics(userId);
        }

@@ -692,7 +695,20 @@ public class FaceService extends BiometricServiceBase {
                if (mDaemon != null) {
                    try {
                        OptionalBool result = mDaemon.getFeature(feature, faceId);
                        receiver.onFeatureGet(result.status == Status.OK, feature, result.value);
                        if (receiver != null) {
                            receiver.onFeatureGet(result.status == Status.OK,
                                    feature, result.value);
                        }

                        if (result.status == Status.OK
                                && feature == BiometricFaceConstants.FEATURE_REQUIRE_ATTENTION) {
                            final int settingsValue = result.value ? 1 : 0;
                            Slog.d(TAG, "Updating attention value for user: " + mCurrentUserId
                                    + " to value: " + settingsValue);
                            Settings.Secure.putIntForUser(getContext().getContentResolver(),
                                    Settings.Secure.FACE_UNLOCK_ATTENTION_REQUIRED,
                                    settingsValue, mCurrentUserId);
                        }
                    } catch (RemoteException e) {
                        Slog.e(getTag(), "Unable to getRequireAttention", e);
                    }