Merge "Fix Faceauth when camera privacy is enabled." into tm-dev am: 11e68c8719
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17189185 Change-Id: Id4785799c4d141ef940daca184bff363cf04aea7
This commit is contained in:
@@ -326,7 +326,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
|
||||
@@ -1030,8 +1029,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
|
||||
@@ -2599,7 +2598,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 {
|
||||
|
||||
@@ -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 */);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user