Merge "Update Settings to match Framework"

This commit is contained in:
TreeHugger Robot
2018-08-31 01:21:07 +00:00
committed by Android (Google) Code Review
5 changed files with 8 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ public class FaceStatusPreferenceController extends BiometricStatusPreferenceCon
@Override @Override
protected boolean hasEnrolledBiometrics() { protected boolean hasEnrolledBiometrics() {
return mFaceManager.hasEnrolledFaces(mUserId); return mFaceManager.hasEnrolledTemplates(mUserId);
} }
@Override @Override

View File

@@ -813,7 +813,7 @@ public class ChooseLockGeneric extends SettingsActivity {
// TODO: figure out how to eliminate duplicated code. It's a bit hard due to the async-ness // TODO: figure out how to eliminate duplicated code. It's a bit hard due to the async-ness
private void removeAllFaceForUserAndFinish(final int userId, RemovalTracker tracker) { private void removeAllFaceForUserAndFinish(final int userId, RemovalTracker tracker) {
if (mFaceManager != null && mFaceManager.isHardwareDetected()) { if (mFaceManager != null && mFaceManager.isHardwareDetected()) {
if (mFaceManager.hasEnrolledFaces(userId)) { if (mFaceManager.hasEnrolledTemplates(userId)) {
mFaceManager.setActiveUser(userId); mFaceManager.setActiveUser(userId);
Face face = new Face(null, 0, 0); Face face = new Face(null, 0, 0);
mFaceManager.remove(face, userId, mFaceManager.remove(face, userId,

View File

@@ -115,7 +115,7 @@ final class SetNewPasswordController {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE) if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)
&& mFaceManager != null && mFaceManager != null
&& mFaceManager.isHardwareDetected() && mFaceManager.isHardwareDetected()
&& !mFaceManager.hasEnrolledFaces(mTargetUserId) && !mFaceManager.hasEnrolledTemplates(mTargetUserId)
&& !isFaceDisabledByAdmin()) { && !isFaceDisabledByAdmin()) {
extras = getFaceChooseLockExtras(); extras = getFaceChooseLockExtras();
} else if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) } else if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)

View File

@@ -121,7 +121,7 @@ public class FaceStatusPreferenceControllerTest {
when(mFaceManager.isHardwareDetected()).thenReturn(true); when(mFaceManager.isHardwareDetected()).thenReturn(true);
when(mFaceManager.getEnrolledFaces(anyInt())) when(mFaceManager.getEnrolledFaces(anyInt()))
.thenReturn(Collections.singletonList(mock(Face.class))); .thenReturn(Collections.singletonList(mock(Face.class)));
when(mFaceManager.hasEnrolledFaces(anyInt())) when(mFaceManager.hasEnrolledTemplates(anyInt()))
.thenReturn(true); .thenReturn(true);
mController.updateState(mPreference); mController.updateState(mPreference);

View File

@@ -113,7 +113,7 @@ public final class SetNewPasswordControllerTest {
// GIVEN the device supports face. // GIVEN the device supports face.
when(mFaceManager.isHardwareDetected()).thenReturn(true); when(mFaceManager.isHardwareDetected()).thenReturn(true);
// GIVEN there are no enrolled face. // GIVEN there are no enrolled face.
when(mFaceManager.hasEnrolledFaces(CURRENT_USER_ID)).thenReturn(false); when(mFaceManager.hasEnrolledTemplates(CURRENT_USER_ID)).thenReturn(false);
// GIVEN DPC does not disallow face for keyguard usage. // GIVEN DPC does not disallow face for keyguard usage.
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class))) when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class)))
.thenReturn(0); .thenReturn(0);
@@ -180,7 +180,7 @@ public final class SetNewPasswordControllerTest {
// GIVEN the device does NOT support face. // GIVEN the device does NOT support face.
when(mFaceManager.isHardwareDetected()).thenReturn(false); when(mFaceManager.isHardwareDetected()).thenReturn(false);
// GIVEN there are no enrolled face. // GIVEN there are no enrolled face.
when(mFaceManager.hasEnrolledFaces(CURRENT_USER_ID)).thenReturn(false); when(mFaceManager.hasEnrolledTemplates(CURRENT_USER_ID)).thenReturn(false);
// GIVEN DPC does not disallow face for keyguard usage. // GIVEN DPC does not disallow face for keyguard usage.
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class))) when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class)))
.thenReturn(0); .thenReturn(0);
@@ -218,7 +218,7 @@ public final class SetNewPasswordControllerTest {
// GIVEN the device supports face. // GIVEN the device supports face.
when(mFaceManager.isHardwareDetected()).thenReturn(true); when(mFaceManager.isHardwareDetected()).thenReturn(true);
// GIVEN there are no enrolled face. // GIVEN there are no enrolled face.
when(mFaceManager.hasEnrolledFaces(CURRENT_USER_ID)).thenReturn(true); when(mFaceManager.hasEnrolledTemplates(CURRENT_USER_ID)).thenReturn(true);
// GIVEN DPC does not disallow face for keyguard usage. // GIVEN DPC does not disallow face for keyguard usage.
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class))) when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class)))
.thenReturn(0); .thenReturn(0);
@@ -256,7 +256,7 @@ public final class SetNewPasswordControllerTest {
// GIVEN the device supports face. // GIVEN the device supports face.
when(mFaceManager.isHardwareDetected()).thenReturn(true); when(mFaceManager.isHardwareDetected()).thenReturn(true);
// GIVEN there is an enrolled face. // GIVEN there is an enrolled face.
when(mFaceManager.hasEnrolledFaces(CURRENT_USER_ID)).thenReturn(true); when(mFaceManager.hasEnrolledTemplates(CURRENT_USER_ID)).thenReturn(true);
// GIVEN DPC disallows face for keyguard usage. // GIVEN DPC disallows face for keyguard usage.
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class))) when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(ComponentName.class)))
.thenReturn(DevicePolicyManager.KEYGUARD_DISABLE_FACE); .thenReturn(DevicePolicyManager.KEYGUARD_DISABLE_FACE);