summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2014-06-25 23:29:55 +0200
committer Adrian Roos <roosa@google.com> 2014-06-26 01:54:52 +0200
commitef1de65117e8361cbeb188309dbb1a7953350c2a (patch)
tree2c85cb60ff4a9da9fc8e3f31493ddfacb0ca5e44
parent2c12cfa1d53b586ae8a8d6aca64a4de771dc85b0 (diff)
Trust Agents: Disable until next unlock if device is locked by DPM
Bug: 15871777 Change-Id: I1a6e43848e600ffa2092282081b18ddf92419d4a
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 9c38bbcccc09..893a891d3be9 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2255,9 +2255,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
try {
LockPatternUtils utils = new LockPatternUtils(mContext);
utils.saveLockPassword(password, quality, false, userHandle);
+ boolean requireEntry = (flags & DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY) != 0;
+ if (requireEntry) {
+ utils.requireCredentialEntry(UserHandle.USER_ALL);
+ }
synchronized (this) {
- int newOwner = (flags&DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY)
- != 0 ? callingUid : -1;
+ int newOwner = requireEntry ? callingUid : -1;
if (policy.mPasswordOwner != newOwner) {
policy.mPasswordOwner = newOwner;
saveSettingsLocked(userHandle);
@@ -2370,6 +2373,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
getIPowerManager().goToSleep(SystemClock.uptimeMillis(),
PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN, 0);
// Ensure the device is locked
+ new LockPatternUtils(mContext).requireCredentialEntry(UserHandle.USER_ALL);
getWindowManager().lockNow(null);
} catch (RemoteException e) {
} finally {