diff options
author | Roman Birg <roman@cyngn.com> | 2016-02-09 11:45:18 -0800 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-02-11 11:50:50 -0800 |
commit | ef5b0f47e3034eeafc7eb89af6e1edb9e4c20668 (patch) | |
tree | 09c0ff47b5f30b60be7d19a8c9c7d8d3cd2b4594 /services/devicepolicy/java | |
parent | c667383ef46d3ba00168731edbe90283baa8f3d2 (diff) | |
download | frameworks_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 'services/devicepolicy/java')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 14 |
1 files changed, 2 insertions, 12 deletions
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. |