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

Commit b2342e70 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix DPM check logic for AppUsageLimitObserver (un)registering" into...

Merge "Fix DPM check logic for AppUsageLimitObserver (un)registering" into rvc-dev am: 0a78a5ad am: ef36e6f8 am: 4cb58b4a am: 75cacd81

Change-Id: I1989b33d8394aad7945782d2d5dab62d86b276b8
parents da5f66b1 75cacd81
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1847,7 +1847,7 @@ public class UsageStatsService extends SystemService implements
            final DevicePolicyManagerInternal dpmInternal = getDpmInternal();
            if (!hasPermissions(callingPackage,
                    Manifest.permission.SUSPEND_APPS, Manifest.permission.OBSERVE_APP_USAGE)
                    && (dpmInternal != null && !dpmInternal.isActiveSupervisionApp(callingUid))) {
                    && (dpmInternal == null || !dpmInternal.isActiveSupervisionApp(callingUid))) {
                throw new SecurityException("Caller must be the active supervision app or "
                        + "it must have both SUSPEND_APPS and OBSERVE_APP_USAGE permissions");
            }
@@ -1874,7 +1874,7 @@ public class UsageStatsService extends SystemService implements
            final DevicePolicyManagerInternal dpmInternal = getDpmInternal();
            if (!hasPermissions(callingPackage,
                    Manifest.permission.SUSPEND_APPS, Manifest.permission.OBSERVE_APP_USAGE)
                    && (dpmInternal != null && !dpmInternal.isActiveSupervisionApp(callingUid))) {
                    && (dpmInternal == null || !dpmInternal.isActiveSupervisionApp(callingUid))) {
                throw new SecurityException("Caller must be the active supervision app or "
                        + "it must have both SUSPEND_APPS and OBSERVE_APP_USAGE permissions");
            }