Allow PrevVendorApiLevel to be less than 34
Some developers need to set VendorApiLevel to 34. Though the
configuration is not officially supported, the ABI checker supports it
on a best-effort basis.
Test: make
Bug: 320347314
Change-Id: Ic3f5ea2028329f5d04606760b07947b7c98b2e51
diff --git a/android/config.go b/android/config.go
index f0854f9..9f009e4 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1348,13 +1348,16 @@
panic(fmt.Errorf("Cannot parse vendor API level %s to an integer: %s",
c.VendorApiLevel(), err))
}
- if vendorApiLevel < 202404 || vendorApiLevel%100 != 4 {
- panic("Unknown vendor API level " + c.VendorApiLevel())
- }
// The version before trunk stable is 34.
if vendorApiLevel == 202404 {
return "34"
}
+ if vendorApiLevel >= 1 && vendorApiLevel <= 34 {
+ return strconv.Itoa(vendorApiLevel - 1)
+ }
+ if vendorApiLevel < 202404 || vendorApiLevel%100 != 4 {
+ panic("Unknown vendor API level " + c.VendorApiLevel())
+ }
return strconv.Itoa(vendorApiLevel - 100)
}