summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-04-10 22:59:44 (GMT)
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-10 22:59:44 (GMT)
commit2256fd4e1113126bf85d0ee03197c1bd0f27e7bb (patch)
tree45b007f1630a95ddb8720b30a3c07a973ccc5f3b
parent652a66650019f5ad9bdfccc327809d47c9ef5ac9 (diff)
parentbed6193b5954565f60afb5f5f9868d89991354d7 (diff)
downloadframeworks_base-2256fd4e1113126bf85d0ee03197c1bd0f27e7bb.zip
frameworks_base-2256fd4e1113126bf85d0ee03197c1bd0f27e7bb.tar.gz
frameworks_base-2256fd4e1113126bf85d0ee03197c1bd0f27e7bb.tar.bz2
Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev
-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 c3f9dc9..8a7d600 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1631,6 +1631,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;
}