diff options
author | Cole Faust <colefaust@google.com> | 2024-02-01 09:50:18 -0800 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2024-02-09 01:56:01 +0000 |
commit | c5b696f4cb36b748ff326f1d79a532543d49112b (patch) | |
tree | d90ea694a7f2e8e06dc0676de4aba12aafa4be7f | |
parent | 666e8f1f3694f8ebd6b783ffd0699c217b214a8b (diff) | |
download | modules-utils-c5b696f4cb36b748ff326f1d79a532543d49112b.tar.gz |
Change RequiresApi annotation to class retention
So that it can still have an effect when compiling against a library
that uses it. This is also consistent with androidx's RequiresApi
annotation (binary retention is the kotlin version of class retention): https://developer.android.com/reference/androidx/annotation/RequiresApi
Bug: 323366771
Test: Presubmits
Change-Id: Ie397e665ed38877b1a2a9e85183d149dad523fc0
-rw-r--r-- | java/android/annotation/RequiresApi.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/android/annotation/RequiresApi.java b/java/android/annotation/RequiresApi.java index 2b857cc..18afbf1 100644 --- a/java/android/annotation/RequiresApi.java +++ b/java/android/annotation/RequiresApi.java @@ -20,7 +20,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PACKAGE; import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.SOURCE; +import static java.lang.annotation.RetentionPolicy.CLASS; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -36,7 +36,7 @@ import java.lang.annotation.Target; * @hide */ @Documented -@Retention(SOURCE) +@Retention(CLASS) @Target({TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE}) public @interface RequiresApi { /** |