summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2020-05-20 12:06:23 +0100
committerAnton Hansson <hansson@google.com>2020-05-20 12:55:43 +0100
commitf330f3ab74ab8d89afd4e67df58656185f35f19c (patch)
tree87f8cf52187664f3fc68db51ddab10cfb98b5273
parent7677548d096407677c3fef7c281464e22470ddcc (diff)
Remove nullablility annotations from module-lib
They were added to workaround the problem of package-private versions being added to the stubs, which prevented use of the annotations from mainline modules. Having them in the API leads to a different problem -- this version of the nullability annotations have SOURCE retention. However in the stubs build we want to have CLASS retention, so that kotlin can make use of their presence. This is arguably a much cleaner fix, since having a source-retention annotation doesn't really make much sense. Bug: 157010342 Test: m Change-Id: Id78f00da5b6af2930224a82faa24cb8235362521 Merged-In: Id78f00da5b6af2930224a82faa24cb8235362521
-rw-r--r--StubLibraries.bp5
-rw-r--r--api/module-lib-current.txt10
-rw-r--r--core/java/android/annotation/NonNull.java3
-rw-r--r--core/java/android/annotation/Nullable.java3
4 files changed, 3 insertions, 18 deletions
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 63478aba2fbd..2aa8f43a76ea 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -259,8 +259,6 @@ java_defaults {
name: "android_defaults_stubs_current",
libs: [ "stub-annotations" ],
static_libs: [
- "private-stub-annotations-jar",
-
// License notices from art module
"art-notices-for-framework-stubs-jar",
],
@@ -278,18 +276,21 @@ java_defaults {
java_library_static {
name: "android_stubs_current",
srcs: [ ":api-stubs-docs" ],
+ static_libs: [ "private-stub-annotations-jar" ],
defaults: ["android_defaults_stubs_current"],
}
java_library_static {
name: "android_system_stubs_current",
srcs: [ ":system-api-stubs-docs" ],
+ static_libs: [ "private-stub-annotations-jar" ],
defaults: ["android_defaults_stubs_current"],
}
java_library_static {
name: "android_test_stubs_current",
srcs: [ ":test-api-stubs-docs" ],
+ static_libs: [ "private-stub-annotations-jar" ],
defaults: ["android_defaults_stubs_current"],
}
diff --git a/api/module-lib-current.txt b/api/module-lib-current.txt
index e91fe25009b2..67afc3225f7b 100644
--- a/api/module-lib-current.txt
+++ b/api/module-lib-current.txt
@@ -1,14 +1,4 @@
// Signature format: 2.0
-package android.annotation {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface NonNull {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface Nullable {
- }
-
-}
-
package android.net {
public final class TetheredClient implements android.os.Parcelable {
diff --git a/core/java/android/annotation/NonNull.java b/core/java/android/annotation/NonNull.java
index c5aff9d6794e..20472bacf6ad 100644
--- a/core/java/android/annotation/NonNull.java
+++ b/core/java/android/annotation/NonNull.java
@@ -20,8 +20,6 @@ import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.SOURCE;
-import android.annotation.SystemApi.Client;
-
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -36,6 +34,5 @@ import java.lang.annotation.Target;
*/
@Retention(SOURCE)
@Target({METHOD, PARAMETER, FIELD})
-@SystemApi(client = Client.MODULE_LIBRARIES)
public @interface NonNull {
}
diff --git a/core/java/android/annotation/Nullable.java b/core/java/android/annotation/Nullable.java
index 2fcddfab9375..b8473e750c95 100644
--- a/core/java/android/annotation/Nullable.java
+++ b/core/java/android/annotation/Nullable.java
@@ -20,8 +20,6 @@ import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.SOURCE;
-import android.annotation.SystemApi.Client;
-
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -43,6 +41,5 @@ import java.lang.annotation.Target;
*/
@Retention(SOURCE)
@Target({METHOD, PARAMETER, FIELD})
-@SystemApi(client = Client.MODULE_LIBRARIES)
public @interface Nullable {
}