Merge "Move namespace mutator earlier to support defaults"
diff --git a/android/mutator.go b/android/mutator.go
index 2f13f6c..64d9fdd 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -76,6 +76,7 @@
 	func(ctx RegisterMutatorsContext) {
 		ctx.TopDown("load_hooks", loadHookMutator).Parallel()
 	},
+	RegisterNamespaceMutator,
 	RegisterPrebuiltsPreArchMutators,
 	RegisterDefaultsPreArchMutators,
 }
@@ -86,7 +87,6 @@
 }
 
 var preDeps = []RegisterMutatorFunc{
-	RegisterNamespaceMutator,
 	registerArchMutator,
 }
 
diff --git a/android/namespace_test.go b/android/namespace_test.go
index 9ab186b..a6fc9d5 100644
--- a/android/namespace_test.go
+++ b/android/namespace_test.go
@@ -606,7 +606,7 @@
 	ctx.MockFileSystem(bps)
 	ctx.RegisterModuleType("test_module", ModuleFactoryAdaptor(newTestModule))
 	ctx.RegisterModuleType("soong_namespace", ModuleFactoryAdaptor(NamespaceFactory))
-	ctx.PreDepsMutators(RegisterNamespaceMutator)
+	ctx.PreArchMutators(RegisterNamespaceMutator)
 	ctx.Register()
 
 	_, errs = ctx.ParseBlueprintsFiles("Android.bp")