From 7aa3f76696e3a7a5acbb56af42fa818daf57c155 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 28 Jan 2020 16:51:34 +0900 Subject: [PATCH] Remove unnecessary symlink for non-flattend APEXes This change fixes a bug that symlinks to the system partition are created in /system/apex/ directories even when the APEXes are non-flattened. The symlinks are needed only for flattened APEX (of course regardless of whether the APEX is a primary one or not). Bug: N/A Test: examine /system/apex directory manually Change-Id: I00bb1423d0a2497408f05e49767b42437210bab8 --- apex/androidmk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apex/androidmk.go b/apex/androidmk.go index 5fa5bf062..34915cd28 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -177,7 +177,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string) fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_cc_prebuilt.mk") } else { fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.builtFile.Base()) - if fi.builtFile == a.manifestPbOut { + if fi.builtFile == a.manifestPbOut && apexType == flattenedApex { if a.primaryApexType { // Make apex_manifest.pb module for this APEX to override all other // modules in the APEXes being overridden by this APEX @@ -187,7 +187,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string) } fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(patterns, " ")) - if apexType == flattenedApex && len(a.compatSymlinks) > 0 { + if len(a.compatSymlinks) > 0 { // For flattened apexes, compat symlinks are attached to apex_manifest.json which is guaranteed for every apex postInstallCommands = append(postInstallCommands, a.compatSymlinks...) }