Use 'stem' to override APK name

When android_app.stem is set, use it as the APK name like other module
types.

Bug: 193504286
Test: m (soong test)
Change-Id: I4c95b77be382cff3cfecaf6ce38f99aed9f3238f
This commit is contained in:
Jooyung Han
2022-01-08 12:13:59 +09:00
parent 6609484961
commit 29e2f6d2c4
3 changed files with 23 additions and 4 deletions

View File

@@ -621,7 +621,7 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
a.aapt.useEmbeddedDex = Bool(a.appProperties.Use_embedded_dex)
// Check if the install APK name needs to be overridden.
a.installApkName = ctx.DeviceConfig().OverridePackageNameFor(a.Name())
a.installApkName = ctx.DeviceConfig().OverridePackageNameFor(a.Stem())
if ctx.ModuleName() == "framework-res" {
// framework-res.apk is installed as system/framework/framework-res.apk
@@ -1006,6 +1006,7 @@ func (a *AndroidTest) FixTestConfig(ctx android.ModuleContext, testConfig androi
command := rule.Command().BuiltTool("test_config_fixer").Input(testConfig).Output(fixedConfig)
fixNeeded := false
// Auto-generated test config uses `ModuleName` as the APK name. So fix it if it is not the case.
if ctx.ModuleName() != a.installApkName {
fixNeeded = true
command.FlagWithArg("--test-file-name ", a.installApkName+".apk")