From 47973b88acfbb93ae4471bfc108859f26f50803b Mon Sep 17 00:00:00 2001 From: Eran Messeri Date: Thu, 14 Mar 2024 15:15:53 +0000 Subject: [PATCH] Auth-bound keys usability: Update strings Update the strings for the warning shown to the user when they are about to remove their screen lock and there are authentication-bound keys that would be invalidated. These strings are provided by Android UXW. Additionally, apply the new string to all types of device lock screen: Pattern, password and unknown. Bug: 302109605 Test: Manual, flashed a device and added different types of screen lock. Change-Id: Ida6f5f16c5aa1671f3f2c1358160b8173a1d1407 --- res/values/strings.xml | 17 ++--- .../settings/password/ChooseLockGeneric.java | 66 ++++++++++++++----- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index dd51f522b1f..732bbca5b3b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1542,20 +1542,12 @@ "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." "A PIN protects your phone if it\u2019s lost or stolen" - - "You will lose saved data like your PIN.\n\nCards set up for tap to pay will be removed.\n\nWallets and other apps that require device unlock may not work properly." "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." - - "You will lose saved data like your PIN and fingerprint model.\n\nCards set up for tap to pay will be removed.\n\nWallets and other apps that require device unlock may not work properly." "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." - - "You will lose saved data like your PIN and face model.\n\nCards set up for tap to pay will be removed.\n\nWallets and other apps that require device unlock may not work properly." "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." - - "You will lose saved data like your PIN, face and fingerprint models.\n\nCards set up for tap to pay will be removed.\n\nWallets and other apps that require device unlock may not work properly." "A password protects your phone if it\u2019s lost or stolen" @@ -1572,6 +1564,15 @@ "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." + + "Your screen lock will be removed.\n\nTap to pay won\u2019t be available.\n\nWallet, payment, and other apps that require authentication may not work properly." + + "Your screen lock and Fingerprint Unlock will be removed.\n\nTap to pay won\u2019t be available.\n\nWallet, payment, and other apps that require authentication may not work properly." + + "Your screen lock and Face Unlock will be removed.\n\nTap to pay won\u2019t be available.\n\nWallet, payment, and other apps that require authentication may not work properly." + + "Your screen lock and Face & Fingerprint Unlock will be removed.\n\nTap to pay won\u2019t be available.\n\nWallet, payment, and other apps that require authentication may not work properly." + Delete diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java index 178c3872c21..4aa751bdbb2 100644 --- a/src/com/android/settings/password/ChooseLockGeneric.java +++ b/src/com/android/settings/password/ChooseLockGeneric.java @@ -927,34 +927,45 @@ public class ChooseLockGeneric extends SettingsActivity { switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) { case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: if (hasFingerprints && hasFace) { - return R.string.unlock_disable_frp_warning_content_pattern_face_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_pattern_face_fingerprint; } else if (hasFingerprints) { - return R.string.unlock_disable_frp_warning_content_pattern_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_pattern_fingerprint; } else if (hasFace) { - return R.string.unlock_disable_frp_warning_content_pattern_face; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_authbound_keys + : R.string.unlock_disable_frp_warning_content_pattern_face; } else { - return R.string.unlock_disable_frp_warning_content_pattern; + return hasAppsWithAuthBoundKeys + ? R.string.unlock_disable_frp_warning_content_authbound_keys + : R.string.unlock_disable_frp_warning_content_pattern; } case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX: if (hasFingerprints && hasFace) { return hasAppsWithAuthBoundKeys ? - R.string.unlock_disable_frp_warning_content_pin_face_fingerprint_authbound_keys + R.string.unlock_disable_frp_warning_content_face_fingerprint_authbound_keys : R.string.unlock_disable_frp_warning_content_pin_face_fingerprint; } else if (hasFingerprints) { return hasAppsWithAuthBoundKeys ? - R.string.unlock_disable_frp_warning_content_pin_fingerprint_authbound_keys + R.string.unlock_disable_frp_warning_content_fingerprint_authbound_keys : R.string.unlock_disable_frp_warning_content_pin_fingerprint; } else if (hasFace) { return hasAppsWithAuthBoundKeys ? - R.string.unlock_disable_frp_warning_content_pin_face_authbound_keys + R.string.unlock_disable_frp_warning_content_face_authbound_keys : R.string.unlock_disable_frp_warning_content_pin_face; } else { return hasAppsWithAuthBoundKeys - ? R.string.unlock_disable_frp_warning_content_pin_authbound_keys + ? R.string.unlock_disable_frp_warning_content_authbound_keys : R.string.unlock_disable_frp_warning_content_pin; } case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: @@ -962,24 +973,45 @@ public class ChooseLockGeneric extends SettingsActivity { case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX: case DevicePolicyManager.PASSWORD_QUALITY_MANAGED: if (hasFingerprints && hasFace) { - return R.string - .unlock_disable_frp_warning_content_password_face_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_password_face_fingerprint; } else if (hasFingerprints) { - return R.string.unlock_disable_frp_warning_content_password_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_password_fingerprint; } else if (hasFace) { - return R.string.unlock_disable_frp_warning_content_password_face; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_authbound_keys + : R.string.unlock_disable_frp_warning_content_password_face; } else { - return R.string.unlock_disable_frp_warning_content_password; + return hasAppsWithAuthBoundKeys + ? R.string.unlock_disable_frp_warning_content_authbound_keys + : R.string.unlock_disable_frp_warning_content_password; } default: if (hasFingerprints && hasFace) { - return R.string.unlock_disable_frp_warning_content_unknown_face_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_unknown_face_fingerprint; } else if (hasFingerprints) { - return R.string.unlock_disable_frp_warning_content_unknown_fingerprint; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_fingerprint_authbound_keys + : R.string.unlock_disable_frp_warning_content_unknown_fingerprint; } else if (hasFace) { - return R.string.unlock_disable_frp_warning_content_unknown_face; + return hasAppsWithAuthBoundKeys + ? + R.string.unlock_disable_frp_warning_content_face_authbound_keys + : R.string.unlock_disable_frp_warning_content_unknown_face; } else { - return R.string.unlock_disable_frp_warning_content_unknown; + return hasAppsWithAuthBoundKeys + ? R.string.unlock_disable_frp_warning_content_authbound_keys + : R.string.unlock_disable_frp_warning_content_unknown; } } }