Don't export ART's internal optimization annotations to current.txt

The annotations on a method don't need to be stable, and only relevant
for internal optimization. Thus, they shouldn't be exported.

Bug: 238464188
Bug: 286227899
Test: m droid
Change-Id: I0a57dc7298b7b6492d425b99ce8ad336b3073a84
Merged-In: I0a57dc7298b7b6492d425b99ce8ad336b3073a84
diff --git a/src/main/java/com/android/tools/metalava/model/AnnotationItem.kt b/src/main/java/com/android/tools/metalava/model/AnnotationItem.kt
index 26cea66..73b3efc 100644
--- a/src/main/java/com/android/tools/metalava/model/AnnotationItem.kt
+++ b/src/main/java/com/android/tools/metalava/model/AnnotationItem.kt
@@ -409,6 +409,13 @@
                 "kotlin.UseExperimental",
                 "kotlin.OptIn" -> return NO_ANNOTATION_TARGETS
 
+                // These optimization-related annotations shouldn't be exported.
+                "dalvik.annotation.optimization.CriticalNative",
+                "dalvik.annotation.optimization.FastNative",
+                "dalvik.annotation.optimization.NeverCompile",
+                "dalvik.annotation.optimization.ReachabilitySensitive" ->
+                    return NO_ANNOTATION_TARGETS
+
                 // TODO(aurimas): consider using annotation directly instead of modifiers
                 "kotlin.Deprecated" -> return NO_ANNOTATION_TARGETS // tracked separately as a pseudo-modifier
                 "android.annotation.DeprecatedForSdk",