Send ACTION_PENDING_INCIDENT_REPORTS_CHANGED broadcast with flags

- Send ACTION_PENDING_INCIDENT_REPORTS_CHANGED broadcast with flags to let the receiver is allowed to run at foreground priority, with a shorter timeout interval.

BUG: 145790713
Test: Flash and reboot and start bugreport, then consent dialog is shown with a shorter timeout interval.
Change-Id: I495ae483854baa07cad6b992059d351a1a41a5fd
This commit is contained in:
Paul Chang
2020-03-27 17:18:39 +08:00
parent a7b10f5623
commit 9fc4c15318

View File

@@ -359,6 +359,8 @@ class PendingReports {
private void sendBroadcast(ComponentName receiver, int primaryUser) {
final Intent intent = new Intent(Intent.ACTION_PENDING_INCIDENT_REPORTS_CHANGED);
intent.setComponent(receiver);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
final BroadcastOptions options = BroadcastOptions.makeBasic();
options.setBackgroundActivityStartsAllowed(true);