Merge "Build VNDK with VNDK prebuilts without BOARD_VNDK_VERSION" into main

This commit is contained in:
Treehugger Robot
2024-02-02 01:06:37 +00:00
committed by Gerrit Code Review
4 changed files with 15 additions and 92 deletions

View File

@@ -131,11 +131,14 @@ func (p *vndkPrebuiltLibraryDecorator) singleSourcePath(ctx ModuleContext) andro
func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext,
flags Flags, deps PathDeps, objs Objects) android.Path {
platformVndkApiLevel := android.ApiLevelOrPanic(ctx, ctx.DeviceConfig().PlatformVndkVersion())
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(ctx, p.Version())) {
// This prebuilt VNDK module is not required for the current build
ctx.Module().HideFromMake()
return nil
platformVndkVersion := ctx.DeviceConfig().PlatformVndkVersion()
if platformVndkVersion != "" {
platformVndkApiLevel := android.ApiLevelOrPanic(ctx, platformVndkVersion)
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(ctx, p.Version())) {
// This prebuilt VNDK module is not required for the current build
ctx.Module().HideFromMake()
return nil
}
}
if !p.MatchesWithDevice(ctx.DeviceConfig()) {
@@ -247,14 +250,6 @@ func vndkPrebuiltSharedLibrary() *Module {
&prebuilt.properties,
)
android.AddLoadHook(module, func(ctx android.LoadHookContext) {
// empty BOARD_VNDK_VERSION implies that the device won't support
// system only OTA. In this case, VNDK snapshots aren't needed.
if ctx.DeviceConfig().VndkVersion() == "" {
ctx.Module().Disable()
}
})
return module
}