From 7dd4ae2fb9660521738b658502337d1432400421 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Fri, 27 Sep 2019 17:13:15 -0700 Subject: [PATCH] Fix split apk paths. Soong has been outputting incorrect Android.mk entries for split apks. soong_app_prebuilt.mk expects LOCAL_SOONG_BUILT_INSTALLED to contain a list of : pairs whereas Soong outputs :$(LOCAL_MODULE_PATH)/ pairs. This also adds a missing underscore in split apk filenames. Test: m Split Bug: 140795853 Change-Id: I3d6506f5e12106174fbbaef34749a272b5e1b90c --- java/androidmk.go | 3 ++- java/app.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/androidmk.go b/java/androidmk.go index 032dc6ac2..bc61297d1 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -329,7 +329,8 @@ func (app *AndroidApp) AndroidMkEntries() android.AndroidMkEntries { entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", app.dexpreopter.builtInstalled) } for _, split := range app.aapt.splits { - install := "$(LOCAL_MODULE_PATH)/" + strings.TrimSuffix(app.installApkName, ".apk") + split.suffix + ".apk" + install := app.onDeviceDir + "/" + + strings.TrimSuffix(app.installApkName, ".apk") + "_" + split.suffix + ".apk" entries.AddStrings("LOCAL_SOONG_BUILT_INSTALLED", split.path.String()+":"+install) } }, diff --git a/java/app.go b/java/app.go index 014ead4e5..3ee8b8d1b 100644 --- a/java/app.go +++ b/java/app.go @@ -128,6 +128,8 @@ type AndroidApp struct { installDir android.OutputPath + onDeviceDir string + additionalAaptFlags []string noticeOutputs android.NoticeOutputs @@ -449,6 +451,7 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) { } else { a.installDir = android.PathForModuleInstall(ctx, "app", a.installApkName) } + a.onDeviceDir = android.InstallPathToOnDevicePath(ctx, a.installDir) a.noticeBuildActions(ctx) if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") {