Loading core/java/com/android/internal/widget/LockPatternUtils.java +17 −7 Original line number Diff line number Diff line Loading @@ -560,9 +560,7 @@ public class LockPatternUtils { // Update the device encryption password. if (userId == UserHandle.USER_OWNER && LockPatternUtils.isDeviceEncryptionEnabled()) { final ContentResolver cr = mContext.getContentResolver(); final boolean required = Settings.Global.getInt(cr, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, 1) == 1 ? true : false; final boolean required = isCredentialRequiredToDecrypt(true); if (!required) { clearEncryptionPassword(); } else { Loading Loading @@ -793,10 +791,7 @@ public class LockPatternUtils { // Update the device encryption password. if (userHandle == UserHandle.USER_OWNER && LockPatternUtils.isDeviceEncryptionEnabled()) { final ContentResolver cr = mContext.getContentResolver(); final boolean required = Settings.Global.getInt(cr, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, 1) == 1 ? true : false; if (!required) { if (!isCredentialRequiredToDecrypt(true)) { clearEncryptionPassword(); } else { boolean numeric = computedQuality Loading Loading @@ -1658,4 +1653,19 @@ public class LockPatternUtils { private void onAfterChangingPassword() { getTrustManager().reportEnabledTrustAgentsChanged(getCurrentOrCallingUserId()); } public boolean isCredentialRequiredToDecrypt(boolean defaultValue) { final int value = Settings.Global.getInt(mContentResolver, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, -1); return value == -1 ? defaultValue : (value != 0); } public void setCredentialRequiredToDecrypt(boolean required) { if (getCurrentUser() != UserHandle.USER_OWNER) { Log.w(TAG, "Only device owner may call setCredentialRequiredForDecrypt()"); return; } Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, required ? 1 : 0); } } Loading
core/java/com/android/internal/widget/LockPatternUtils.java +17 −7 Original line number Diff line number Diff line Loading @@ -560,9 +560,7 @@ public class LockPatternUtils { // Update the device encryption password. if (userId == UserHandle.USER_OWNER && LockPatternUtils.isDeviceEncryptionEnabled()) { final ContentResolver cr = mContext.getContentResolver(); final boolean required = Settings.Global.getInt(cr, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, 1) == 1 ? true : false; final boolean required = isCredentialRequiredToDecrypt(true); if (!required) { clearEncryptionPassword(); } else { Loading Loading @@ -793,10 +791,7 @@ public class LockPatternUtils { // Update the device encryption password. if (userHandle == UserHandle.USER_OWNER && LockPatternUtils.isDeviceEncryptionEnabled()) { final ContentResolver cr = mContext.getContentResolver(); final boolean required = Settings.Global.getInt(cr, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, 1) == 1 ? true : false; if (!required) { if (!isCredentialRequiredToDecrypt(true)) { clearEncryptionPassword(); } else { boolean numeric = computedQuality Loading Loading @@ -1658,4 +1653,19 @@ public class LockPatternUtils { private void onAfterChangingPassword() { getTrustManager().reportEnabledTrustAgentsChanged(getCurrentOrCallingUserId()); } public boolean isCredentialRequiredToDecrypt(boolean defaultValue) { final int value = Settings.Global.getInt(mContentResolver, Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, -1); return value == -1 ? defaultValue : (value != 0); } public void setCredentialRequiredToDecrypt(boolean required) { if (getCurrentUser() != UserHandle.USER_OWNER) { Log.w(TAG, "Only device owner may call setCredentialRequiredForDecrypt()"); return; } Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT, required ? 1 : 0); } }