summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-02-09 11:45:18 -0800
committerRoman Birg <roman@cyngn.com>2016-02-11 11:50:50 -0800
commitef5b0f47e3034eeafc7eb89af6e1edb9e4c20668 (patch)
tree09c0ff47b5f30b60be7d19a8c9c7d8d3cd2b4594 /packages/SystemUI
parentc667383ef46d3ba00168731edbe90283baa8f3d2 (diff)
downloadframeworks_base-ef5b0f47e3034eeafc7eb89af6e1edb9e4c20668.zip
frameworks_base-ef5b0f47e3034eeafc7eb89af6e1edb9e4c20668.tar.gz
frameworks_base-ef5b0f47e3034eeafc7eb89af6e1edb9e4c20668.tar.bz2
update secure keyguard check
We use this method to determine wither to allow profiles and the lock screen tile whether to allow messing with the lockscreen. Don't check whether the keystore is empty. Check whether we allow trust agents by DPM. And also make keyguard use this method to respect it. Ref: CYNGNOS-1930 Change-Id: I1a2b26419d43bd2bbc1d4a5027f1ed78d2744466 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI')
-rwxr-xr-xpackages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/LockscreenToggleTile.java11
2 files changed, 8 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 549da3b..52661e6 100755
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1249,15 +1249,7 @@ public class KeyguardViewMediator extends SystemUI {
DevicePolicyManager dpm = (DevicePolicyManager)
mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
if (dpm != null) {
- int passwordQuality = dpm.getPasswordQuality(null);
- switch (passwordQuality) {
- case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC:
- case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
- case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
- case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
- case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
- return true;
- }
+ return dpm.requireSecureKeyguard();
}
return false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LockscreenToggleTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LockscreenToggleTile.java
index a24c249..a147d30 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LockscreenToggleTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LockscreenToggleTile.java
@@ -106,17 +106,20 @@ public class LockscreenToggleTile extends QSTile<QSTile.BooleanState>
state.visible = mediator.isKeyguardBound();
if (mediator.isProfileDisablingKeyguard()) {
+ state.value = false;
+ state.enabled = false;
state.label = mContext.getString(
R.string.quick_settings_lockscreen_label_locked_by_profile);
- state.value = false;
+ } else if (lockscreenEnforced) {
+ state.value = true;
state.enabled = false;
+ state.label = mContext.getString(
+ R.string.quick_settings_lockscreen_label_enforced);
} else {
state.value = lockscreenEnabled;
state.enabled = !mKeyguard.isShowing() || !mKeyguard.isSecure();
- state.label = mContext.getString(lockscreenEnforced
- ? R.string.quick_settings_lockscreen_label_enforced
- : R.string.quick_settings_lockscreen_label);
+ state.label = mContext.getString(R.string.quick_settings_lockscreen_label);
}
// update icon
if (lockscreenEnabled) {