Skip to content

Instantly share code, notes, and snippets.

@AndrewKvalheim
Last active December 16, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewKvalheim/5456966 to your computer and use it in GitHub Desktop.
Save AndrewKvalheim/5456966 to your computer and use it in GitHub Desktop.
Allow less-secure screen unlocks if the encryption password isn't synchronized.
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index f67213c..e015024 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -246,7 +246,8 @@ public class ChooseLockGeneric extends PreferenceActivity {
int encryptionStatus = mDPM.getStorageEncryptionStatus();
boolean encrypted = (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE)
|| (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING);
- if (encrypted) {
+ LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());
+ if (encrypted && lockPatternUtils.getSyncEncryptionPassword()) {
if (quality < CryptKeeperSettings.MIN_PASSWORD_QUALITY) {
quality = CryptKeeperSettings.MIN_PASSWORD_QUALITY;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment