Fixes BugreportReceiverTest failed am: e9a2038f8a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532903

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9a9a0fefa6e02271ee18e339c7c54e5e04573f6a
This commit is contained in:
Rhed Jao
2021-01-06 11:05:39 +00:00
committed by Automerger Merge Worker

View File

@@ -576,9 +576,10 @@ public class BugreportReceiverTest {
*/ */
private void sendBugreportStarted() throws Exception { private void sendBugreportStarted() throws Exception {
Intent intent = new Intent(INTENT_BUGREPORT_REQUESTED); Intent intent = new Intent(INTENT_BUGREPORT_REQUESTED);
intent.setPackage("com.android.shell"); // Ideally, we should invoke BugreportRequestedReceiver by sending
intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); // INTENT_BUGREPORT_REQUESTED. But the intent has been protected broadcast by the system
mContext.sendBroadcast(intent); // starting from S.
new BugreportRequestedReceiver().onReceive(mContext, intent);
ArgumentCaptor<IDumpstateListener> listenerCap = ArgumentCaptor.forClass( ArgumentCaptor<IDumpstateListener> listenerCap = ArgumentCaptor.forClass(
IDumpstateListener.class); IDumpstateListener.class);