Change install name of privapp allowlists
Use the APK's filename as the on-device filename for the allowlist.
Previously the filename of the source xml file was used, which leads to
a problem when the same source file is used for different apps (even
if only one of those modules ends up being installed).
Bug: 284500052
Test: app_test.go & presubmit boot tests
Change-Id: I0b43a35e3a310464d79d7f37e0900d639f4a479c
diff --git a/java/app.go b/java/app.go
index 561ce1d..d99c184 100755
--- a/java/app.go
+++ b/java/app.go
@@ -795,8 +795,9 @@
shouldInstallAppPackage := (Bool(a.Module.properties.Installable) || ctx.Host()) && apexInfo.IsForPlatform() && !a.appProperties.PreventInstall
if shouldInstallAppPackage {
if a.privAppAllowlist.Valid() {
- installPath := android.PathForModuleInstall(ctx, "etc", "permissions")
- ctx.InstallFile(installPath, a.privAppAllowlist.Path().Base(), a.privAppAllowlist.Path())
+ allowlistInstallPath := android.PathForModuleInstall(ctx, "etc", "permissions")
+ allowlistInstallFilename := a.installApkName + ".xml"
+ ctx.InstallFile(allowlistInstallPath, allowlistInstallFilename, a.privAppAllowlist.Path())
}
var extraInstalledPaths android.Paths