Clean up LLNDK stubs
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.
This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.
Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
diff --git a/cc/library.go b/cc/library.go
index e2b4d4f..5129572 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1913,12 +1913,15 @@
}
if library.hasLLNDKStubs() && ctx.Module().(*Module).InVendorOrProduct() {
- // LLNDK libraries only need a single stubs variant.
- return []string{android.FutureApiLevel.String()}
+ // LLNDK libraries only need a single stubs variant (""), which is
+ // added automatically in createVersionVariations().
+ return nil
}
// Future API level is implicitly added if there isn't
- return addCurrentVersionIfNotPresent(library.Properties.Stubs.Versions)
+ versions := addCurrentVersionIfNotPresent(library.Properties.Stubs.Versions)
+ normalizeVersions(ctx, versions)
+ return versions
}
func addCurrentVersionIfNotPresent(vers []string) []string {
@@ -2290,10 +2293,6 @@
return
}
versions := library.stubsVersions(mctx)
- if len(versions) <= 0 {
- return
- }
- normalizeVersions(mctx, versions)
if mctx.Failed() {
return
}