Update FRP warning to spec

Bug: 22672924
Change-Id: Ie275d5099553539707f86bf0e8cec5d5022ad227
This commit is contained in:
Adrian Roos
2015-07-24 11:30:14 -07:00
parent 36c7601409
commit 38c9b9eb5e
2 changed files with 44 additions and 24 deletions

View File

@@ -958,9 +958,6 @@
<!-- Summary specifying that this is the current screen lock setting [CHAR LIMIT=45] --> <!-- Summary specifying that this is the current screen lock setting [CHAR LIMIT=45] -->
<string name="current_screen_lock">Current screen lock</string> <string name="current_screen_lock">Current screen lock</string>
<!-- Content of warning dialog about disabling device protection features when user is switching from a secure unlock method to an insecure one. [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content">Device protection features will no longer work.</string>
<!-- Summary for preference that has been disabled by because of the DevicePolicyAdmin, or because device encryption is enabled, or because there are credentials in the credential storage [CHAR LIMIT=50] --> <!-- Summary for preference that has been disabled by because of the DevicePolicyAdmin, or because device encryption is enabled, or because there are credentials in the credential storage [CHAR LIMIT=50] -->
<string name="unlock_set_unlock_disabled_summary">Disabled by administrator, encryption policy, or credential storage</string> <string name="unlock_set_unlock_disabled_summary">Disabled by administrator, encryption policy, or credential storage</string>
@@ -983,14 +980,28 @@
<!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] --> <!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] -->
<string name="unlock_disable_lock_title">Turn off screen lock</string> <string name="unlock_disable_lock_title">Turn off screen lock</string>
<!-- Summary shown under unlock_disable_lock_title when pattern is in use and can be removed [CHAR LIMIT=45] --> <!-- Title of the dialog shown when the user removes the device lock [CHAR LIMIT=NONE] -->
<string name="unlock_disable_lock_pattern_summary">Remove unlock pattern</string> <string name="unlock_disable_frp_warning_title">Remove device protection?</string>
<!-- Summary shown under unlock_disable_lock_title when PIN is in use and can be removed [CHAR LIMIT=45]-->
<string name="unlock_disable_lock_pin_summary">Remove unlock PIN</string> <!-- Content of the dialog shown when the user removes the device lock pattern [CHAR LIMIT=NONE] -->
<!-- Summary shown under unlock_disable_lock_title when password is in use and can be removed [CHAR LIMIT=45]--> <string name="unlock_disable_frp_warning_content_pattern">"Device protection features will not work without your pattern."</string>
<string name="unlock_disable_lock_password_summary">Remove unlock password</string> <!-- Content of the dialog shown when the user removes the device lock pattern and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
<!-- Summary shown under unlock_disable_lock_title when an unknown secure unlocking method is in use and can be removed [CHAR LIMIT=45]--> <string name="unlock_disable_frp_warning_content_pattern_fingerprint">"Device protection features will not work without your pattern.<xliff:g id="empty_line">\n\n</xliff:g>Your 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."</string>
<string name="unlock_disable_lock_unknown_summary">Remove screen lock</string> <!-- Content of the dialog shown when the user removes the device lock PIN [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_pin">"Device protection features will not work without your PIN."</string>
<!-- Content of the dialog shown when the user removes the device lock PIN and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_pin_fingerprint">"Device protection features will not work without your PIN.<xliff:g id="empty_line">\n\n</xliff:g>Your 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."</string>
<!-- Content of the dialog shown when the user removes the device lock password [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_password">"Device protection features will not work without your password."</string>
<!-- Content of the dialog shown when the user removes the device lock password and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_password_fingerprint">"Device protection features will not work without your password.<xliff:g id="empty_line">\n\n</xliff:g>Your 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."</string>
<!-- Content of the dialog shown when the user removes the device lock of unknown type [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_unknown">"Device protection features will not work without your screen lock."</string>
<!-- Content of the dialog shown when the user removes the device lock of unknown type and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
<string name="unlock_disable_frp_warning_content_unknown_fingerprint">"Device protection features will not work without your screen lock.<xliff:g id="empty_line">\n\n</xliff:g>Your 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."</string>
<!-- Affirmative action of the dialog shown when the user removes the device lock [CHAR LIMIT=25] -->
<string name="unlock_disable_frp_warning_ok">Yes, remove</string>
<!-- Title shown on security settings to allow the user to change their lockscreen pattern [CHAR LIMIT=22] --> <!-- Title shown on security settings to allow the user to change their lockscreen pattern [CHAR LIMIT=22] -->
<string name="unlock_change_lock_pattern_title">Change unlock pattern</string> <string name="unlock_change_lock_pattern_title">Change unlock pattern</string>

View File

@@ -500,19 +500,28 @@ public class ChooseLockGeneric extends SettingsActivity {
return R.string.help_url_choose_lockscreen; return R.string.help_url_choose_lockscreen;
} }
private int getResIdForFactoryResetProtectionWarningTitle() { private int getResIdForFactoryResetProtectionWarningMessage() {
boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints();
switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId())) { switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId())) {
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
return R.string.unlock_disable_lock_pattern_summary; return hasFingerprints
? R.string.unlock_disable_frp_warning_content_pattern_fingerprint
: R.string.unlock_disable_frp_warning_content_pattern;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
return R.string.unlock_disable_lock_pin_summary; return hasFingerprints
? R.string.unlock_disable_frp_warning_content_pin_fingerprint
: R.string.unlock_disable_frp_warning_content_pin;
case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC:
case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX: case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
return R.string.unlock_disable_lock_password_summary; return hasFingerprints
? R.string.unlock_disable_frp_warning_content_password_fingerprint
: R.string.unlock_disable_frp_warning_content_password;
default: default:
return R.string.unlock_disable_lock_unknown_summary; return hasFingerprints
? R.string.unlock_disable_frp_warning_content_unknown_fingerprint
: R.string.unlock_disable_frp_warning_content_unknown;
} }
} }
@@ -547,23 +556,23 @@ public class ChooseLockGeneric extends SettingsActivity {
} }
private void showFactoryResetProtectionWarningDialog(String unlockMethodToSet) { private void showFactoryResetProtectionWarningDialog(String unlockMethodToSet) {
int title = getResIdForFactoryResetProtectionWarningTitle(); int message = getResIdForFactoryResetProtectionWarningMessage();
FactoryResetProtectionWarningDialog dialog = FactoryResetProtectionWarningDialog dialog =
FactoryResetProtectionWarningDialog.newInstance(title, unlockMethodToSet); FactoryResetProtectionWarningDialog.newInstance(message, unlockMethodToSet);
dialog.show(getChildFragmentManager(), TAG_FRP_WARNING_DIALOG); dialog.show(getChildFragmentManager(), TAG_FRP_WARNING_DIALOG);
} }
public static class FactoryResetProtectionWarningDialog extends DialogFragment { public static class FactoryResetProtectionWarningDialog extends DialogFragment {
private static final String ARG_TITLE_RES = "titleRes"; private static final String ARG_MESSAGE_RES = "messageRes";
private static final String ARG_UNLOCK_METHOD_TO_SET = "unlockMethodToSet"; private static final String ARG_UNLOCK_METHOD_TO_SET = "unlockMethodToSet";
public static FactoryResetProtectionWarningDialog newInstance(int title, public static FactoryResetProtectionWarningDialog newInstance(int messageRes,
String unlockMethodToSet) { String unlockMethodToSet) {
FactoryResetProtectionWarningDialog frag = FactoryResetProtectionWarningDialog frag =
new FactoryResetProtectionWarningDialog(); new FactoryResetProtectionWarningDialog();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt(ARG_TITLE_RES, title); args.putInt(ARG_MESSAGE_RES, messageRes);
args.putString(ARG_UNLOCK_METHOD_TO_SET, unlockMethodToSet); args.putString(ARG_UNLOCK_METHOD_TO_SET, unlockMethodToSet);
frag.setArguments(args); frag.setArguments(args);
return frag; return frag;
@@ -582,9 +591,9 @@ public class ChooseLockGeneric extends SettingsActivity {
final Bundle args = getArguments(); final Bundle args = getArguments();
return new AlertDialog.Builder(getActivity()) return new AlertDialog.Builder(getActivity())
.setTitle(args.getInt(ARG_TITLE_RES)) .setTitle(R.string.unlock_disable_frp_warning_title)
.setMessage(R.string.unlock_disable_frp_warning_content) .setMessage(args.getInt(ARG_MESSAGE_RES))
.setPositiveButton(R.string.okay, .setPositiveButton(R.string.unlock_disable_frp_warning_ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {