Merge "Fix Faceauth when camera privacy is enabled." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
11e68c8719
@@ -326,7 +326,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
private final Executor mBackgroundExecutor;
|
private final Executor mBackgroundExecutor;
|
||||||
private SensorPrivacyManager mSensorPrivacyManager;
|
private SensorPrivacyManager mSensorPrivacyManager;
|
||||||
private int mFaceAuthUserId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short delay before restarting fingerprint authentication after a successful try. This should
|
* 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;
|
boolean cameraPrivacyEnabled = false;
|
||||||
if (mSensorPrivacyManager != null) {
|
if (mSensorPrivacyManager != null) {
|
||||||
cameraPrivacyEnabled = mSensorPrivacyManager
|
cameraPrivacyEnabled = mSensorPrivacyManager
|
||||||
.isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA,
|
.isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
|
||||||
mFaceAuthUserId);
|
SensorPrivacyManager.Sensors.CAMERA);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msgId == FaceManager.FACE_ERROR_CANCELED
|
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
|
// This would need to be updated for multi-sensor devices
|
||||||
final boolean supportsFaceDetection = !mFaceSensorProperties.isEmpty()
|
final boolean supportsFaceDetection = !mFaceSensorProperties.isEmpty()
|
||||||
&& mFaceSensorProperties.get(0).supportsFaceDetection;
|
&& mFaceSensorProperties.get(0).supportsFaceDetection;
|
||||||
mFaceAuthUserId = userId;
|
|
||||||
if (isEncryptedOrLockdown(userId) && supportsFaceDetection) {
|
if (isEncryptedOrLockdown(userId) && supportsFaceDetection) {
|
||||||
mFaceManager.detectFace(mFaceCancelSignal, mFaceDetectionCallback, userId);
|
mFaceManager.detectFace(mFaceCancelSignal, mFaceDetectionCallback, userId);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession>
|
|||||||
try {
|
try {
|
||||||
if (mSensorPrivacyManager != null
|
if (mSensorPrivacyManager != null
|
||||||
&& mSensorPrivacyManager
|
&& mSensorPrivacyManager
|
||||||
.isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA,
|
.isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
|
||||||
getTargetUserId())) {
|
SensorPrivacyManager.Sensors.CAMERA)) {
|
||||||
onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
|
onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
|
||||||
0 /* vendorCode */);
|
0 /* vendorCode */);
|
||||||
mCallback.onClientFinished(this, false /* success */);
|
mCallback.onClientFinished(this, false /* success */);
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ public class FaceDetectClient extends AcquisitionClient<AidlSession> implements
|
|||||||
protected void startHalOperation() {
|
protected void startHalOperation() {
|
||||||
if (mSensorPrivacyManager != null
|
if (mSensorPrivacyManager != null
|
||||||
&& mSensorPrivacyManager
|
&& mSensorPrivacyManager
|
||||||
.isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA, getTargetUserId())) {
|
.isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
|
||||||
|
SensorPrivacyManager.Sensors.CAMERA)) {
|
||||||
onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
|
onError(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
|
||||||
mCallback.onClientFinished(this, false /* success */);
|
mCallback.onClientFinished(this, false /* success */);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> {
|
|||||||
|
|
||||||
if (mSensorPrivacyManager != null
|
if (mSensorPrivacyManager != null
|
||||||
&& mSensorPrivacyManager
|
&& mSensorPrivacyManager
|
||||||
.isSensorPrivacyEnabled(SensorPrivacyManager.Sensors.CAMERA, getTargetUserId())) {
|
.isSensorPrivacyEnabled(SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
|
||||||
|
SensorPrivacyManager.Sensors.CAMERA)) {
|
||||||
onError(BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
|
onError(BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE, 0 /* vendorCode */);
|
||||||
mCallback.onClientFinished(this, false /* success */);
|
mCallback.onClientFinished(this, false /* success */);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user