Merge "Crash invalid FGS notifications" into sc-dev am: bf79a4c434

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

Change-Id: I002a4e24c2216ef4601e266630162fbd110f88bc
This commit is contained in:
TreeHugger Robot
2021-07-09 13:57:33 +00:00
committed by Automerger Merge Worker

View File

@@ -6194,8 +6194,10 @@ public class NotificationManagerService extends SystemService {
// Fix the notification as best we can. // Fix the notification as best we can.
try { try {
fixNotification(notification, pkg, tag, id, userId); fixNotification(notification, pkg, tag, id, userId);
} catch (Exception e) { } catch (Exception e) {
if (notification.isForegroundService()) {
throw new SecurityException("Invalid FGS notification", e);
}
Slog.e(TAG, "Cannot fix notification", e); Slog.e(TAG, "Cannot fix notification", e);
return; return;
} }