summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2019-04-11 00:19:16 (GMT)
committerandroid-build-merger <android-build-merger@google.com>2019-04-11 00:19:16 (GMT)
commit51fee974a96f6a3d1dd38822e52bd13a5fa46e03 (patch)
treee9749cc7e3b3d582df630c60cde4b0d2b520037b
parent5d35ad7446944ce2ccb4f571ef0104ded3e81a62 (diff)
parent2256fd4e1113126bf85d0ee03197c1bd0f27e7bb (diff)
downloadframeworks_base-51fee974a96f6a3d1dd38822e52bd13a5fa46e03.zip
frameworks_base-51fee974a96f6a3d1dd38822e52bd13a5fa46e03.tar.gz
frameworks_base-51fee974a96f6a3d1dd38822e52bd13a5fa46e03.tar.bz2
Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev
am: 2256fd4e11 Change-Id: I1658f2dc59428265adf385ec2e9c579abbefb023
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java5
1 files changed, 5 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 ea9597e..0521855 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -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;
}