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

Commit 5398b479 authored by Kholoud Mohamed's avatar Kholoud Mohamed Committed by Android (Google) Code Review
Browse files

Merge "Move loading policy engine from DPMS constructor to #systemReady" into udc-qpr-dev

parents 70c488a6 850d9642
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1451,11 +1451,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
+6 −3
Original line number Diff line number Diff line
@@ -2144,9 +2144,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        mUserManagerInternal.addUserLifecycleListener(new UserLifecycleListener());
        mDeviceManagementResourcesProvider.load();
        if (isPermissionCheckFlagEnabled() || isPolicyEngineForFinanceFlagEnabled()) {
	mDevicePolicyEngine.load();
        }
        mContactSystemRoleHolders = fetchOemSystemHolders(/* roleResIds...= */
                com.android.internal.R.string.config_defaultSms,
@@ -3380,6 +3378,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();