runtime_resource_overlay can be included in APEXes

runtime_resource_overlay is put to an APEX via 'apps' property. It is
placed under ./overlay directory in it.

Bug: 154822536
Test: m
Change-Id: I8edf4a26c26368c52fb7b327b2ecc829f21ea148
diff --git a/java/app.go b/java/app.go
index afc4a60..2ee9057 100755
--- a/java/app.go
+++ b/java/app.go
@@ -1412,6 +1412,15 @@
 	Resource_libs []string
 }
 
+// RuntimeResourceOverlayModule interface is used by the apex package to gather information from
+// a RuntimeResourceOverlay module.
+type RuntimeResourceOverlayModule interface {
+	android.Module
+	OutputFile() android.Path
+	Certificate() Certificate
+	Theme() string
+}
+
 func (r *RuntimeResourceOverlay) DepsMutator(ctx android.BottomUpMutatorContext) {
 	sdkDep := decodeSdkDep(ctx, sdkContext(r))
 	if sdkDep.hasFrameworkLibs() {
@@ -1464,6 +1473,18 @@
 	return r.sdkVersion()
 }
 
+func (r *RuntimeResourceOverlay) Certificate() Certificate {
+	return r.certificate
+}
+
+func (r *RuntimeResourceOverlay) OutputFile() android.Path {
+	return r.outputFile
+}
+
+func (r *RuntimeResourceOverlay) Theme() string {
+	return String(r.properties.Theme)
+}
+
 // runtime_resource_overlay generates a resource-only apk file that can overlay application and
 // system resources at run time.
 func RuntimeResourceOverlayFactory() android.Module {