Traceur: Make all notification broadcast intents foreground.

Some apps produce a lot of broadcast queue latency (for example,
Dynamite in b/79715842), which is causing delays in notification
handling for Traceur and other apps that don't send their notification
broadcast intents at foreground priority. This change adds
Intent.FLAG_RECEIVER_FOREGROUND to Traceur's broadcast intents, giving
the notifications their expected foreground priority (the user expects
to see an immediate response when they tap on each of these
notifications) and protecting the notifications from being delayed due
to other apps' broadcast behaviors.

Bug: 112155897
Test: atest TraceurUiTests completes successfully.
Test: The Traceur notification flow still works as expected.
Test: Without this change, tapping on a trace notification immediately
after a reboot sometimes resulted in delays. With this change, tapping a
trace notification after reboot resulted in a prompt response.
Change-Id: I288229eb9f22ca0bb460ffa8e12309c6add08591
diff --git a/src/com/google/android/traceur/AtraceService.java b/src/com/google/android/traceur/AtraceService.java
index 2c0f15f..bd44117 100644
--- a/src/com/google/android/traceur/AtraceService.java
+++ b/src/com/google/android/traceur/AtraceService.java
@@ -81,6 +81,7 @@
         Context context = getApplicationContext();
         Intent stopIntent = new Intent(Receiver.STOP_ACTION,
             null, context, Receiver.class);
+        stopIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
 
         String title = context.getString(R.string.trace_is_being_recorded);
         String msg = context.getString(R.string.tap_to_stop_tracing);
diff --git a/src/com/google/android/traceur/FileSender.java b/src/com/google/android/traceur/FileSender.java
index d38a1be..630726f 100644
--- a/src/com/google/android/traceur/FileSender.java
+++ b/src/com/google/android/traceur/FileSender.java
@@ -43,7 +43,7 @@
         final Uri traceUri = getUriForFile(context, file);
 
         Intent sendIntent = buildSendIntent(context, traceUri);
-        sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_RECEIVER_FOREGROUND);
 
         final Notification.Builder builder =
             new Notification.Builder(context, Receiver.NOTIFICATION_CHANNEL)