diff options
author | 2024-08-21 20:42:18 +0000 | |
---|---|---|
committer | 2024-08-22 22:05:03 +0000 | |
commit | fa3f0782f7b1f179435f19d37e7e348cff626695 (patch) | |
tree | c27f01eae78d8a0b6d719b6a85e1bc2cacf9c294 /android/sdk_version.go | |
parent | 5fdb54d4393505a38d25fa633ea11968ebbf1316 (diff) |
Remove suffix based stub matching logic
This change prevents non-stub modules with stub suffix from being
determined as the stub module, and instead makes the check more robust
by determining the condition based on the user-hidden
`Stub_contributing_api` property, which is only set for the stub
submodules generated by `java_sdk_library`.
Test: m nothing --no-skip-soong-tests
Bug: 361179822
Change-Id: I28a599c5b4fe1e8460e60580c0535aaf19e39ba3
Diffstat (limited to 'android/sdk_version.go')
-rw-r--r-- | android/sdk_version.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/android/sdk_version.go b/android/sdk_version.go index 01b55d0da..a9b88fbce 100644 --- a/android/sdk_version.go +++ b/android/sdk_version.go @@ -93,6 +93,15 @@ func (k SdkKind) String() string { } } +func ToSdkKind(s string) SdkKind { + for kind := SdkNone; kind <= SdkPrivate; kind++ { + if s == kind.String() { + return kind + } + } + return SdkInvalid +} + func (k SdkKind) DefaultJavaLibraryName() string { switch k { case SdkPublic: |