diff options
3 files changed, 10 insertions, 25 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) { diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index b2cb2ff..302d23a 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -4215,18 +4215,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { || encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING) { return true; } - - // Keystore.isEmpty() requires system UID - long token = Binder.clearCallingIdentity(); - try { - if (!KeyStore.getInstance().isEmpty()) { - return true; - } - } finally { - Binder.restoreCallingIdentity(token); - } - - return false; + final int keyguardDisabledFeatures = getKeyguardDisabledFeatures(null, userHandle); + return (keyguardDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_TRUST_AGENTS) != 0; } // Returns the active device owner or null if there is no device owner. |