OSDN Git Service

64123323: Allow marking fields with @TargetApi(XX)
authorTor Norbye <tnorbye@google.com>
Mon, 31 Jul 2017 17:30:31 +0000 (10:30 -0700)
committerTor Norbye <tnorbye@google.com>
Thu, 3 Aug 2017 20:02:31 +0000 (20:02 +0000)
Test: Tested as part of lint
Change-Id: I52dcc0ea788ed916d23be4d7c9fb76755a1aa6b8

core/java/android/annotation/TargetApi.java

index ea17890..975318e 100644 (file)
@@ -16,6 +16,7 @@
 package android.annotation;
 
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.TYPE;
 
@@ -25,7 +26,7 @@ import java.lang.annotation.Target;
 
 /** Indicates that Lint should treat this type as targeting a given API level, no matter what the
     project target is. */
-@Target({TYPE, METHOD, CONSTRUCTOR})
+@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
 @Retention(RetentionPolicy.CLASS)
 public @interface TargetApi {
     /**