From 9fc4c15318fac5d39ffb4b077bdcf45dba7e7f0b Mon Sep 17 00:00:00 2001 From: Paul Chang Date: Fri, 27 Mar 2020 17:18:39 +0800 Subject: [PATCH] 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 --- .../core/java/com/android/server/incident/PendingReports.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/incident/PendingReports.java b/services/core/java/com/android/server/incident/PendingReports.java index 9fcbab71519de..f39bebf060f77 100644 --- a/services/core/java/com/android/server/incident/PendingReports.java +++ b/services/core/java/com/android/server/incident/PendingReports.java @@ -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);