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

Commit 32e68625 authored by Jonathan Scott's avatar Jonathan Scott
Browse files

Throw SecurityException when an admin uses the

setUserRestrictionGlobally method.

Test: btest CtsDevicePolicyTestCases
Fixes: 278772650
Change-Id: Id230f8b179df79b62bc8a85ed50e18dede8a298e
parent 3d3fc71b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13376,7 +13376,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            throw new IllegalStateException("Feature flag is not enabled.");
        }
        if (isDeviceOwner(caller) || isProfileOwner(caller)) {
            throw new IllegalStateException("Admins are not allowed to call this API.");
            throw new SecurityException("Admins are not allowed to call this API.");
        }
        if (!mInjector.isChangeEnabled(
                ENABLE_COEXISTENCE_CHANGE, callerPackage, caller.getUserId())) {