summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2019-09-22 00:09:05 (GMT)
committerƁukasz Patron <priv.luk@gmail.com>2019-11-27 14:51:56 (GMT)
commit81317f24fd8839370bcce1ecf47ef18f93f932f5 (patch)
tree1613c1e4973176aaac1379f0d3fa7622049f9a18
parenteae2c874a66f5b1d1567a260ee0047c7453391d0 (diff)
downloadframeworks_base-81317f24fd8839370bcce1ecf47ef18f93f932f5.zip
frameworks_base-81317f24fd8839370bcce1ecf47ef18f93f932f5.tar.gz
frameworks_base-81317f24fd8839370bcce1ecf47ef18f93f932f5.tar.bz2
SystemUI: Don't dismiss keyguard if user key isn't unlocked
* This change avoids skipping keyguard before userdata is decrypted on FBE devices if user made their profile so that it keeps their device unlocked. Change-Id: If470d07e8d0188535a9e6a77f96f0a66ff4e434d
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index d552e01..305370d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -53,6 +53,7 @@ import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
+import android.os.storage.StorageManager;
import android.provider.Settings;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -1075,12 +1076,15 @@ public class KeyguardViewMediator extends SystemUI {
if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by setting");
return true;
}
- if (mProfileManager != null) {
- Profile profile = mProfileManager.getActiveProfile();
- if (profile != null) {
- if (profile.getScreenLockMode().getValue() == Profile.LockMode.DISABLE) {
- if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by profile");
- return true;
+ if (!StorageManager.isFileEncryptedNativeOrEmulated() ||
+ StorageManager.isUserKeyUnlocked(userId)) {
+ if (mProfileManager != null) {
+ Profile profile = mProfileManager.getActiveProfile();
+ if (profile != null) {
+ if (profile.getScreenLockMode().getValue() == Profile.LockMode.DISABLE) {
+ if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by profile");
+ return true;
+ }
}
}
}