Suppress not-applicable lint warning

PiperOrigin-RevId: 688948857
(cherry picked from commit dfb7636138039180b9849a8939ab8ec518999d03)
This commit is contained in:
tonihei 2024-10-23 07:01:33 -07:00 committed by Iván Budnik
parent fbbe48cd47
commit bc7c901969
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Bundle;
@ -157,6 +158,9 @@ public class MediaControllerTest {
}
}
// Ignore warning about getCreatorPackage as this is just used as a test assertion to see if the
// correct activity has been received by the controller.
@SuppressLint("PendingIntentCreator")
@Test
public void getSessionActivity() throws Exception {
RemoteMediaSession session = createRemoteMediaSession(TEST_GET_SESSION_ACTIVITY, null);

View File

@ -43,6 +43,7 @@ import static com.google.common.truth.Truth.assertThat;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@ -361,6 +362,9 @@ public class MediaControllerWithMediaSessionCompatTest {
assertThat(controller.getConnectedToken().getSessionVersion()).isLessThan(1_000_000);
}
// Ignore warning about getCreatorPackage as this is just used as a test assertion to see if the
// correct activity has been received by the controller.
@SuppressLint("PendingIntentCreator")
@Test
public void getSessionActivity() throws Exception {
Intent sessionActivity = new Intent(context, MockActivity.class);