summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:29:04 (GMT)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:29:04 (GMT)
commit9f3fca716a47b874279658c0e77232701e71be1c (patch)
tree514f357b0ab162c955d017568cd0e3fc619bbfd0
parent022bfaa808801b0fe2e9bc9c2f48c01ade9e2345 (diff)
parent0bf87880d8a68aeb25aabb5515064f48b7461bac (diff)
downloadframeworks_base-9f3fca716a47b874279658c0e77232701e71be1c.zip
frameworks_base-9f3fca716a47b874279658c0e77232701e71be1c.tar.gz
frameworks_base-9f3fca716a47b874279658c0e77232701e71be1c.tar.bz2
[automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377a0 am: 00121902b0 am: 777c45416e am: 0bf87880d8
Change-Id: If90b329955ca2514e6c236932614648670d440ea
-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 b1fd265..7bfe5f1 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1432,6 +1432,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);
}