DO NOT MERGE Crash invalid FGS notifications am: b6b2906ea6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17864291

Change-Id: I57b968cab49f7d3eef8028ea92d571d5b68489e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Julia Reynolds
2022-05-12 20:23:46 +00:00
committed by Automerger Merge Worker

View File

@@ -4836,8 +4836,11 @@ public class NotificationManagerService extends SystemService {
try {
fixNotification(notification, pkg, userId);
} catch (NameNotFoundException e) {
Slog.e(TAG, "Cannot create a context for sending app", e);
} catch (Exception e) {
if (notification.isForegroundService()) {
throw new SecurityException("Invalid FGS notification", e);
}
Slog.e(TAG, "Cannot fix notification", e);
return;
}