Reduce duplication in visibility property management
Adds a couple of new methods to manage visibility property instances to
reduce duplication and encapsulate the implementation slightly better.
The AddVisibilityProperty method is exported as it will be needed by
other packages in follow up commits.
Bug: 155295806
Test: m nothing
Change-Id: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
diff --git a/android/package.go b/android/package.go
index 077c4a4..bb5f4e7 100644
--- a/android/package.go
+++ b/android/package.go
@@ -101,10 +101,8 @@
module.AddProperties(&module.properties)
// The default_visibility property needs to be checked and parsed by the visibility module during
- // its checking and parsing phases.
- module.primaryVisibilityProperty =
- newVisibilityProperty("default_visibility", &module.properties.Default_visibility)
- module.visibilityPropertyInfo = []visibilityProperty{module.primaryVisibilityProperty}
+ // its checking and parsing phases so make it the primary visibility property.
+ setPrimaryVisibilityProperty(module, "default_visibility", &module.properties.Default_visibility)
return module
}