Prevent smuggling modules through neverallow rules
Soong config module types would change the module type that neverallow
sees, which can allow modules to get by the neverallow rules.
Make the neverallow rules operate on the base module type instead of
the soong config module type.
Test: go test
Change-Id: Icf8ef0d5c83f1027efe54ca21bbb6d5292921099
diff --git a/android/module.go b/android/module.go
index 3d643f9..c6c4fd8 100644
--- a/android/module.go
+++ b/android/module.go
@@ -520,6 +520,11 @@
// names of other modules to install on target if this module is installed
Target_required []string `android:"arch_variant"`
+
+ // If this is a soong config module, this property will be set to the name of the original
+ // module type. This is used by neverallow to ensure you can't bypass a ModuleType() matcher
+ // just by creating a soong config module type.
+ Soong_config_base_module_type *string `blueprint:"mutated"`
}
type distProperties struct {