diff --git a/libraries/common/src/main/java/androidx/media3/common/util/UnstableApi.java b/libraries/common/src/main/java/androidx/media3/common/util/UnstableApi.java index 3ea66b64ad..c05311052d 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/UnstableApi.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/UnstableApi.java @@ -55,10 +55,10 @@ import java.lang.annotation.Target; *
By default usages of APIs annotated with this annotation generate lint errors in Gradle and * Android Studio, in order to alert developers to the risk of breaking changes. * - *
Individual usage sites can be opted-in to suppress the lint error by using the {@link - * androidx.annotation.OptIn} annotation. + *
Individual usage sites or whole packages can be opted-in to suppress the lint error by using + * the {@link androidx.annotation.OptIn} annotation. * - *
In Java: + *
In a Java class: * *
{@code
* import androidx.annotation.OptIn;
@@ -68,6 +68,16 @@ import java.lang.annotation.Target;
* private void methodUsingUnstableApis() { ... }
* }
*
+ * In a {@code package-info.java} file, to opt-in a whole package: + * + *
{@code
+ * @OptIn(markerClass = UnstableApi.class)
+ * package name.of.your.package;
+ *
+ * import androidx.annotation.OptIn;
+ * import androidx.media3.common.util.UnstableApi;
+ * }
+ *
* In Kotlin: * *
{@code