Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc1f3bff authored by Rhed Jao's avatar Rhed Jao
Browse files

Fixes BugreportReceiverTest failed

Instead of sending INTENT_BUGREPORT_REQUESTED, invoke
BugreportRequestedReceiver instance directly.

Bug: 174832302
Test: atest BugreportReceiverTest
Change-Id: I99a052d74b71d503a655a769064a74246da150e5
parent 82f20411
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);