From 7b3dc8a2598fd96c0f4149f7e6a9cf177c98c91b Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Fri, 16 Apr 2021 16:41:59 -0400 Subject: [PATCH] Support paths for vintf_fragments from Soong. The property vintf_fragments accepts paths and references to other modules; however, none of that is passed onto make, resulting in errors if a non-local path is used. Test: m Bug: 184567830 Change-Id: If3b56ea8eec3b95b3a310b58bffd045cedd8ee52 --- android/androidmk.go | 4 +++- apex/androidmk.go | 4 ++-- apex/apex_test.go | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/android/androidmk.go b/android/androidmk.go index 618e4be70..590eceba4 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -550,7 +550,9 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint if !amod.InRamdisk() && !amod.InVendorRamdisk() { a.AddPaths("LOCAL_FULL_INIT_RC", amod.initRcPaths) } - a.AddStrings("LOCAL_VINTF_FRAGMENTS", amod.commonProperties.Vintf_fragments...) + if len(amod.vintfFragmentsPaths) > 0 { + a.AddPaths("LOCAL_FULL_VINTF_FRAGMENTS", amod.vintfFragmentsPaths) + } a.SetBoolIfTrue("LOCAL_PROPRIETARY_MODULE", Bool(amod.commonProperties.Proprietary)) if Bool(amod.commonProperties.Vendor) || Bool(amod.commonProperties.Soc_specific) { a.SetString("LOCAL_VENDOR_MODULE", "true") diff --git a/apex/androidmk.go b/apex/androidmk.go index 9fc701d2c..06d3b54a6 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -284,7 +284,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo // To install companion files (init_rc, vintf_fragments) // Copy some common properties of apexBundle to apex_manifest commonProperties := []string{ - "LOCAL_FULL_INIT_RC", "LOCAL_VINTF_FRAGMENTS", + "LOCAL_FULL_INIT_RC", "LOCAL_FULL_VINTF_FRAGMENTS", } for _, name := range commonProperties { if value, ok := apexAndroidMkData.Entries.EntryMap[name]; ok { @@ -394,7 +394,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { // Because apex writes .mk with Custom(), we need to write manually some common properties // which are available via data.Entries commonProperties := []string{ - "LOCAL_FULL_INIT_RC", "LOCAL_VINTF_FRAGMENTS", + "LOCAL_FULL_INIT_RC", "LOCAL_FULL_VINTF_FRAGMENTS", "LOCAL_PROPRIETARY_MODULE", "LOCAL_VENDOR_MODULE", "LOCAL_ODM_MODULE", "LOCAL_PRODUCT_MODULE", "LOCAL_SYSTEM_EXT_MODULE", "LOCAL_MODULE_OWNER", } diff --git a/apex/apex_test.go b/apex/apex_test.go index 977a9544c..27a0a85b9 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -2755,7 +2755,7 @@ func TestAndroidMkWritesCommonProperties(t *testing.T) { var builder strings.Builder data.Custom(&builder, name, prefix, "", data) androidMk := builder.String() - ensureContains(t, androidMk, "LOCAL_VINTF_FRAGMENTS := fragment.xml\n") + ensureContains(t, androidMk, "LOCAL_FULL_VINTF_FRAGMENTS := fragment.xml\n") ensureContains(t, androidMk, "LOCAL_FULL_INIT_RC := init.rc\n") }