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 <split apk path>:<on device install path> pairs whereas Soong
outputs <split apk path>:$(LOCAL_MODULE_PATH)/<split apk filename> pairs.

This also adds a missing underscore in split apk filenames.

Test: m Split
Bug: 140795853
Change-Id: I3d6506f5e12106174fbbaef34749a272b5e1b90c
This commit is contained in:
Jaewoong Jung 2019-09-27 17:13:15 -07:00
parent 0949f31657
commit 7dd4ae2fb9
2 changed files with 5 additions and 1 deletions

View File

@ -329,7 +329,8 @@ func (app *AndroidApp) AndroidMkEntries() android.AndroidMkEntries {
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", app.dexpreopter.builtInstalled) entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", app.dexpreopter.builtInstalled)
} }
for _, split := range app.aapt.splits { 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) entries.AddStrings("LOCAL_SOONG_BUILT_INSTALLED", split.path.String()+":"+install)
} }
}, },

View File

@ -128,6 +128,8 @@ type AndroidApp struct {
installDir android.OutputPath installDir android.OutputPath
onDeviceDir string
additionalAaptFlags []string additionalAaptFlags []string
noticeOutputs android.NoticeOutputs noticeOutputs android.NoticeOutputs
@ -449,6 +451,7 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
} else { } else {
a.installDir = android.PathForModuleInstall(ctx, "app", a.installApkName) a.installDir = android.PathForModuleInstall(ctx, "app", a.installApkName)
} }
a.onDeviceDir = android.InstallPathToOnDevicePath(ctx, a.installDir)
a.noticeBuildActions(ctx) a.noticeBuildActions(ctx)
if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") { if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") {