Merge "apex: respect filename property for apk-in-apex" am: 79a24f2ca8 am: 4c70b2800f

Change-Id: I8077fdf16054e2c1f958af4a2ce4452767b5fa8f
This commit is contained in:
Jooyung Han
2020-04-18 03:22:38 +00:00
committed by Automerger Merge Worker
3 changed files with 62 additions and 12 deletions

View File

@@ -1751,15 +1751,16 @@ func apexFileForCompatConfig(ctx android.BaseModuleContext, config java.Platform
func apexFileForAndroidApp(ctx android.BaseModuleContext, aapp interface {
android.Module
Privileged() bool
InstallApkName() string
OutputFile() android.Path
JacocoReportClassesFile() android.Path
Certificate() java.Certificate
}, pkgName string) apexFile {
}) apexFile {
appDir := "app"
if aapp.Privileged() {
appDir = "priv-app"
}
dirInApex := filepath.Join(appDir, pkgName)
dirInApex := filepath.Join(appDir, aapp.InstallApkName())
fileToCopy := aapp.OutputFile()
af := newApexFile(ctx, fileToCopy, aapp.Name(), dirInApex, app, aapp)
af.jacocoReportClassesFile = aapp.JacocoReportClassesFile()
@@ -2047,14 +2048,13 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child))
}
case androidAppTag:
pkgName := ctx.DeviceConfig().OverridePackageNameFor(depName)
if ap, ok := child.(*java.AndroidApp); ok {
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap, pkgName))
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap))
return true // track transitive dependencies
} else if ap, ok := child.(*java.AndroidAppImport); ok {
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap, pkgName))
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap))
} else if ap, ok := child.(*java.AndroidTestHelperApp); ok {
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap, pkgName))
filesInfo = append(filesInfo, apexFileForAndroidApp(ctx, ap))
} else {
ctx.PropertyErrorf("apps", "%q is not an android_app module", depName)
}