Introduce module type to autogenerate RROS
At ToT, soong emits metadata to make (LOCAL_SOONG_PRODUCT_RRO_DIRS and
LOCAL_SOONG_DEVICE_RRO_DIRS), and make uses this metadata to build and
install apks that are intalled in /vendor or /product. This CL ports
this logic to soong using a new module type. The module type will have a
dependency on the base module (e.g. SystemUI). This dependency edge will
be used to get information such as
- rroDirsDepSet
- manifest (to get package_name)
To reduce code duplication, `aaptBuildActions` has been extended to
accept a manifest and rroDirs parameter.
This should be a no op for now. The followup work includes
- Autogenerating these module in the load hook of android_app and
override_android_app
- Including the autogenerated modules in kati built img files
- Including the autogenerated modules in soong built img files
Test: go test ./java
Bug: 375277835
Change-Id: Icd34f59eb751ba60db3c265acada946e20db5f26
diff --git a/java/androidmk.go b/java/androidmk.go
index bacd925..2ad30b1 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -425,6 +425,24 @@
}
}
+func (a *AutogenRuntimeResourceOverlay) AndroidMkEntries() []android.AndroidMkEntries {
+ if a.IsHideFromMake() || a.outputFile == nil {
+ return []android.AndroidMkEntries{android.AndroidMkEntries{
+ Disabled: true,
+ }}
+ }
+ return []android.AndroidMkEntries{android.AndroidMkEntries{
+ Class: "APPS",
+ OutputFile: android.OptionalPathForPath(a.outputFile),
+ Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
+ ExtraEntries: []android.AndroidMkExtraEntriesFunc{
+ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
+ entries.SetString("LOCAL_CERTIFICATE", "presigned") // The apk will be signed by soong
+ },
+ },
+ }}
+}
+
func (a *AndroidApp) getOverriddenPackages() []string {
var overridden []string
if len(a.overridableAppProperties.Overrides) > 0 {