summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:44 (GMT)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:44 (GMT)
commit0bf87880d8a68aeb25aabb5515064f48b7461bac (patch)
tree2f32515ed362e7f2d0f3fbbb71ed33d1e103c439
parent49a505f4f9bb026661b1cd61a360223b6a1aa56f (diff)
parent777c45416ee3bc08b09cc4320eb649af9c36d686 (diff)
downloadframeworks_base-0bf87880d8a68aeb25aabb5515064f48b7461bac.zip
frameworks_base-0bf87880d8a68aeb25aabb5515064f48b7461bac.tar.gz
frameworks_base-0bf87880d8a68aeb25aabb5515064f48b7461bac.tar.bz2
[automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377a0 am: 00121902b0 am: 777c45416e
Change-Id: Ic6d7bf16ab67d441e77f003288129671c2ec327d
-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 b1468f1..a0b1abd 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);
}