[Fingerprint] Change message in encryption

Change the message for encryption interstitial when enrollin
fingerprint, to make it clear that fingerprint unlock is still used,
just that the backup unlock PIN / password / pattern will be needed
to start the device.

Bug: 22559146
Change-Id: Ia134e0d9b118151833a9118ff44667dcc9122185
This commit is contained in:
Maurice Lam
2015-07-20 14:49:29 -07:00
parent 4dd637a07e
commit c0e7879684
5 changed files with 25 additions and 3 deletions

View File

@@ -6389,6 +6389,13 @@
\n\nThis helps protect data on lost or stolen devices. \n\nThis helps protect data on lost or stolen devices.
</string> </string>
<!-- Message shown on encryption interstitial to ask the user whether or not they want to use a PIN to encrypt the device while setting up fingerprint unlock. [CHAR LIMIT=NONE] -->
<string name="encryption_interstitial_message_pin_for_fingerprint">In addition to using your fingerprint to unlock your device, you can further protect this device by requiring your PIN before it starts up. Until the device starts up, it can\u2019t receive calls, messages, or notifications, including alarms.\n\nThis helps protect data on lost or stolen devices.</string>
<!-- Message shown on encryption interstitial to ask the user whether or not they want to use a pattern to encrypt the device while setting up fingerprint unlock. [CHAR LIMIT=NONE] -->
<string name="encryption_interstitial_message_pattern_for_fingerprint">In addition to using your fingerprint to unlock your device, you can further protect this device by requiring your pattern before it starts up. Until the device starts up, it can\u2019t receive calls, messages, or notifications, including alarms.\n\nThis helps protect data on lost or stolen devices.</string>
<!-- Message shown on encryption interstitial to ask the user whether or not they want to use a password to encrypt the device while setting up fingerprint unlock. [CHAR LIMIT=NONE] -->
<string name="encryption_interstitial_message_password_for_fingerprint">In addition to using your fingerprint to unlock your device, you can further protect this device by requiring your password before it starts up. Until the device starts up, it can\u2019t receive calls, messages, or notifications, including alarms.\n\nThis helps protect data on lost or stolen devices.</string>
<!-- Radio button text that require a PIN to start device [CHAR LIMIT=NONE] --> <!-- Radio button text that require a PIN to start device [CHAR LIMIT=NONE] -->
<string name="encrypt_require_pin">Require PIN to start device</string> <string name="encrypt_require_pin">Require PIN to start device</string>
<!-- Radio button text that require a pattern to start device [CHAR LIMIT=NONE] --> <!-- Radio button text that require a pattern to start device [CHAR LIMIT=NONE] -->

View File

