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

Commit 2e352d56 authored by Ben Franz's avatar Ben Franz Committed by Android (Google) Code Review
Browse files

Merge "Early exit for non-inheritable policies" into main

parents 93b6c215 2d1132a6
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -403,7 +403,9 @@ final class DevicePolicyEngine {
     */
    private <V> void applyToInheritableProfiles(PolicyDefinition<V> policyDefinition,
            EnforcingAdmin enforcingAdmin, @Nullable PolicyValue<V> value, int userId) {
        if (policyDefinition.isInheritable()) {
        if (!policyDefinition.isInheritable()) {
            return;
        }
        Binder.withCleanCallingIdentity(() -> {
            List<UserInfo> userInfos = mUserManager.getProfiles(userId);
            for (UserInfo childUserInfo : userInfos) {
@@ -419,7 +421,6 @@ final class DevicePolicyEngine {
            }
        });
    }
    }

    /**
     * Checks if given parentUserId is direct parent of childUserId.
@@ -1894,6 +1895,7 @@ final class DevicePolicyEngine {
        private static File getFileName() {
            return new File(Environment.getDataSystemDirectory(), DEVICE_POLICIES_XML);
        }

        private DevicePoliciesReaderWriter() {
            mFile = getFileName();
        }