Allow boards to turn overriding commands into an error

Many board still have this problem, but if we can switch some over,
we'll prevent global problems and have the ability to clean boards up
one-by-one.

Bug: 77611511
Test: lunch aosp_arm-eng; m nothing
Test: lunch aosp_marlin-eng; m nothing
Test: build_test on all downstream branches
Change-Id: I78bee44adde2059d01188658b9050927748d2028
diff --git a/ui/build/config.go b/ui/build/config.go
index a1b5bd4..aa60b3f 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -48,6 +48,8 @@
 	ninjaArgs    []string
 	katiSuffix   string
 	targetDevice string
+
+	brokenDupRules bool
 }
 
 const srcDirFileCheck = "build/soong/root.bp"
@@ -556,3 +558,11 @@
 	}
 	return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name)
 }
+
+func (c *configImpl) SetBuildBrokenDupRules(val bool) {
+	c.brokenDupRules = val
+}
+
+func (c *configImpl) BuildBrokenDupRules() bool {
+	return c.brokenDupRules
+}