From bd093457e2606e9525de0efa98e3c06eafe523af Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Tue, 26 Dec 2023 19:08:01 +0000 Subject: Enable hiddenapi check for exportable stubs This change modifies the dependencies of the hiddenapi to always depend on the exportable stubs, instead of the currently utilized everything stubs. To support this, the full api surface exportable stubs are defined in a separate change at the `frameworks/base` project. Note that the full api surface exportable stubs are only used for the hiddenapi purpose, and `sdk_version` continues to utilize the currently existing everything stubs. Currently, this feature is hidden behind the build flag "RELEASE_HIDDEN_API_EXPORTABLE_STUBS". This feature will be fully enabled once metalava fully supports handling of the flagged apis. Test: ENABLE_HIDDENAPI_FLAGS=true m Bug: 317426356 Change-Id: I109b7cd27b20ceffcdf1766ab8106b0c276be2b3 --- android/sdk_version.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'android/sdk_version.go') diff --git a/android/sdk_version.go b/android/sdk_version.go index 73568af8a..9355667d1 100644 --- a/android/sdk_version.go +++ b/android/sdk_version.go @@ -109,6 +109,17 @@ func (k SdkKind) DefaultJavaLibraryName() string { } } +func (k SdkKind) DefaultExportableJavaLibraryName() string { + switch k { + case SdkPublic, SdkSystem, SdkTest, SdkModule, SdkSystemServer: + return k.DefaultJavaLibraryName() + "_exportable" + case SdkCore: + return k.DefaultJavaLibraryName() + ".exportable" + default: + panic(fmt.Errorf("API surface %v does not provide exportable stubs", k)) + } +} + // SdkSpec represents the kind and the version of an SDK for a module to build against type SdkSpec struct { Kind SdkKind -- cgit v1.2.3-59-g8ed1b