From 9c15ea5436fcdb52936cd59e1840595f738aee73 Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 18 Oct 2024 02:27:04 -0700 Subject: [PATCH] Add `@ForOverride` annotation to `DataSourceContractTest` PiperOrigin-RevId: 687223500 (cherry picked from commit 3ba2fa6c076ee59629fcda6f35875bffd0fc0135) --- .../androidx/media3/test/utils/DataSourceContractTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/DataSourceContractTest.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/DataSourceContractTest.java index c770220bc7..77eae89a4a 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/DataSourceContractTest.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/DataSourceContractTest.java @@ -44,6 +44,7 @@ import androidx.media3.datasource.TransferListener; import com.google.common.base.Ascii; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.errorprone.annotations.ForOverride; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -80,6 +81,7 @@ public abstract class DataSourceContractTest { *

Only one of {@link #createDataSource()} and {@link #createDataSources()} should be * implemented. */ + @ForOverride protected DataSource createDataSource() throws Exception { throw new UnsupportedOperationException(); } @@ -90,6 +92,7 @@ public abstract class DataSourceContractTest { *

Only one of {@link #createDataSource()} and {@link #createDataSources()} should be * implemented. */ + @ForOverride protected List createDataSources() throws Exception { throw new UnsupportedOperationException(); } @@ -100,6 +103,7 @@ public abstract class DataSourceContractTest { * same {@link DataSource} then {@code null} can be returned. */ @Nullable + @ForOverride protected DataSource getTransferListenerDataSource() { return null; } @@ -108,6 +112,7 @@ public abstract class DataSourceContractTest { * Returns whether the {@link DataSource} will continue reading indefinitely for unbounded {@link * DataSpec DataSpecs}. */ + @ForOverride protected boolean unboundedReadsAreIndefinite() { return false; } @@ -121,6 +126,7 @@ public abstract class DataSourceContractTest { *

If multiple resources are returned, it's recommended to disambiguate them using {@link * TestResource.Builder#setName(String)}. */ + @ForOverride protected abstract ImmutableList getTestResources() throws Exception; /** @@ -128,6 +134,7 @@ public abstract class DataSourceContractTest { * *

This is used to test how a {@link DataSource} handles nonexistent data. */ + @ForOverride protected abstract Uri getNotFoundUri(); @Test