summaryrefslogtreecommitdiff
path: root/android/sdk_version.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2023-12-26 19:08:01 +0000
committer Jihoon Kang <jihoonkang@google.com> 2024-01-12 01:03:10 +0000
commitbd093457e2606e9525de0efa98e3c06eafe523af (patch)
tree0974977288681e5c72e9a285c1434890f9cc10aa /android/sdk_version.go
parent9272dccb1ea96dfbf0f8a0a1488a09ca9af11f15 (diff)
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
Diffstat (limited to 'android/sdk_version.go')
-rw-r--r--android/sdk_version.go11
1 files changed, 11 insertions, 0 deletions
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