Skip to content

Commit 28460c2

Browse files
Julia Reynoldsgitbuildkicker
authored andcommitted
Check caller's uid before allowing notification policy access.
Bug: 29421441 Change-Id: I7460268595e932d54660b02007bcd68b95fe8aec
1 parent 81be4e3 commit 28460c2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

services/core/java/com/android/server/notification/NotificationManagerService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@ private void enforceSystemOrSystemUI(String message) {
16421642
}
16431643

16441644
private void enforcePolicyAccess(String pkg, String method) {
1645+
checkCallerIsSameApp(pkg);
16451646
if (!checkPolicyAccess(pkg)) {
16461647
Slog.w(TAG, "Notification policy access denied calling " + method);
16471648
throw new SecurityException("Notification policy access denied");
@@ -3130,6 +3131,10 @@ private static void checkCallerIsSystemOrSameApp(String pkg) {
31303131
if (isCallerSystem()) {
31313132
return;
31323133
}
3134+
checkCallerIsSameApp(pkg);
3135+
}
3136+
3137+
private static void checkCallerIsSameApp(String pkg) {
31333138
final int uid = Binder.getCallingUid();
31343139
try {
31353140
ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(

0 commit comments

Comments
 (0)