summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-05-12 19:48:54 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-05-12 19:48:54 +0000
commite91ae52a8570afdb64eec30e4ecdd463f379b3bb (patch)
tree5fb9e295475063a5e2cd533b062ef71248cb8883
parent83b4fadcb7666811327b654ebdc55035b6e4e4f8 (diff)
parent26e9d222c10f3e7eeaaaa8577b0314481ffa17c2 (diff)
Merge "Crash invalid FGS notifications" into rvc-qpr-dev
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 7af3da546a6b..91d9c319d499 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -5823,8 +5823,10 @@ public class NotificationManagerService extends SystemService {
// Fix the notification as best we can.
try {
fixNotification(notification, pkg, tag, id, userId);
-
} catch (Exception e) {
+ if (notification.isForegroundService()) {
+ throw new SecurityException("Invalid FGS notification", e);
+ }
Slog.e(TAG, "Cannot fix notification", e);
return;
}