summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2019-04-11 00:44:09 (GMT)
committerandroid-build-merger <android-build-merger@google.com>2019-04-11 00:44:09 (GMT)
commit19ad060bf0f64bb9b863f00ef640e38ffeedad0b (patch)
treed5eae1af5c3dc1267ac490f545926108b2966b85
parent03cddd8562919e25769b88cdcd6f92a59bff83cb (diff)
parent51fee974a96f6a3d1dd38822e52bd13a5fa46e03 (diff)
downloadframeworks_base-19ad060bf0f64bb9b863f00ef640e38ffeedad0b.zip
frameworks_base-19ad060bf0f64bb9b863f00ef640e38ffeedad0b.tar.gz
frameworks_base-19ad060bf0f64bb9b863f00ef640e38ffeedad0b.tar.bz2
Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev am: 2256fd4e11
am: 51fee974a9 Change-Id: I5c0f89e5614901b57880fff5b59a2f6766893903
-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 566e5f5..4baec05 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1767,6 +1767,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;
}