Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac05028c authored by Elis Elliott's avatar Elis Elliott
Browse files

Load policy engine on PHASE_SYSTEM_SERVICES_READY

Bug: 297930602

Test: manual
Change-Id: Ia0116f9cc4d9b3269bf82d3ce3b7821b622cfc3e
parent d4c91e12
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1472,11 +1472,10 @@ final class DevicePolicyEngine {
        synchronized (mLock) {
            clear();
            new DevicePoliciesReaderWriter().readFromFileLocked();
            reapplyAllPoliciesLocked();
        }
    }

    private <V> void reapplyAllPoliciesLocked() {
    <V> void reapplyAllPoliciesLocked() {
        for (PolicyKey policy : mGlobalPolicies.keySet()) {
            PolicyState<?> policyState = mGlobalPolicies.get(policy);
            // Policy definition and value will always be of the same type
+5 −0
Original line number Diff line number Diff line
@@ -3347,6 +3347,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                mOwners.systemReady();
                applyManagedSubscriptionsPolicyIfRequired();
                break;
            case SystemService.PHASE_SYSTEM_SERVICES_READY:
                synchronized (getLockObject()) {
                    mDevicePolicyEngine.reapplyAllPoliciesLocked();
                }
                break;
            case SystemService.PHASE_ACTIVITY_MANAGER_READY:
                synchronized (getLockObject()) {
                    migrateToProfileOnOrganizationOwnedDeviceIfCompLocked();