DO NOT MERGE Crash invalid FGS notifications
Test: CTS, ActivityManagerProcessStateTest
Fixes: 191981182
Change-Id: I13a0202b25c8118db47edba11a93c1939c94b392
Merged-In: I13a0202b25c8118db47edba11a93c1939c94b392
(cherry picked from commit 6f657f8f5b)
This commit is contained in:
@@ -4789,8 +4789,11 @@ public class NotificationManagerService extends SystemService {
|
|||||||
try {
|
try {
|
||||||
fixNotification(notification, pkg, userId);
|
fixNotification(notification, pkg, userId);
|
||||||
|
|
||||||
} catch (NameNotFoundException e) {
|
} catch (Exception e) {
|
||||||
Slog.e(TAG, "Cannot create a context for sending app", e);
|
if (notification.isForegroundService()) {
|
||||||
|
throw new SecurityException("Invalid FGS notification", e);
|
||||||
|
}
|
||||||
|
Slog.e(TAG, "Cannot fix notification", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user