Add filename property to android_app_import

Test: app_test.go
Bug: 137218697
Change-Id: If2b20a355bb6e9e8dbcd57347c0e2c6fa041a932
diff --git a/java/app.go b/java/app.go
index 3442658..ce4eb32 100644
--- a/java/app.go
+++ b/java/app.go
@@ -736,6 +736,8 @@
 	dexpreopter
 
 	usesLibrary usesLibrary
+
+	installPath android.OutputPath
 }
 
 type AndroidAppImportProperties struct {
@@ -761,6 +763,9 @@
 	// binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
 	// from PRODUCT_PACKAGES.
 	Overrides []string
+
+	// Optional name for the installed app. If unspecified, it is derived from the module name.
+	Filename *string
 }
 
 // Chooses a source APK path to use based on the module and product specs.
@@ -913,7 +918,8 @@
 
 	// TODO: Optionally compress the output apk.
 
-	ctx.InstallFile(installDir, a.BaseModuleName()+".apk", a.outputFile)
+	a.installPath = ctx.InstallFile(installDir,
+		proptools.StringDefault(a.properties.Filename, a.BaseModuleName()+".apk"), a.outputFile)
 
 	// TODO: androidmk converter jni libs
 }