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

Commit 8c796fee authored by Jason Parks's avatar Jason Parks
Browse files

Combine the checks for DO/PO in isAdminAffectedByRestriction().

Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_RemoveRestrictionSet
Bug: 270045994
Change-Id: If0b600d180a2219ee81ed9c682a84158e222da5c
parent 7c0ec937
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -12519,9 +12519,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            case UserManager.RESTRICTION_NOT_SET:
                return false;
            case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
                return !isDeviceOwner(admin, userId);
            case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
                return !isProfileOwner(admin, userId);
                return !(isDeviceOwner(admin, userId) || isProfileOwner(admin, userId));
            default:
                return true;
        }