Merge "Don't send broadcast to unprepared apps" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-20 23:14:14 +00:00
committed by Android (Google) Code Review

View File

@@ -2659,6 +2659,7 @@ public class NotificationManagerService extends SystemService {
final Set<String> dndApprovedPackages = mConditionProviders.getAllowedPackages();
for (String pkg : dndApprovedPackages) {
intent.setPackage(pkg);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
getContext().sendBroadcastAsUser(intent, UserHandle.ALL);
}
}