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

Commit 8b0c5516 authored by Joshua Mccloskey's avatar Joshua Mccloskey
Browse files

Fix Faceauth when camera privacy is enabled.

Test: verified manually that keyguard indicates the privacy sensor
is enabled when the user has a face enrolled & camera privacy enabled.
Fixes: 220996930

Change-Id: I09b18b515a7aa8216d71a069cb42f5bd30006b64
parent b6e9b03b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -325,7 +325,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    private final Executor mBackgroundExecutor;
    private SensorPrivacyManager mSensorPrivacyManager;
    private int mFaceAuthUserId;

    /**
     * Short delay before restarting fingerprint authentication after a successful try. This should
@@ -1034,8 +1033,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        boolean cameraPrivacyEnabled = false;
        if (mSensorPrivacyManager != null) {
            cameraPrivacyEnabled = mSensorPrivacyManager
                    .isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA,
                    mFaceAuthUserId);
                    .isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
                    SensorPrivacyManager.Sensors.CAMERA);
        }

        if (msgId == FaceManager.FACE_ERROR_CANCELED
@@ -2603,7 +2602,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            // This would need to be updated for multi-sensor devices
            final boolean supportsFaceDetection = !mFaceSensorProperties.isEmpty()
                    && mFaceSensorProperties.get(0).supportsFaceDetection;
            mFaceAuthUserId = userId;
            if (isEncryptedOrLockdown(userId) && supportsFaceDetection) {
                mFaceManager.detectFace(mFaceCancelSignal, mFaceDetectionCallback, userId);
            } else {
+2 −2
Original line number Diff line number Diff line
@@ -136,8 +136,8 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession>
        try {
            if (mSensorPrivacyManager != null
                    && mSensorPrivacyManager
                    .isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA,
                    getTargetUserId())) {
                    .isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
                    SensorPrivacyManager.Sensors.CAMERA)) {
                onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
                        0 /* vendorCode */);
                mCallback.onClientFinished(this, false /* success */);
+2 −1
Original line number Diff line number Diff line
@@ -96,7 +96,8 @@ public class FaceDetectClient extends AcquisitionClient<AidlSession> implements
    protected void startHalOperation() {
        if (mSensorPrivacyManager != null
                && mSensorPrivacyManager
                .isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA, getTargetUserId())) {
                .isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
                    SensorPrivacyManager.Sensors.CAMERA)) {
            onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
            mCallback.onClientFinished(this, false /* success */);
            return;
+2 −1
Original line number Diff line number Diff line
@@ -109,7 +109,8 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> {

        if (mSensorPrivacyManager != null
                && mSensorPrivacyManager
                .isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA, getTargetUserId())) {
                .isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
                SensorPrivacyManager.Sensors.CAMERA)) {
            onError(BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
            mCallback.onClientFinished(this, false /* success */);
            return;