summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-07-28 14:35:42 -0700
committerRoman Birg <roman@cyngn.com>2015-07-28 14:36:28 -0700
commit4eeed27ea04e14ef0f06153a4bdc024d0cad7d80 (patch)
tree88228825e491830b20134f27aea6db7c585b125a
parentf8542758467e2a0ce78b08f4f22de38652b38622 (diff)
downloadandroid_packages_apps_Profiles-4eeed27ea04e14ef0f06153a4bdc024d0cad7d80.tar.gz
android_packages_apps_Profiles-4eeed27ea04e14ef0f06153a4bdc024d0cad7d80.tar.bz2
android_packages_apps_Profiles-4eeed27ea04e14ef0f06153a4bdc024d0cad7d80.zip
Profiles Trust: respect DPM; use new LockSettings
Do not grant trust when Device Policy mandates a secure keyguard. Ref: CYNGNOS-620 Change-Id: Ic4558a977c9227563273a91279f6554e564d6738 Signed-off-by: Roman Birg <roman@cyngn.com>
-rw-r--r--src/org/cyanogenmod/profiles/ProfilesTrustAgent.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/profiles/ProfilesTrustAgent.java b/src/org/cyanogenmod/profiles/ProfilesTrustAgent.java
index ce25d26..be2cd67 100644
--- a/src/org/cyanogenmod/profiles/ProfilesTrustAgent.java
+++ b/src/org/cyanogenmod/profiles/ProfilesTrustAgent.java
@@ -16,6 +16,7 @@
package org.cyanogenmod.profiles;
+import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -90,8 +91,16 @@ public class ProfilesTrustAgent extends TrustAgentService {
}
private void handleApplyCurrentProfileState() {
+ final DevicePolicyManager devicePolicyManager =
+ (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
+ if (devicePolicyManager != null && devicePolicyManager.requireSecureKeyguard()) {
+ revokeTrust();
+ return;
+ }
+
Profile p = mProfileManager.getActiveProfile();
- int lockscreenState = p != null ? p.getScreenLockMode() : Profile.LockMode.DEFAULT;
+ int lockscreenState = p != null ? p.getScreenLockMode().getValue()
+ : Profile.LockMode.DEFAULT;
switch (lockscreenState) {
case Profile.LockMode.DISABLE:
case Profile.LockMode.DEFAULT: