Revert "Enforce min_sdk_version of apex(use_vendor:true)"
This reverts commit 380fc3615cf8c837e25dd7c480f8ce579ffd5d90.
Reason for revert: breaking one of internal targets
Change-Id: Ica96c44078e5a7f674410828af3ba851317775dd
Exempt-From-Owner-Approval: revert to fix build failure
diff --git a/cc/cc.go b/cc/cc.go
index 2009d91..61ae10a 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -622,10 +622,6 @@
c.Properties.PreventInstall = true
return
}
- if _, ok := c.linker.(*llndkStubDecorator); ok {
- c.Properties.HideFromMake = true
- return
- }
}
panic(fmt.Errorf("SetBuildStubs called on non-library module: %q", c.BaseModuleName()))
}
@@ -645,10 +641,6 @@
library.MutatedProperties.StubsVersion = version
return
}
- if llndk, ok := c.linker.(*llndkStubDecorator); ok {
- llndk.libraryDecorator.MutatedProperties.StubsVersion = version
- return
- }
}
panic(fmt.Errorf("SetStubsVersions called on non-library module: %q", c.BaseModuleName()))
}
@@ -658,9 +650,6 @@
if library, ok := c.linker.(*libraryDecorator); ok {
return library.MutatedProperties.StubsVersion
}
- if llndk, ok := c.linker.(*llndkStubDecorator); ok {
- return llndk.libraryDecorator.MutatedProperties.StubsVersion
- }
}
panic(fmt.Errorf("StubsVersion called on non-library module: %q", c.BaseModuleName()))
}
@@ -1862,7 +1851,7 @@
addSharedLibDependencies := func(depTag DependencyTag, name string, version string) {
var variations []blueprint.Variation
variations = append(variations, blueprint.Variation{Mutator: "link", Variation: "shared"})
- versionVariantAvail := !c.InRecovery() && !c.InRamdisk()
+ versionVariantAvail := !ctx.useVndk() && !c.InRecovery() && !c.InRamdisk()
if version != "" && versionVariantAvail {
// Version is explicitly specified. i.e. libFoo#30
variations = append(variations, blueprint.Variation{Mutator: "version", Variation: version})
@@ -2197,17 +2186,13 @@
if depTag == android.ProtoPluginDepTag {
return
}
- if depTag == llndkImplDep {
- return
- }
if dep.Target().Os != ctx.Os() {
ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), depName)
return
}
if dep.Target().Arch.ArchType != ctx.Arch().ArchType {
- ctx.ModuleErrorf("Arch mismatch between %q(%v) and %q(%v)",
- ctx.ModuleName(), ctx.Arch().ArchType, depName, dep.Target().Arch.ArchType)
+ ctx.ModuleErrorf("Arch mismatch between %q and %q", ctx.ModuleName(), depName)
return
}
@@ -2302,27 +2287,6 @@
return // stop processing this dep
}
}
- if c.UseVndk() {
- if m, ok := ccDep.(*Module); ok && m.IsStubs() { // LLNDK
- // by default, use current version of LLNDK
- versionToUse := ""
- versions := stubsVersionsFor(ctx.Config())[depName]
- if c.ApexName() != "" && len(versions) > 0 {
- // if this is for use_vendor apex && dep has stubsVersions
- // apply the same rule of apex sdk enforcement to choose right version
- var err error
- useLatest := c.ShouldSupportAndroid10() && !ctx.Config().UnbundledBuild()
- versionToUse, err = c.ChooseSdkVersion(versions, useLatest)
- if err != nil {
- ctx.OtherModuleErrorf(dep, err.Error())
- return
- }
- }
- if versionToUse != ccDep.StubsVersion() {
- return
- }
- }
- }
depPaths.IncludeDirs = append(depPaths.IncludeDirs, ccDep.IncludeDirs()...)