From 2416ec1cb59a9933ca8308e96ec4f19435ae5dbc Mon Sep 17 00:00:00 2001 From: ibaker Date: Tue, 11 Jun 2024 10:15:31 -0700 Subject: [PATCH] Update `@UnstableApi` docs with a link to DAC The code snippets in javadoc don't render correctly due to https://issuetracker.google.com/342557694 PiperOrigin-RevId: 642309632 --- .../media3/common/util/UnstableApi.java | 48 ++----------------- 1 file changed, 4 insertions(+), 44 deletions(-) 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 f5793a071b..29d11cb3ff 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,50 +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 or whole packages can be opted-in to suppress the lint error by using - * the {@link androidx.annotation.OptIn} annotation. - * - *

In a Java class: - * - *

{@code
- * import androidx.annotation.OptIn;
- * import androidx.media3.common.util.UnstableApi;
- * ...
- * @OptIn(markerClass = UnstableApi.class)
- * 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
- * import androidx.annotation.OptIn
- * import androidx.media3.common.util.UnstableApi
- * ...
- * @OptIn(UnstableApi::class)
- * private fun methodUsingUnstableApis() { ... }
- * }
- * - *

Whole projects can be opted-in by suppressing the specific lint error in their {@code lint.xml} file: - * - *

{@code
- * 
- * 
- *   
- *     
- * 
- * }
+ *

See the + * troubleshooting section on these lint errors for details on how to annotate Java and Kotlin + * usages with {@code @OptIn}. */ @Documented @Retention(CLASS)