diff --git a/res/layout/face_remove_button.xml b/res/layout/face_remove_button.xml
index 98459f09422..a05fb85a85b 100644
--- a/res/layout/face_remove_button.xml
+++ b/res/layout/face_remove_button.xml
@@ -26,6 +26,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
- android:text="@string/security_settings_face_settings_remove_face_data"/>
+ android:text="@string/security_settings_face_settings_remove_face_model"/>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4cc5df4064e..b00cb00cf84 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -853,8 +853,6 @@
Always require confirmation
When using face unlock in apps, always require confirmation step
-
- Delete face data
Delete face model
@@ -866,9 +864,9 @@
Keep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.
- Delete face data?
+ Delete face model?
- The face data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.
+ Your face model will be permanently and securely deleted. After deletion, you will need your PIN, pattern, or password to unlock your phone or for authentication in apps.
Delete face model?
@@ -889,8 +887,8 @@
screen lock
- - %1$d fingerprint set up
- - %1$d fingerprints set up
+ - Fingerprint added
+ - %1$d fingerprints added
@@ -971,9 +969,13 @@
- Face & fingerprint unlock
+ Face & Fingerprint Unlock
- Face and fingerprint
+ Tap to set up
+
+ Face and fingerprints added
+
+ Face and fingerprint added
When you set up face unlock and fingerprint, your phone will ask for your fingerprint when you wear a mask or are in a dark area.
@@ -1464,43 +1466,42 @@
Turn off screen lock
- Remove device protection?
+ Delete screen lock?
Remove profile protection?
- "Device protection features will not work without your pattern."
+ "A pattern protects your phone if it\u2019s lost or stolen"
- "Device protection features will not work without your pattern.\n\nYour saved fingerprints will also be removed from this device and you won\'t be able to unlock your phone, authorize purchases, or sign in to apps with them."
+ "A pattern protects your phone if it\u2019s lost or stolen.\n\nThis also deletes the fingerprint model stored on your device. You won\u2019t be able to use your fingerprint for authentication in apps."
+
+ "A pattern protects your phone if it\u2019s lost or stolen.\n\nYour face model will also be permanently and securely deleted. You won\u2019t be able to use your face for authentication in apps."
+
+ "A pattern protects your phone if it\u2019s lost or stolen.\n\nThis deletes the fingerprint model stored on your device. Your face model will also be permanently and securely deleted. You won\u2019t be able to use your face or fingerprint for authentication in apps."
- "Device protection features will not work without your PIN."
+ "A PIN protects your phone if it\u2019s lost or stolen"
- "Device protection features will not work without your PIN.\n\nYour saved fingerprints will also be removed from this device and you won\'t be able to unlock your phone, authorize purchases, or sign in to apps with them."
+ "A PIN protects your phone if it\u2019s lost or stolen.\n\nThis also deletes the fingerprint model stored on your device. You won\u2019t be able to use your fingerprint for authentication in apps."
+
+ "A PIN protects your phone if it\u2019s lost or stolen.\n\nYour face model will also be permanently and securely deleted. You won\u2019t be able to use your face for authentication in apps."
+
+ "A PIN protects your phone if it\u2019s lost or stolen.\n\nThis deletes the fingerprint model stored on your device. Your face model will also be permanently and securely deleted. You won\u2019t be able to use your face or fingerprint for authentication in apps."
- "Device protection features will not work without your password."
+ "A password protects your phone if it\u2019s lost or stolen"
- "Device protection features will not work without your password.\n\nYour saved fingerprints will also be removed from this device and you won\'t be able to unlock your phone, authorize purchases, or sign in to apps with them."
+ "A password protects your phone if it\u2019s lost or stolen.\n\nThis also deletes the fingerprint model stored on your device. You won\u2019t be able to use your fingerprint for authentication in apps."
+
+ "A password protects your phone if it\u2019s lost or stolen.\n\nYour face model will also be permanently and securely deleted. You won\u2019t be able to use your face for authentication in apps."
+
+ "A password protects your phone if it\u2019s lost or stolen.\n\nThis deletes the fingerprint model stored on your device. Your face model will also be permanently and securely deleted. You won\u2019t be able to use your face or fingerprint for authentication in apps."
"Device protection features will not work without your screen lock."
- "Device protection features will not work without your screen lock.\n\nYour saved fingerprints will also be removed from this device and you won\'t be able to unlock your phone, authorize purchases, or sign in to apps with them."
-
-
- "Profile protection features will not work without your pattern."
-
- "Profile protection features will not work without your pattern.\n\nYour saved fingerprints will also be removed from this profile and you won\'t be able to unlock your profile, authorize purchases, or sign in to apps with them."
-
- "Profile protection features will not work without your PIN."
-
- "Profile protection features will not work without your PIN.\n\nYour saved fingerprints will also be removed from this profile and you won\'t be able to unlock your profile, authorize purchases, or sign in to apps with them."
-
- "Profile protection features will not work without your password."
-
- "Profile protection features will not work without your password.\n\nYour saved fingerprints will also be removed from this profile and you won\'t be able to unlock your profile, authorize purchases, or sign in to apps with them."
-
- "Profile protection features will not work without your screen lock."
-
- "Profile protection features will not work without your screen lock.\n\nYour saved fingerprints will also be removed from this profile and you won\'t be able to unlock your profile, authorize purchases, or sign in to apps with them."
+ "Device protection features will not work without your screen lock.\n\nThis also deletes the fingerprint model stored on your device. You won\u2019t be able to use your fingerprint for authentication in apps."
+
+ "Device protection features will not work without your screen lock.\n\nYour face model will also be permanently and securely deleted. You won\u2019t be able to use your face for authentication in apps."
+
+ "Device protection features will not work without your screen lock.\n\nThis deletes the fingerprint model stored on your device. Your face model will also be permanently and securely deleted. You won\u2019t be able to use your face or fingerprint for authentication in apps."
Yes, remove
diff --git a/res/xml/security_settings_face.xml b/res/xml/security_settings_face.xml
index 131f222685c..e1ac9b35b64 100644
--- a/res/xml/security_settings_face.xml
+++ b/res/xml/security_settings_face.xml
@@ -81,7 +81,7 @@
android:title="@string/security_settings_face_preference_title">
diff --git a/src/com/android/settings/biometrics/combination/CombinedBiometricStatusPreferenceController.java b/src/com/android/settings/biometrics/combination/CombinedBiometricStatusPreferenceController.java
index c3db1742755..6e989d8b5e3 100644
--- a/src/com/android/settings/biometrics/combination/CombinedBiometricStatusPreferenceController.java
+++ b/src/com/android/settings/biometrics/combination/CombinedBiometricStatusPreferenceController.java
@@ -16,6 +16,10 @@
package com.android.settings.biometrics.combination;
import android.content.Context;
+import android.hardware.face.FaceManager;
+import android.hardware.fingerprint.FingerprintManager;
+
+import androidx.annotation.Nullable;
import com.android.settings.R;
import com.android.settings.Settings;
@@ -30,6 +34,10 @@ public class CombinedBiometricStatusPreferenceController extends
BiometricStatusPreferenceController {
private static final String KEY_BIOMETRIC_SETTINGS = "biometric_settings";
+ @Nullable
+ FingerprintManager mFingerprintManager;
+ @Nullable
+ FaceManager mFaceManager;
public CombinedBiometricStatusPreferenceController(Context context) {
this(context, KEY_BIOMETRIC_SETTINGS);
@@ -37,6 +45,8 @@ public class CombinedBiometricStatusPreferenceController extends
public CombinedBiometricStatusPreferenceController(Context context, String key) {
super(context, key);
+ mFingerprintManager = Utils.getFingerprintManagerOrNull(context);
+ mFaceManager = Utils.getFaceManagerOrNull(context);
}
@Override
@@ -51,12 +61,34 @@ public class CombinedBiometricStatusPreferenceController extends
@Override
protected String getSummaryTextEnrolled() {
- return mContext.getString(R.string.security_settings_biometric_preference_summary);
+ // Note that this is currently never called (see the super class)
+ return mContext.getString(
+ R.string.security_settings_biometric_preference_summary_none_enrolled);
}
@Override
protected String getSummaryTextNoneEnrolled() {
- return mContext.getString(R.string.security_settings_biometric_preference_summary);
+ final int numFingerprintsEnrolled = mFingerprintManager != null ?
+ mFingerprintManager.getEnrolledFingerprints(getUserId()).size() : 0;
+ final boolean faceEnrolled = mFaceManager != null
+ && mFaceManager.hasEnrolledTemplates(getUserId());
+
+ if (faceEnrolled && numFingerprintsEnrolled > 1) {
+ return mContext.getString(
+ R.string.security_settings_biometric_preference_summary_both_fp_multiple);
+ } else if (faceEnrolled && numFingerprintsEnrolled == 1) {
+ return mContext.getString(
+ R.string.security_settings_biometric_preference_summary_both_fp_single);
+ } else if (faceEnrolled) {
+ return mContext.getString(R.string.security_settings_face_preference_summary);
+ } else if (numFingerprintsEnrolled > 0) {
+ return mContext.getResources().getQuantityString(
+ R.plurals.security_settings_fingerprint_preference_summary,
+ numFingerprintsEnrolled, numFingerprintsEnrolled);
+ } else {
+ return mContext.getString(
+ R.string.security_settings_biometric_preference_summary_none_enrolled);
+ }
}
@Override
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index b8e1165cffe..67fc7efc67c 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -975,31 +975,38 @@ public class ChooseLockGeneric extends SettingsActivity {
private int getResIdForFactoryResetProtectionWarningMessage() {
final boolean hasFingerprints;
+ final boolean hasFace;
if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()) {
hasFingerprints = mFingerprintManager.hasEnrolledFingerprints(mUserId);
} else {
hasFingerprints = false;
}
+
+ if (mFaceManager != null && mFaceManager.isHardwareDetected()) {
+ hasFace = mFaceManager.hasEnrolledTemplates(mUserId);
+ } else {
+ hasFace = false;
+ }
+
switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) {
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
- if (hasFingerprints && mIsManagedProfile) {
- return R.string
- .unlock_disable_frp_warning_content_pattern_fingerprint_profile;
- } else if (hasFingerprints && !mIsManagedProfile) {
+ if (hasFingerprints && hasFace) {
+ return R.string.unlock_disable_frp_warning_content_pattern_face_fingerprint;
+ } else if (hasFingerprints) {
return R.string.unlock_disable_frp_warning_content_pattern_fingerprint;
- } else if (mIsManagedProfile) {
- return R.string.unlock_disable_frp_warning_content_pattern_profile;
+ } else if (hasFace) {
+ return R.string.unlock_disable_frp_warning_content_pattern_face;
} else {
return R.string.unlock_disable_frp_warning_content_pattern;
}
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
- if (hasFingerprints && mIsManagedProfile) {
- return R.string.unlock_disable_frp_warning_content_pin_fingerprint_profile;
- } else if (hasFingerprints && !mIsManagedProfile) {
+ if (hasFingerprints && hasFace) {
+ return R.string.unlock_disable_frp_warning_content_pin_face_fingerprint;
+ } else if (hasFingerprints) {
return R.string.unlock_disable_frp_warning_content_pin_fingerprint;
- } else if (mIsManagedProfile) {
- return R.string.unlock_disable_frp_warning_content_pin_profile;
+ } else if (hasFace) {
+ return R.string.unlock_disable_frp_warning_content_pin_face;
} else {
return R.string.unlock_disable_frp_warning_content_pin;
}
@@ -1007,24 +1014,23 @@ public class ChooseLockGeneric extends SettingsActivity {
case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
case DevicePolicyManager.PASSWORD_QUALITY_MANAGED:
- if (hasFingerprints && mIsManagedProfile) {
+ if (hasFingerprints && hasFace) {
return R.string
- .unlock_disable_frp_warning_content_password_fingerprint_profile;
- } else if (hasFingerprints && !mIsManagedProfile) {
+ .unlock_disable_frp_warning_content_password_face_fingerprint;
+ } else if (hasFingerprints) {
return R.string.unlock_disable_frp_warning_content_password_fingerprint;
- } else if (mIsManagedProfile) {
- return R.string.unlock_disable_frp_warning_content_password_profile;
+ } else if (hasFace) {
+ return R.string.unlock_disable_frp_warning_content_password_face;
} else {
return R.string.unlock_disable_frp_warning_content_password;
}
default:
- if (hasFingerprints && mIsManagedProfile) {
- return R.string
- .unlock_disable_frp_warning_content_unknown_fingerprint_profile;
- } else if (hasFingerprints && !mIsManagedProfile) {
+ if (hasFingerprints && hasFace) {
+ return R.string.unlock_disable_frp_warning_content_unknown_face_fingerprint;
+ } else if (hasFingerprints) {
return R.string.unlock_disable_frp_warning_content_unknown_fingerprint;
- } else if (mIsManagedProfile) {
- return R.string.unlock_disable_frp_warning_content_unknown_profile;
+ } else if (hasFace) {
+ return R.string.unlock_disable_frp_warning_content_unknown_face;
} else {
return R.string.unlock_disable_frp_warning_content_unknown;
}