From 0a51aa2c98f1d11087cbbd7ebac8a569126a6347 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Tue, 21 Jul 2020 11:13:17 -0700 Subject: [PATCH] Use RelativeInstallPath for DataPaths in apex The RelativeInstallPath is currently unused for apexes; however, as it stands, relative install paths would be handled differently for flattened and unflattened apexes. Test: go java test Test m nothing Change-Id: Iad9350642cad27c4f745cea6e5fc9e11e7b06ee4 --- apex/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apex/builder.go b/apex/builder.go index 81f813172..a70c7672c 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -409,7 +409,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { panic(fmt.Errorf("path %q does not end with %q", dataPath, relPath)) } - dataDest := android.PathForModuleOut(ctx, "image"+suffix, fi.apexRelativePath(relPath)).String() + dataDest := android.PathForModuleOut(ctx, "image"+suffix, fi.apexRelativePath(relPath), d.RelativeInstallPath).String() copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest) implicitInputs = append(implicitInputs, d.SrcPath) @@ -473,7 +473,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") { executablePaths = append(executablePaths, pathInApex) for _, d := range f.dataPaths { - readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.SrcPath.Rel())) + readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.RelativeInstallPath, d.SrcPath.Rel())) } for _, s := range f.symlinks { executablePaths = append(executablePaths, filepath.Join(f.installDir, s))