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

Commit 2d1132a6 authored by Ben Franz's avatar Ben Franz
Browse files

Early exit for non-inheritable policies

Simple code cleanup to reduce nesting.

Test: TH
Flag: EXEMPT pure readability improvement
Change-Id: Iae7ca4926b92580e85880457e7e0bee526683153
parent 8d9dcb38
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();
        }