Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 206be52a authored by Anton Hansson's avatar Anton Hansson
Browse files

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
parent 44cb762e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -254,7 +254,6 @@ droidstubs {
java_defaults {
    name: "android_defaults_stubs_current",
    libs: [ "stub-annotations" ],
    static_libs: [ "private-stub-annotations-jar" ],
    errorprone: {
        javacflags: [
            "-XepDisableAllChecks",
@@ -270,18 +269,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"],
}

+0 −10
Original line number Diff line number Diff line
// 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 {
+0 −3
Original line number Diff line number Diff line
@@ -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 {
}
+0 −3
Original line number Diff line number Diff line
@@ -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 {
}