diff options
author | Kenny Guy <kennyguy@google.com> | 2017-01-17 23:33:41 +0000 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2017-01-23 11:44:58 -0800 |
commit | 58552f814a03d978b4a6507f3c16f71964f9b28f (patch) | |
tree | a240dcf55e6efecb4b9a696c2d014b507e95a447 | |
parent | 5494d68d465fe9326618f3ed88127f6401e0711a (diff) | |
download | base-android-cts-7.1_r29.tar.gz |
Fix issue with saving admins before finishing loading.android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-7.1.1_r23nougat-mr1-releasenougat-mr1-cts-release
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)
(cherry picked from commit f98ed6863a7f64c535a66006852a934b05d550bc)
-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 fbb865bc64a9..43168660a316 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -2498,14 +2498,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); |