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 adbda7474c)
This commit is contained in:
@@ -2451,14 +2451,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
// Ignore
|
// 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
|
// Might need to upgrade the file by rewriting it
|
||||||
if (needsRewrite) {
|
if (needsRewrite) {
|
||||||
saveSettingsLocked(userHandle);
|
saveSettingsLocked(userHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a list of admins from the admin map
|
|
||||||
policy.mAdminList.addAll(policy.mAdminMap.values());
|
|
||||||
|
|
||||||
validatePasswordOwnerLocked(policy);
|
validatePasswordOwnerLocked(policy);
|
||||||
updateMaximumTimeToLockLocked(userHandle);
|
updateMaximumTimeToLockLocked(userHandle);
|
||||||
updateLockTaskPackagesLocked(policy.mLockTaskPackages, userHandle);
|
updateLockTaskPackagesLocked(policy.mLockTaskPackages, userHandle);
|
||||||
|
|||||||
Reference in New Issue
Block a user