Update art to use hooks instead of customizer

Change-Id: I46de5ea6ffbc0e32a0b306b8fe82b66b986e33cd
diff --git a/build/art.go b/build/art.go
index f694505..ffa9273 100644
--- a/build/art.go
+++ b/build/art.go
@@ -122,7 +122,7 @@
 	return cflags
 }
 
-func (a *artGlobalDefaults) CustomizeProperties(ctx android.CustomizePropertiesContext) {
+func globalDefaults(ctx android.LoadHookContext) {
 	type props struct {
 		Target struct {
 			Android struct {
@@ -143,9 +143,7 @@
 	ctx.AppendProperties(p)
 }
 
-type artGlobalDefaults struct{}
-
-func (a *artCustomLinkerCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
+func customLinker(ctx android.LoadHookContext) {
 	linker := envDefault(ctx, "CUSTOM_TARGET_LINKER", "")
 	if linker != "" {
 		type props struct {
@@ -158,9 +156,7 @@
 	}
 }
 
-type artCustomLinkerCustomizer struct{}
-
-func (a *artPrefer32BitCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
+func prefer32Bit(ctx android.LoadHookContext) {
 	if envTrue(ctx, "HOST_PREFER_32_BIT") {
 		type props struct {
 			Target struct {
@@ -176,8 +172,6 @@
 	}
 }
 
-type artPrefer32BitCustomizer struct{}
-
 func init() {
 	soong.RegisterModuleType("art_cc_library", artLibrary)
 	soong.RegisterModuleType("art_cc_binary", artBinary)
@@ -187,17 +181,16 @@
 }
 
 func artGlobalDefaultsFactory() (blueprint.Module, []interface{}) {
-	c := &artGlobalDefaults{}
 	module, props := artDefaultsFactory()
-	android.AddCustomizer(module.(android.Module), c)
+	android.AddLoadHook(module, globalDefaults)
 
 	return module, props
 }
 
 func artDefaultsFactory() (blueprint.Module, []interface{}) {
-	c := &codegenCustomizer{}
-	module, props := cc.DefaultsFactory(&c.codegenProperties)
-	android.AddCustomizer(module.(android.Module), c)
+	c := &codegenProperties{}
+	module, props := cc.DefaultsFactory(c)
+	android.AddLoadHook(module, func(ctx android.LoadHookContext) { codegen(ctx, c) })
 
 	return module, props
 }
@@ -206,9 +199,9 @@
 	library, _ := cc.NewLibrary(android.HostAndDeviceSupported, true, true)
 	module, props := library.Init()
 
-	c := &codegenCustomizer{}
-	android.AddCustomizer(library, c)
-	props = append(props, &c.codegenProperties)
+	c := &codegenProperties{}
+	android.AddLoadHook(module, func(ctx android.LoadHookContext) { codegen(ctx, c) })
+	props = append(props, c)
 
 	return module, props
 }
@@ -217,8 +210,8 @@
 	binary, _ := cc.NewBinary(android.HostAndDeviceSupported)
 	module, props := binary.Init()
 
-	android.AddCustomizer(binary, &artCustomLinkerCustomizer{})
-	android.AddCustomizer(binary, &artPrefer32BitCustomizer{})
+	android.AddLoadHook(module, customLinker)
+	android.AddLoadHook(module, prefer32Bit)
 	return module, props
 }
 
@@ -226,8 +219,8 @@
 	test := cc.NewTest(android.HostAndDeviceSupported)
 	module, props := test.Init()
 
-	android.AddCustomizer(test, &artCustomLinkerCustomizer{})
-	android.AddCustomizer(test, &artPrefer32BitCustomizer{})
+	android.AddLoadHook(module, customLinker)
+	android.AddLoadHook(module, prefer32Bit)
 	return module, props
 }
 
diff --git a/build/codegen.go b/build/codegen.go
index fde9420..d98ca4f 100644
--- a/build/codegen.go
+++ b/build/codegen.go
@@ -24,9 +24,7 @@
 	"strings"
 )
 
-func (a *codegenCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
-	c := &a.codegenProperties.Codegen
-
+func codegen(ctx android.LoadHookContext, c *codegenProperties) {
 	var hostArches, deviceArches []string
 
 	e := envDefault(ctx, "ART_HOST_CODEGEN_ARCHS", "")
@@ -53,17 +51,17 @@
 	addCodegenArchProperties := func(p *props, hod **codegenArchProperties, arch string) {
 		switch arch {
 		case "arm":
-			*hod = &c.Arm
+			*hod = &c.Codegen.Arm
 		case "arm64":
-			*hod = &c.Arm64
+			*hod = &c.Codegen.Arm64
 		case "mips":
-			*hod = &c.Mips
+			*hod = &c.Codegen.Mips
 		case "mips64":
-			*hod = &c.Mips64
+			*hod = &c.Codegen.Mips64
 		case "x86":
-			*hod = &c.X86
+			*hod = &c.Codegen.X86
 		case "x86_64":
-			*hod = &c.X86_64
+			*hod = &c.Codegen.X86_64
 		default:
 			ctx.ModuleErrorf("Unknown codegen architecture %q", arch)
 			return
@@ -109,7 +107,7 @@
 	codegenProperties codegenProperties
 }
 
-func defaultDeviceCodegenArches(ctx android.CustomizePropertiesContext) []string {
+func defaultDeviceCodegenArches(ctx android.LoadHookContext) []string {
 	arches := make(map[string]bool)
 	for _, a := range ctx.DeviceConfig().Arches() {
 		s := a.ArchType.String()