User to confirm credentials if an accessibility service changes encryption.

When an accessibility service is enabled we are not using the user secure
lock when encrypting the data. If the latter is already used for encryption
we are decreasing the encryption level and therefore shall challenge the
user with their secure lock.

bug:17881324

Change-Id: If8905c05e20bc6bb6a6415e501871e5ad83f3d86
This commit is contained in:
Svetoslav
2014-10-16 14:44:25 -07:00
parent 4909c412fa
commit 3ea423ae0f
8 changed files with 103 additions and 15 deletions

View File

@@ -79,7 +79,7 @@ public final class ChooseLockSettingsHelper {
case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
// TODO: update UI layout for ConfirmPassword to show message and details
launched = confirmPassword(request, returnCredentials);
launched = confirmPassword(request, message, returnCredentials);
break;
}
return launched;
@@ -116,13 +116,17 @@ public final class ChooseLockSettingsHelper {
/**
* Launch screen to confirm the existing lock password.
* @param message shown in header of ConfirmLockPassword if not null
* @param returnCredentials if true, put credentials into intent.
* @see #onActivityResult(int, int, android.content.Intent)
* @return true if we launched an activity to confirm password
*/
private boolean confirmPassword(int request, boolean returnCredentials) {
private boolean confirmPassword(int request, CharSequence message,
boolean returnCredentials) {
if (!mLockPatternUtils.isLockPasswordEnabled()) return false;
final Intent intent = new Intent();
// supply header text in the intent
intent.putExtra(ConfirmLockPattern.HEADER_TEXT, message);
intent.setClassName("com.android.settings",
returnCredentials
? ConfirmLockPassword.InternalActivity.class.getName()