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

Commit 8bee19ca 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-dr1-dev

* changes:
  [automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377
  [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage
parents 39f54326 00121902
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1427,6 +1427,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);
        }