mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Update @UnstableApi docs to include a package-info.java example
#minor-release
PiperOrigin-RevId: 572229092
(cherry picked from commit 7009c53c79)
This commit is contained in:
parent
292701ba55
commit
2ec24ac55f
1 changed files with 13 additions and 3 deletions
|
|
@ -55,10 +55,10 @@ import java.lang.annotation.Target;
|
|||
* <p>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.
|
||||
*
|
||||
* <p>Individual usage sites can be opted-in to suppress the lint error by using the {@link
|
||||
* androidx.annotation.OptIn} annotation.
|
||||
* <p>Individual usage sites or whole packages can be opted-in to suppress the lint error by using
|
||||
* the {@link androidx.annotation.OptIn} annotation.
|
||||
*
|
||||
* <p>In Java:
|
||||
* <p>In a Java class:
|
||||
*
|
||||
* <pre>{@code
|
||||
* import androidx.annotation.OptIn;
|
||||
|
|
@ -68,6 +68,16 @@ import java.lang.annotation.Target;
|
|||
* private void methodUsingUnstableApis() { ... }
|
||||
* }</pre>
|
||||
*
|
||||
* <p>In a {@code package-info.java} file, to opt-in a whole package:
|
||||
*
|
||||
* <pre>{@code
|
||||
* @OptIn(markerClass = UnstableApi.class)
|
||||
* package name.of.your.package;
|
||||
*
|
||||
* import androidx.annotation.OptIn;
|
||||
* import androidx.media3.common.util.UnstableApi;
|
||||
* }</pre>
|
||||
*
|
||||
* <p>In Kotlin:
|
||||
*
|
||||
* <pre>{@code
|
||||
|
|
|
|||
Loading…
Reference in a new issue