summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:33 (GMT)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2019-04-09 22:28:33 (GMT)
commit00121902b01fdefedafa4c257bd7941918980bf0 (patch)
treef0dde92bc5fba5fa278470a1391e5f067d1eed6d
parent0494ac65682189f6a8c64de0d54e65ab24eac7ae (diff)
parenta2b2e377a0a63cbe9c8bfdfcab1167e55f36a59b (diff)
downloadframeworks_base-00121902b01fdefedafa4c257bd7941918980bf0.zip
frameworks_base-00121902b01fdefedafa4c257bd7941918980bf0.tar.gz
frameworks_base-00121902b01fdefedafa4c257bd7941918980bf0.tar.bz2
[automerger] [RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage am: a2b2e377a0
Change-Id: Ic1d3439eb787c393d0f595d04c7627345118474d
-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 bb55240..33d2fa3 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1427,6 +1427,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);
}