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

Commit d50021f8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "am-3ca7326a-cbf1-4f97-a1b5-a4fdfac0fb47" into nyc-mr1-dev

* changes:
  [automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377 am: 00121902
  [automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377
  [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage
parents 9c0bc540 777c4541
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1435,6 +1435,12 @@ public class NotificationManagerService extends SystemService {
        @Override
        public boolean areNotificationsEnabledForPackage(String pkg, int uid) {
            checkCallerIsSystemOrSameApp(pkg);
            if (UserHandle.getCallingUserId() != UserHandle.getUserId(uid)) {
                getContext().enforceCallingPermission(
                        android.Manifest.permission.INTERACT_ACROSS_USERS,
                        "canNotifyAsPackage for uid " + uid);
            }

            return (mAppOps.checkOpNoThrow(AppOpsManager.OP_POST_NOTIFICATION, uid, pkg)
                    == AppOpsManager.MODE_ALLOWED) && !isPackageSuspendedForUser(pkg, uid);
        }