@@ -97,6 +97,7 @@ public class ChooseLockGeneric extends SettingsActivity {
private int mEncryptionRequestQuality; private int mEncryptionRequestQuality;
private boolean mEncryptionRequestDisabled; private boolean mEncryptionRequestDisabled;
private boolean mRequirePassword; private boolean mRequirePassword;
private boolean mForFingerprint = false;
private String mUserPassword; private String mUserPassword;
private LockPatternUtils mLockPatternUtils; private LockPatternUtils mLockPatternUtils;
private FingerprintManager mFingerprintManager; private FingerprintManager mFingerprintManager;
@@ -140,6 +141,8 @@ public class ChooseLockGeneric extends SettingsActivity {
ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false); ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false);
mChallenge = getActivity().getIntent().getLongExtra( mChallenge = getActivity().getIntent().getLongExtra(
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, 0); ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, 0);
mForFingerprint = getActivity().getIntent().getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, false);
if (savedInstanceState != null) { if (savedInstanceState != null) {
mPasswordConfirmed = savedInstanceState.getBoolean(PASSWORD_CONFIRMED); mPasswordConfirmed = savedInstanceState.getBoolean(PASSWORD_CONFIRMED);
@@ -201,6 +204,8 @@ public class ChooseLockGeneric extends SettingsActivity {
final boolean accEn = AccessibilityManager.getInstance(context).isEnabled(); final boolean accEn = AccessibilityManager.getInstance(context).isEnabled();
final boolean required = mLockPatternUtils.isCredentialRequiredToDecrypt(!accEn); final boolean required = mLockPatternUtils.isCredentialRequiredToDecrypt(!accEn);
Intent intent = getEncryptionInterstitialIntent(context, quality, required); Intent intent = getEncryptionInterstitialIntent(context, quality, required);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT,
mForFingerprint);
startActivityForResult(intent, ENABLE_ENCRYPTION_REQUEST); startActivityForResult(intent, ENABLE_ENCRYPTION_REQUEST);
} else { } else {
mRequirePassword = false; // device encryption not enabled or not device owner. mRequirePassword = false; // device encryption not enabled or not device owner.

View File

@@ -32,6 +32,7 @@ public final class ChooseLockSettingsHelper {
public static final String EXTRA_KEY_HAS_CHALLENGE = "has_challenge"; public static final String EXTRA_KEY_HAS_CHALLENGE = "has_challenge";
public static final String EXTRA_KEY_CHALLENGE = "challenge"; public static final String EXTRA_KEY_CHALLENGE = "challenge";
public static final String EXTRA_KEY_CHALLENGE_TOKEN = "hw_auth_token"; public static final String EXTRA_KEY_CHALLENGE_TOKEN = "hw_auth_token";
public static final String EXTRA_KEY_FOR_FINGERPRINT = "for_fingerprint";
private LockPatternUtils mLockPatternUtils; private LockPatternUtils mLockPatternUtils;

View File

@@ -95,24 +95,32 @@ public class EncryptionInterstitial extends SettingsActivity {
(RadioButton) view.findViewById(R.id.encrypt_dont_require_password); (RadioButton) view.findViewById(R.id.encrypt_dont_require_password);
mEncryptionMessage = mEncryptionMessage =
(TextView) view.findViewById(R.id.encryption_message); (TextView) view.findViewById(R.id.encryption_message);
boolean forFingerprint = getActivity().getIntent().getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, false);
int quality = getActivity().getIntent().getIntExtra(EXTRA_PASSWORD_QUALITY, 0); int quality = getActivity().getIntent().getIntExtra(EXTRA_PASSWORD_QUALITY, 0);
final int msgId; final int msgId;
final int enableId; final int enableId;
final int disableId; final int disableId;
switch (quality) { switch (quality) {
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
msgId = R.string.encryption_interstitial_message_pattern; msgId = forFingerprint ?
R.string.encryption_interstitial_message_pattern_for_fingerprint :
R.string.encryption_interstitial_message_pattern;
enableId = R.string.encrypt_require_pattern; enableId = R.string.encrypt_require_pattern;
disableId = R.string.encrypt_dont_require_pattern; disableId = R.string.encrypt_dont_require_pattern;
break; break;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
msgId = R.string.encryption_interstitial_message_pin; msgId = forFingerprint ?
R.string.encryption_interstitial_message_pin_for_fingerprint :
R.string.encryption_interstitial_message_pin;
enableId = R.string.encrypt_require_pin; enableId = R.string.encrypt_require_pin;
disableId = R.string.encrypt_dont_require_pin; disableId = R.string.encrypt_dont_require_pin;
break; break;
default: default:
msgId = R.string.encryption_interstitial_message_password; msgId = forFingerprint ?
R.string.encryption_interstitial_message_password_for_fingerprint :
R.string.encryption_interstitial_message_password;
enableId = R.string.encrypt_require_password; enableId = R.string.encrypt_require_password;
disableId = R.string.encrypt_dont_require_password; disableId = R.string.encrypt_dont_require_password;
break; break;

View File

@@ -64,6 +64,7 @@ public class FingerprintEnrollOnboard extends FingerprintEnrollBase {
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_DISABLED_PREFS, true); intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_DISABLED_PREFS, true);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true); intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge); intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, true);
startActivityForResult(intent, CHOOSE_LOCK_GENERIC_REQUEST); startActivityForResult(intent, CHOOSE_LOCK_GENERIC_REQUEST);
} }