diff options
author | Jim Miller <jaggies@google.com> | 2014-04-26 00:35:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-26 00:35:45 +0000 |
commit | 953c4e04fab58678020a5741ba869b44aee581f4 (patch) | |
tree | b3468e52f9181c6ce7901cd3f9ffcfbb84913240 /packages/Keyguard | |
parent | 163b9bb55a104db6672d2a892ea47d9074f1b08c (diff) | |
parent | 66fbe3dc81f2786b2be9afa122038228a31e2cdb (diff) | |
download | frameworks_base-953c4e04fab58678020a5741ba869b44aee581f4.zip frameworks_base-953c4e04fab58678020a5741ba869b44aee581f4.tar.gz frameworks_base-953c4e04fab58678020a5741ba869b44aee581f4.tar.bz2 |
am 427b7fb5: Merge "Add new DevicePolicyManager disable flags for keyguard."
* commit '427b7fb50b5c2c8f38612a74a7c46ff056e22e68':
Add new DevicePolicyManager disable flags for keyguard.
Diffstat (limited to 'packages/Keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 73c2840..ba67a82 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -215,8 +215,29 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mUserHasTrust.put(userId, enabled); } + private boolean isTrustDisabled(int userId) { + final DevicePolicyManager dpm = + (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); + if (dpm != null) { + // TODO once UI is finalized + final boolean disabledByGlobalActions = false; + final boolean disabledBySettings = false; + + // Don't allow trust agent if device is secured with a SIM PIN. This is here + // mainly because there's no other way to prompt the user to enter their SIM PIN + // once they get past the keyguard screen. + final boolean disabledBySimPin = isSimPinSecure(); + + final boolean disabledByDpm = (dpm.getKeyguardDisabledFeatures(null, userId) + & DevicePolicyManager.KEYGUARD_DISABLE_TRUST_AGENTS) != 0; + return disabledByDpm || disabledByGlobalActions || disabledBySettings + || disabledBySimPin; + } + return false; + } + public boolean getUserHasTrust(int userId) { - return mUserHasTrust.get(userId); + return !isTrustDisabled(userId) && mUserHasTrust.get(userId); } static class DisplayClientState { |