bundle config contains (path,manifest) pairs of embedded APKs

If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Bug: 148002117
Test: m

Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
diff --git a/apex/apex.go b/apex/apex.go
index c791162..bef4e42 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1410,6 +1410,7 @@
 
 	jacocoReportClassesFile android.Path     // only for javalibs and apps
 	certificate             java.Certificate // only for apps
+	overriddenPackageName   string           // only for apps
 
 	isJniLib bool
 }
@@ -1917,6 +1918,12 @@
 	af := newApexFile(ctx, fileToCopy, aapp.Name(), dirInApex, app, aapp)
 	af.jacocoReportClassesFile = aapp.JacocoReportClassesFile()
 	af.certificate = aapp.Certificate()
+
+	if app, ok := aapp.(interface {
+		OverriddenManifestPackageName() string
+	}); ok {
+		af.overriddenPackageName = app.OverriddenManifestPackageName()
+	}
 	return af
 }