@Override
  public void startMediaRequest(
      @NonNull String[] mimeTypes, int requestId, @NonNull InsertionRequestCallback callback) {
    mCurrentRunningLocalProxy.dispose();

    mCurrentRequest = requestId;
    mCurrentCallback = callback;

    final Intent pickingIntent = getMediaInsertRequestIntent(mimeTypes, requestId);

    mContext.startActivity(pickingIntent);
  }
@Test
  public void testStartsPickActivityWithRequest() {
    mUnderTest.startMediaRequest(new String[] {"media/png"}, 123, mCallback);

    Mockito.verifyZeroInteractions(mCallback);

    final Intent mediaInsertionIntent =
        Shadows.shadowOf((Application) ApplicationProvider.getApplicationContext())
            .getNextStartedActivity();

    Assert.assertEquals(
        MediaInsertion.INTENT_MEDIA_INSERTION_REQUEST_ACTION, mediaInsertionIntent.getAction());
    Assert.assertEquals(
        Intent.FLAG_ACTIVITY_NEW_TASK,
        mediaInsertionIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK);
    Assert.assertEquals(
        0 /*do not set this flag*/,
        mediaInsertionIntent.getFlags() & Intent.FLAG_ACTIVITY_NO_HISTORY);
    Assert.assertEquals(
        Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS,
        mediaInsertionIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

    Assert.assertArrayEquals(
        new String[] {"media/png"},
        mediaInsertionIntent.getStringArrayExtra(
            MediaInsertion.INTENT_MEDIA_INSERTION_REQUEST_MEDIA_MIMES_KEY));
    Assert.assertEquals(
        123,
        mediaInsertionIntent.getIntExtra(
            MediaInsertion.INTENT_MEDIA_INSERTION_REQUEST_MEDIA_REQUEST_ID_KEY, 0));

    Mockito.verifyZeroInteractions(mCallback);
  }