Install android_app_set modules in Soong

Add support for installing extra files from a zip file when installing
a primary file, and use it to support installing android_app_set modules,
which install a primary APK and then an unknown set of additional splits
APKs.

Test: app_set_test.go
Test: install test android_app_set
Bug: 204136549
Change-Id: Ia92f7e5c427adcef3bcf59c82a2f83450905c01d
This commit is contained in:
Colin Cross
2021-11-12 17:41:02 -08:00
parent ffbcd1d8a0
commit 50ed1f9ccb
4 changed files with 63 additions and 11 deletions

View File

@@ -143,8 +143,18 @@ func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext)
"zip": as.packedOutput.String(),
},
})
var installDir android.InstallPath
if as.Privileged() {
installDir = android.PathForModuleInstall(ctx, "priv-app", as.BaseModuleName())
} else {
installDir = android.PathForModuleInstall(ctx, "app", as.BaseModuleName())
}
ctx.InstallFileWithExtraFilesZip(installDir, as.BaseModuleName()+".apk", as.primaryOutput, as.packedOutput)
}
func (as *AndroidAppSet) InstallBypassMake() bool { return true }
// android_app_set extracts a set of APKs based on the target device
// configuration and installs this set as "split APKs".
// The extracted set always contains an APK whose name is