Restrict IsSanitizerEnabled() to android.Config().
Turns out, the whole context is not needed and then let's not
plumb it any further than necessary.
Test: Presubmits.
Change-Id: I1a25738e5a6ca20dea0d973c2ce435b5e152399b
diff --git a/apex/apex.go b/apex/apex.go
index beabbc9..7e913e8 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1468,7 +1468,7 @@
}
}
-func (a *apexBundle) IsSanitizerEnabled(ctx android.BaseModuleContext, sanitizerName string) bool {
+func (a *apexBundle) IsSanitizerEnabled(config android.Config, sanitizerName string) bool {
if android.InList(sanitizerName, a.properties.SanitizerNames) {
return true
}
@@ -1476,11 +1476,11 @@
// Then follow the global setting
globalSanitizerNames := []string{}
if a.Host() {
- globalSanitizerNames = ctx.Config().SanitizeHost()
+ globalSanitizerNames = config.SanitizeHost()
} else {
- arches := ctx.Config().SanitizeDeviceArch()
+ arches := config.SanitizeDeviceArch()
if len(arches) == 0 || android.InList(a.Arch().ArchType.Name, arches) {
- globalSanitizerNames = ctx.Config().SanitizeDevice()
+ globalSanitizerNames = config.SanitizeDevice()
}
}
return android.InList(sanitizerName, globalSanitizerNames)