From 2b96bf544113e70d1a27929ae6e170847a20f4cb Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Mon, 17 Feb 2020 18:00:39 +0900 Subject: [PATCH] Do not hide VNDK prebuilts from make Flattened APEXes don't install modules hidden from make. This CL unhides VNDK prebuilt modules to make VNDK APEX work correctly. The suffix for VNDK prebuilt is still omitted if the version of prebuilt is same with BOARD_VNDK_VERSION. Bug: 149542527 Test: build arm64 GSI and flash Test: Set BOARD_VNDK_VERSION and build Change-Id: I54a7c14c93eccfefc81603ec3bb474a031bc55af --- cc/androidmk.go | 5 +---- cc/vndk_prebuilt.go | 19 +++++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cc/androidmk.go b/cc/androidmk.go index d8210fc9b..c9e1cbb24 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -413,12 +413,9 @@ func (c *llndkStubDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Androi } func (c *vndkPrebuiltLibraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) { - // Each vndk prebuilt is exported to androidMk only when BOARD_VNDK_VERSION != current - // and the version of the prebuilt is same as BOARD_VNDK_VERSION. ret.Class = "SHARED_LIBRARIES" - // shouldn't add any suffixes due to mk modules - ret.SubName = "" + ret.SubName = c.androidMkSuffix ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) { c.libraryDecorator.androidMkWriteExportedFlags(w) diff --git a/cc/vndk_prebuilt.go b/cc/vndk_prebuilt.go index 50bc32592..53b518186 100644 --- a/cc/vndk_prebuilt.go +++ b/cc/vndk_prebuilt.go @@ -72,7 +72,8 @@ type vndkPrebuiltProperties struct { type vndkPrebuiltLibraryDecorator struct { *libraryDecorator - properties vndkPrebuiltProperties + properties vndkPrebuiltProperties + androidMkSuffix string } func (p *vndkPrebuiltLibraryDecorator) Name(name string) string { @@ -153,6 +154,13 @@ func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext, p.tocFile = android.OptionalPathForPath(tocFile) TransformSharedObjectToToc(ctx, in, tocFile, builderFlags) + p.androidMkSuffix = p.NameSuffix() + + vndkVersion := ctx.DeviceConfig().VndkVersion() + if vndkVersion == p.version() { + p.androidMkSuffix = "" + } + return in } @@ -224,15 +232,6 @@ func vndkPrebuiltSharedLibrary() *Module { &prebuilt.properties, ) - android.AddLoadHook(module, func(ctx android.LoadHookContext) { - // Only vndk snapshots of BOARD_VNDK_VERSION will be used when building. - if prebuilt.version() != ctx.DeviceConfig().VndkVersion() { - module.SkipInstall() - module.Properties.HideFromMake = true - return - } - }) - return module }