Crash invalid FGS notifications

Test: CTS, ActivityManagerProcessStateTest
Fixes: 191981182
Change-Id: I13a0202b25c8118db47edba11a93c1939c94b392
(cherry picked from commit 6f657f8f5b)
This commit is contained in:
Julia Reynolds
2021-07-07 16:19:44 -04:00
parent 49f031ea4d
commit 26e9d222c1

View File

@@ -5764,8 +5764,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;
}