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
diff --git a/android/sdk_version.go b/android/sdk_version.go
index 01b55d0..a9b88fb 100644
--- a/android/sdk_version.go
+++ b/android/sdk_version.go
@@ -93,6 +93,15 @@
}
}
+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: