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

Commit a2c4cd7c authored by Paul Duffin's avatar Paul Duffin
Browse files

Update previous_api for droidstubs and java_api_library

Needed to ensure recently added nullability annotations `@Nullable` and
`@NonNull` are correctly replaced with `@RecentlyNullable` and
`@RecentlyNonNull` respectively.

Bug: 347751326
Test: # Build modules before and after this change and verify that
      # public stubs are unchanged but other stubs use the correct
      # nullability annotations.
Change-Id: If97859b6207f03c1dcd3a0cc9c44f82147449cad
parent bbaf5cbe
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -370,7 +370,6 @@ stubs_defaults {
    high_mem: true, // Lots of sources => high memory use, see b/170701554
    installable: false,
    annotations_enabled: true,
    previous_api: ":android.api.public.latest",
    merge_annotations_dirs: ["metalava-manual"],
    defaults_visibility: ["//frameworks/base/api"],
    visibility: [
+27 −1
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@ non_updatable_exportable_droidstubs {
        "android-non-updatable-stubs-defaults",
        "module-classpath-stubs-defaults",
    ],
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.public.latest",
    check_api: {
        current: {
            api_file: ":non-updatable-current.txt",
@@ -118,6 +121,9 @@ non_updatable_exportable_droidstubs {
        "module-classpath-stubs-defaults",
    ],
    flags: priv_apps,
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.system.latest",
    check_api: {
        current: {
            api_file: ":non-updatable-system-current.txt",
@@ -178,6 +184,9 @@ non_updatable_exportable_droidstubs {
        "module-classpath-stubs-defaults",
    ],
    flags: test + priv_apps_in_stubs,
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.test.latest",
    check_api: {
        current: {
            api_file: ":non-updatable-test-current.txt",
@@ -257,6 +266,9 @@ non_updatable_exportable_droidstubs {
        "module-classpath-stubs-defaults",
    ],
    flags: priv_apps_in_stubs + module_libs,
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.module-lib.latest",
    check_api: {
        current: {
            api_file: ":non-updatable-module-lib-current.txt",
@@ -571,6 +583,9 @@ java_api_library {
    ],
    defaults: ["android-non-updatable_everything_from_text_defaults"],
    full_api_surface_stub: "android_stubs_current.from-text",
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.public.latest",
}

java_api_library {
@@ -582,6 +597,9 @@ java_api_library {
    ],
    defaults: ["android-non-updatable_everything_from_text_defaults"],
    full_api_surface_stub: "android_system_stubs_current.from-text",
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.system.latest",
}

java_api_library {
@@ -594,6 +612,9 @@ java_api_library {
    ],
    defaults: ["android-non-updatable_everything_from_text_defaults"],
    full_api_surface_stub: "android_test_stubs_current.from-text",
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.test.latest",
}

java_api_library {
@@ -606,6 +627,9 @@ java_api_library {
    ],
    defaults: ["android-non-updatable_everything_from_text_defaults"],
    full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
    // Use full Android API not just the non-updatable API as the latter is incomplete
    // and can result in incorrect behavior.
    previous_api: ":android.api.combined.module-lib.latest",
}

// This module generates a stub jar that is a union of the test and module lib
@@ -623,6 +647,8 @@ java_api_library {
    defaults: ["android-non-updatable_everything_from_text_defaults"],
    full_api_surface_stub: "android_test_module_lib_stubs_current.from-text",

    // No need to specify previous_api as this is not used for compiling against.

    // This module is only used for hiddenapi, and other modules should not
    // depend on this module.
    visibility: ["//visibility:private"],
@@ -922,7 +948,7 @@ java_defaults {
        "i18n.module.public.api.stubs.source.system.api.contribution",
        "i18n.module.public.api.stubs.source.module_lib.api.contribution",
    ],
    previous_api: ":android.api.public.latest",
    previous_api: ":android.api.combined.module-lib.latest",
}

// Java API library definitions per API surface
+1 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ func createApiContributionDefaults(ctx android.LoadHookContext, modules []string
		props.Api_contributions = transformArray(
			modules, "", fmt.Sprintf(".stubs.source%s.api.contribution", apiSuffix))
		props.Defaults_visibility = []string{"//visibility:public"}
		props.Previous_api = proptools.StringPtr(":android.api.public.latest")
		props.Previous_api = proptools.StringPtr(":android.api.combined." + sdkKind.String() + ".latest")
		ctx.CreateModule(java.DefaultsFactory, &props)
	}
}