summaryrefslogtreecommitdiff
path: root/packages/Shell
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Shell')
-rw-r--r--packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
index 3b02e3b46557..43147cdfc86d 100644
--- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
+++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
@@ -576,9 +576,10 @@ public class BugreportReceiverTest {
*/
private void sendBugreportStarted() throws Exception {
Intent intent = new Intent(INTENT_BUGREPORT_REQUESTED);
- intent.setPackage("com.android.shell");
- intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
- mContext.sendBroadcast(intent);
+ // Ideally, we should invoke BugreportRequestedReceiver by sending
+ // INTENT_BUGREPORT_REQUESTED. But the intent has been protected broadcast by the system
+ // starting from S.
+ new BugreportRequestedReceiver().onReceive(mContext, intent);
ArgumentCaptor<IDumpstateListener> listenerCap = ArgumentCaptor.forClass(
IDumpstateListener.class);