Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb3c5c30 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Crash invalid FGS notifications

Test: CTS, ActivityManagerProcessStateTest
Fixes: 191981182
Change-Id: I13a0202b25c8118db47edba11a93c1939c94b392
(cherry picked from commit 6f657f8f)
parent 4f319df8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5752,8 +5752,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;
        }