From 5063e0bbf0e79335f190d43ca2fdc8d5198d6b65 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 13 May 2021 10:53:22 -0400 Subject: [PATCH] Don't send broadcast to unprepared apps Test: reboot, verify broadcast delivery in bugreport Fixes: 185532863 Change-Id: I94a4b4be693d73ea6154a91e88cd2bf1d3495b94 --- .../android/server/notification/NotificationManagerService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 19c717d624250..3e62036234699 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2659,6 +2659,7 @@ public class NotificationManagerService extends SystemService { final Set dndApprovedPackages = mConditionProviders.getAllowedPackages(); for (String pkg : dndApprovedPackages) { intent.setPackage(pkg); + intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); getContext().sendBroadcastAsUser(intent, UserHandle.ALL); } }