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/android/neverallow.go b/android/neverallow.go
index 326150b..42fecaa 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -64,6 +64,7 @@
AddNeverAllowRules(createFilesystemIsAutoGeneratedRule())
AddNeverAllowRules(createKotlinPluginRule()...)
AddNeverAllowRules(createPrebuiltEtcBpDefineRule())
+ AddNeverAllowRules(createAutogenRroBpDefineRule())
}
// Add a NeverAllow rule to the set of rules to apply.
@@ -344,6 +345,15 @@
Because("module type not allowed to be defined in bp file")
}
+func createAutogenRroBpDefineRule() Rule {
+ return NeverAllow().
+ ModuleType(
+ "autogen_runtime_resource_overlay",
+ ).
+ DefinedInBpFile().
+ Because("Module type will be autogenerated by soong. Use runtime_resource_overlay instead")
+}
+
func neverallowMutator(ctx BottomUpMutatorContext) {
m, ok := ctx.Module().(Module)
if !ok {