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
Merged-In: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
Change-Id: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
(cherry picked from commit 5ec73ecc08342f0d16f2fb6f128df04d6553b83d)
diff --git a/android/module.go b/android/module.go
index d9e655a..1f17eda 100644
--- a/android/module.go
+++ b/android/module.go
@@ -607,10 +607,8 @@
 	base.customizableProperties = m.GetProperties()
 
 	// The default_visibility property needs to be checked and parsed by the visibility module during
-	// its checking and parsing phases.
-	base.primaryVisibilityProperty =
-		newVisibilityProperty("visibility", &base.commonProperties.Visibility)
-	base.visibilityPropertyInfo = []visibilityProperty{base.primaryVisibilityProperty}
+	// its checking and parsing phases so make it the primary visibility property.
+	setPrimaryVisibilityProperty(m, "visibility", &base.commonProperties.Visibility)
 }
 
 func InitAndroidArchModule(m Module, hod HostOrDeviceSupported, defaultMultilib Multilib) {