diff options
author | Kenny Guy <kennyguy@google.com> | 2017-01-17 23:33:41 +0000 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2017-03-22 15:01:36 -0700 |
commit | 542bba3f35775c48aca35e959a2eb213b2697c43 (patch) | |
tree | ea9d0394fbe7830e444d866a814958ce3a0b0615 | |
parent | e7102382a60069ff1253053da34c232a5c5a4ff8 (diff) | |
download | base-542bba3f35775c48aca35e959a2eb213b2697c43.tar.gz |
Fix issue with saving admins before finishing loading.
Saving device policy managers settings to clear out
password stats was happening before initializing mAdminList
so could wipe active admins.
Test: manual - flash with N2G05C add google account with dmagent flash wth this fix, check dmagent is still an active admin, reboot check admin is still active.
Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Bug: 34277435
Change-Id: I13660b47f30e9aba001eb13f2e457c3b3f36da3e
(cherry picked from commit adbda7474cc1968b66e9948aee566dc346e71340)
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index f61429fe11af..e3b6ecc749cf 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -2578,14 +2578,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { // Ignore } + // Generate a list of admins from the admin map + policy.mAdminList.addAll(policy.mAdminMap.values()); + // Might need to upgrade the file by rewriting it if (needsRewrite) { saveSettingsLocked(userHandle); } - // Generate a list of admins from the admin map - policy.mAdminList.addAll(policy.mAdminMap.values()); - validatePasswordOwnerLocked(policy); updateMaximumTimeToLockLocked(userHandle); updateLockTaskPackagesLocked(policy.mLockTaskPackages, userHandle); |