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

Commit 674653c1 authored by Kholoud Mohamed's avatar Kholoud Mohamed Committed by Automerger Merge Worker
Browse files

Merge "Move loading policy engine from DPMS constructor to #systemReady" into...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24680108



Change-Id: Idee30b765c6b5828b43b01513a778b4a3d675095
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cb6cf47c 5398b479
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();