Add dependency on jsr305 am: 9af80ebdde am: 23df6fded1
Change-Id: Icfa0fcfc599c1072c7688f2886ee0f279a2a0fc4
diff --git a/Android.bp b/Android.bp
index 979740f..6c35394 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,6 +26,7 @@
static_libs: [
"exoplayer2-extractor-annotation-stubs",
"androidx.annotation_annotation",
+ "jsr305",
],
jarjar_rules: "exoplayer2-extractor-jarjar-rules.txt",
visibility: ["//frameworks/base:__subpackages__"],
@@ -39,6 +40,7 @@
host_supported: true,
sdk_version: "core_current",
srcs: ["annotation-stubs/src/**/*.java"],
+ static_libs: ["jsr305"],
visibility: ["//visibility:private"],
}
diff --git a/annotation-stubs/gen_annotations.sh b/annotation-stubs/gen_annotations.sh
index bec33eb..4fc6277 100755
--- a/annotation-stubs/gen_annotations.sh
+++ b/annotation-stubs/gen_annotations.sh
@@ -3,8 +3,6 @@
# Creates stubs for the checker framework annotations.
ANNOTATIONS=(
- javax.annotation.Nonnull
- javax.annotation.meta.TypeQualifierDefault
kotlin.annotations.jvm.UnderMigration
org.checkerframework.checker.initialization.qual.UnknownInitialization
org.checkerframework.checker.nullness.compatqual.NullableType
@@ -27,10 +25,6 @@
class=${a##*.}
dir=$(dirname $0)/src/${package//.//}
value_type="String[]"
- if [ "$a" == "javax.annotation.meta.TypeQualifierDefault" ]; then
- # javax.annotation.meta.TypeQualifierDefault conflicts with the template.
- value_type="ElementType[]"
- fi
file=${class}.java
mkdir -p ${dir}
sed -e"s/__PACKAGE__/${package}/"\
diff --git a/annotation-stubs/src/javax/annotation/Nonnull.java b/annotation-stubs/src/javax/annotation/Nonnull.java
deleted file mode 100644
index 4a09aed..0000000
--- a/annotation-stubs/src/javax/annotation/Nonnull.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import kotlin.annotations.jvm.MigrationStatus;
-
-// This is an annotation stub to avoid dependencies on annotations that aren't
-// in the Android platform source tree.
-
-@Target({
- ElementType.ANNOTATION_TYPE,
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.LOCAL_VARIABLE,
- ElementType.METHOD,
- ElementType.PACKAGE,
- ElementType.PARAMETER,
- ElementType.TYPE,
- ElementType.TYPE_PARAMETER,
- ElementType.TYPE_USE})
-@Retention(RetentionPolicy.SOURCE)
-public @interface Nonnull {
-
- // These fields maintain API compatibility with annotations that expect arguments.
-
- String[] value() default {};
-
- boolean result() default false;
-
- String expression() default "";
-
- MigrationStatus status() default MigrationStatus.IGNORE;
-
-}
diff --git a/annotation-stubs/src/javax/annotation/meta/TypeQualifierDefault.java b/annotation-stubs/src/javax/annotation/meta/TypeQualifierDefault.java
deleted file mode 100644
index 4294af0..0000000
--- a/annotation-stubs/src/javax/annotation/meta/TypeQualifierDefault.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.annotation.meta;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import kotlin.annotations.jvm.MigrationStatus;
-
-// This is an annotation stub to avoid dependencies on annotations that aren't
-// in the Android platform source tree.
-
-@Target({
- ElementType.ANNOTATION_TYPE,
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.LOCAL_VARIABLE,
- ElementType.METHOD,
- ElementType.PACKAGE,
- ElementType.PARAMETER,
- ElementType.TYPE,
- ElementType.TYPE_PARAMETER,
- ElementType.TYPE_USE})
-@Retention(RetentionPolicy.SOURCE)
-public @interface TypeQualifierDefault {
-
- // These fields maintain API compatibility with annotations that expect arguments.
-
- ElementType[] value() default {};
-
- boolean result() default false;
-
- String expression() default "";
-
- MigrationStatus status() default MigrationStatus.IGNORE;
-
-}