From ec17538d46a49530ed6efdc2842ee16eaf18b9f6 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 26 Jan 2016 18:17:15 -0800 Subject: [PATCH] Send broadcasts as foreground, otherwise test might fail when running after reboot. BUG: 26805230 Change-Id: I05dcf9871c9b4c4c9a465466d60ebe9a1ac63e51 --- .../tests/src/com/android/shell/BugreportReceiverTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java index 52e1b56d16d7f..5908d02b738d3 100644 --- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java +++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java @@ -461,6 +461,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase { */ private void sendBugreportStarted(int max) throws Exception { Intent intent = new Intent(INTENT_BUGREPORT_STARTED); + intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(EXTRA_PID, PID); intent.putExtra(EXTRA_NAME, NAME); intent.putExtra(EXTRA_MAX, max); @@ -518,6 +519,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase { */ private void sendBugreportFinished(Integer pid, String bugreportPath, String screenshotPath) { Intent intent = new Intent(INTENT_BUGREPORT_FINISHED); + intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); if (pid != null) { intent.putExtra(EXTRA_PID, pid); }