Disable passphrase change flow encryption screen when not main user

When the user changing passphrase is not the process' user, disable
the "Ask for password on device startup" screen, as it makes no sense.

Change-Id: I521b5ec8702f7a39b94012a606794e04135e4c75
This commit is contained in:
Clara Bayarri
2015-10-16 12:36:57 +01:00
parent 386919bef8
commit 93bcfcb14d

View File

@@ -215,6 +215,7 @@ public class ChooseLockGeneric extends SettingsActivity {
private void maybeEnableEncryption(int quality, boolean disabled) {
DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE);
if (UserManager.get(getActivity()).isAdminUser()
&& mUserId == UserHandle.myUserId()
&& LockPatternUtils.isDeviceEncryptionEnabled()
&& !dpm.getDoNotAskCredentialsOnBoot()) {
mEncryptionRequestQuality = quality;