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

Commit 51fee974 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check -...

Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev
am: 2256fd4e

Change-Id: I1658f2dc59428265adf385ec2e9c579abbefb023
parents 5d35ad74 2256fd4e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1639,6 +1639,11 @@ 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 mRankingHelper.getImportance(pkg, uid) != IMPORTANCE_NONE;
        }