summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:40 (GMT)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:40 (GMT)
commit777c45416ee3bc08b09cc4320eb649af9c36d686 (patch)
tree2b59017b6319b4b463b73aa23f777c0b45b28e93
parent70b534799b870e31de369014338d3b5dac92b5f5 (diff)
parent00121902b01fdefedafa4c257bd7941918980bf0 (diff)
downloadframeworks_base-777c45416ee3bc08b09cc4320eb649af9c36d686.zip
frameworks_base-777c45416ee3bc08b09cc4320eb649af9c36d686.tar.gz
frameworks_base-777c45416ee3bc08b09cc4320eb649af9c36d686.tar.bz2
[automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377a0 am: 00121902b0
Change-Id: I362a9976890358467b16f07315295b17d767b9b1
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index eb85f19..0156e38 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -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);
}