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

Commit ea796ab0 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by android-build-merger
Browse files

Merge "Fix issue #109746350: startWatchingMode fails on P" into pi-dev

am: e6fde145

Change-Id: Ifd929e3f72272ae0f4f451e9aa046ca49ff73ebb
parents 2a256780 e6fde145
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1335,10 +1335,10 @@ public class AppOpsService extends IAppOpsService.Stub {
        int watchedUid = -1;
        int watchedUid = -1;
        final int callingUid = Binder.getCallingUid();
        final int callingUid = Binder.getCallingUid();
        final int callingPid = Binder.getCallingPid();
        final int callingPid = Binder.getCallingPid();
        if (mContext.checkCallingOrSelfPermission(Manifest.permission.WATCH_APPOPS)
        // TODO: should have a privileged permission to protect this.
                != PackageManager.PERMISSION_GRANTED) {
        // Also, if the caller has requested WATCH_FOREGROUND_CHANGES, should we require
            watchedUid = callingUid;
        // the USAGE_STATS permission since this can provide information about when an
        }
        // app is in the foreground?
        Preconditions.checkArgumentInRange(op, AppOpsManager.OP_NONE,
        Preconditions.checkArgumentInRange(op, AppOpsManager.OP_NONE,
                AppOpsManager._NUM_OP - 1, "Invalid op code: " + op);
                AppOpsManager._NUM_OP - 1, "Invalid op code: " + op);
        if (callback == null) {
        if (callback == null) {