Rename aconfig namespace to package.

Bug: 285303012
Test: for x in next trunk trunk_food trunk_staging ; do lunch aosp_panther-$x-eng ; m nothing ; done
Change-Id: I9ee3b1f0207b828557d339d7f50cad77ff16310f
diff --git a/device_config/device_config_definitions.go b/device_config/device_config_definitions.go
index ab2e4f7..97f5dca 100644
--- a/device_config/device_config_definitions.go
+++ b/device_config/device_config_definitions.go
@@ -30,8 +30,8 @@
 		// aconfig files, relative to this Android.bp file
 		Srcs []string `android:"path"`
 
-		// Release config flag namespace
-		Namespace string
+		// Release config flag package
+		Package string
 
 		// Values from TARGET_RELEASE / RELEASE_DEVICE_CONFIG_VALUE_SETS
 		Values []string `blueprint:"mutated"`
@@ -64,13 +64,13 @@
 		ctx.PropertyErrorf("srcs", "missing source files")
 		return
 	}
-	if len(module.properties.Namespace) == 0 {
-		ctx.PropertyErrorf("namespace", "missing namespace property")
+	if len(module.properties.Package) == 0 {
+		ctx.PropertyErrorf("package", "missing package property")
 	}
 
 	// Add a dependency on the device_config_value_sets defined in
 	// RELEASE_DEVICE_CONFIG_VALUE_SETS, and add any device_config_values that
-	// match our namespace.
+	// match our package.
 	valuesFromConfig := ctx.Config().ReleaseDeviceConfigValueSets()
 	ctx.AddDependency(ctx.Module(), implicitValuesTag, valuesFromConfig...)
 }
@@ -98,8 +98,8 @@
 
 // Provider published by device_config_value_set
 type definitionsProviderData struct {
-	namespace        string
-	intermediatePath android.WritablePath
+	Package          string
+	IntermediatePath android.WritablePath
 }
 
 var definitionsProviderKey = blueprint.NewProvider(definitionsProviderData{})
@@ -112,7 +112,7 @@
 			return
 		}
 		depData := ctx.OtherModuleProvider(dep, valueSetProviderKey).(valueSetProviderData)
-		valuesFiles, ok := depData.AvailableNamespaces[module.properties.Namespace]
+		valuesFiles, ok := depData.AvailablePackages[module.properties.Package]
 		if ok {
 			for _, path := range valuesFiles {
 				module.properties.Values = append(module.properties.Values, path.String())
@@ -130,14 +130,14 @@
 		Description: "device_config_definitions",
 		Args: map[string]string{
 			"release_version": ctx.Config().ReleaseVersion(),
-			"namespace":       module.properties.Namespace,
+			"package":         module.properties.Package,
 			"values":          joinAndPrefix(" --values ", module.properties.Values),
 		},
 	})
 
 	ctx.SetProvider(definitionsProviderKey, definitionsProviderData{
-		namespace:        module.properties.Namespace,
-		intermediatePath: intermediatePath,
+		Package:          module.properties.Package,
+		IntermediatePath: intermediatePath,
 	})
 
 }
diff --git a/device_config/device_config_definitions_test.go b/device_config/device_config_definitions_test.go
index 6bc6eaa..5838523 100644
--- a/device_config/device_config_definitions_test.go
+++ b/device_config/device_config_definitions_test.go
@@ -25,7 +25,7 @@
 	bp := `
 		device_config_definitions {
 			name: "module_name",
-			namespace: "com.example.package",
+			package: "com.example.package",
 			srcs: ["foo.aconfig"],
 		}
 	`
@@ -35,8 +35,8 @@
 
 	// Check that the provider has the right contents
 	depData := result.ModuleProvider(module, definitionsProviderKey).(definitionsProviderData)
-	android.AssertStringEquals(t, "namespace", depData.namespace, "com.example.package")
-	if !strings.HasSuffix(depData.intermediatePath.String(), "/intermediate.pb") {
-		t.Errorf("Missing intermediates path in provider: %s", depData.intermediatePath.String())
+	android.AssertStringEquals(t, "package", depData.Package, "com.example.package")
+	if !strings.HasSuffix(depData.IntermediatePath.String(), "/intermediate.pb") {
+		t.Errorf("Missing intermediates path in provider: %s", depData.IntermediatePath.String())
 	}
 }
diff --git a/device_config/device_config_value_set.go b/device_config/device_config_value_set.go
index e406d20..b354305 100644
--- a/device_config/device_config_value_set.go
+++ b/device_config/device_config_value_set.go
@@ -51,9 +51,9 @@
 
 // Provider published by device_config_value_set
 type valueSetProviderData struct {
-	// The namespace of each of the
-	// (map of namespace --> device_config_module)
-	AvailableNamespaces map[string]android.Paths
+	// The package of each of the
+	// (map of package --> device_config_module)
+	AvailablePackages map[string]android.Paths
 }
 
 var valueSetProviderKey = blueprint.NewProvider(valueSetProviderData{})
@@ -70,10 +70,10 @@
 }
 
 func (module *ValueSetModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	// Accumulate the namespaces of the values modules listed, and set that as an
+	// Accumulate the packages of the values modules listed, and set that as an
 	// valueSetProviderKey provider that device_config modules can read and use
 	// to append values to their aconfig actions.
-	namespaces := make(map[string]android.Paths)
+	packages := make(map[string]android.Paths)
 	ctx.VisitDirectDeps(func(dep android.Module) {
 		if !ctx.OtherModuleHasProvider(dep, valuesProviderKey) {
 			// Other modules get injected as dependencies too, for example the license modules
@@ -83,10 +83,10 @@
 
 		srcs := make([]android.Path, len(depData.Values))
 		copy(srcs, depData.Values)
-		namespaces[depData.Namespace] = srcs
+		packages[depData.Package] = srcs
 
 	})
 	ctx.SetProvider(valueSetProviderKey, valueSetProviderData{
-		AvailableNamespaces: namespaces,
+		AvailablePackages: packages,
 	})
 }
diff --git a/device_config/device_config_value_set_test.go b/device_config/device_config_value_set_test.go
index f9e7c38..5cbb698 100644
--- a/device_config/device_config_value_set_test.go
+++ b/device_config/device_config_value_set_test.go
@@ -25,7 +25,7 @@
 				device_config_values {
 					name: "one",
 					srcs: [ "blah.aconfig_values" ],
-					namespace: "foo.namespace"
+					package: "foo.package"
 				}
 
 				device_config_value_set {
@@ -39,5 +39,5 @@
 
 	// Check that the provider has the right contents
 	depData := result.ModuleProvider(module, valueSetProviderKey).(valueSetProviderData)
-	android.AssertStringEquals(t, "AvailableNamespaces", "blah.aconfig_values", depData.AvailableNamespaces["foo.namespace"][0].String())
+	android.AssertStringEquals(t, "AvailablePackages", "blah.aconfig_values", depData.AvailablePackages["foo.package"][0].String())
 }
diff --git a/device_config/device_config_values.go b/device_config/device_config_values.go
index 110f12a..2cf921a 100644
--- a/device_config/device_config_values.go
+++ b/device_config/device_config_values.go
@@ -28,8 +28,8 @@
 		// aconfig files, relative to this Android.bp file
 		Srcs []string `android:"path"`
 
-		// Release config flag namespace
-		Namespace string
+		// Release config flag package
+		Package string
 	}
 }
 
@@ -47,8 +47,8 @@
 
 // Provider published by device_config_value_set
 type valuesProviderData struct {
-	// The namespace that this values module values
-	Namespace string
+	// The package that this values module values
+	Package string
 
 	// The values aconfig files, relative to the root of the tree
 	Values android.Paths
@@ -57,14 +57,14 @@
 var valuesProviderKey = blueprint.NewProvider(valuesProviderData{})
 
 func (module *ValuesModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	if len(module.properties.Namespace) == 0 {
-		ctx.PropertyErrorf("namespace", "missing namespace property")
+	if len(module.properties.Package) == 0 {
+		ctx.PropertyErrorf("package", "missing package property")
 	}
 
 	// Provide the our source files list to the device_config_value_set as a list of files
 	providerData := valuesProviderData{
-		Namespace: module.properties.Namespace,
-		Values:    android.PathsForModuleSrc(ctx, module.properties.Srcs),
+		Package: module.properties.Package,
+		Values:  android.PathsForModuleSrc(ctx, module.properties.Srcs),
 	}
 	ctx.SetProvider(valuesProviderKey, providerData)
 }
diff --git a/device_config/device_config_values_test.go b/device_config/device_config_values_test.go
index 64c57eb..14caece 100644
--- a/device_config/device_config_values_test.go
+++ b/device_config/device_config_values_test.go
@@ -25,7 +25,7 @@
 				device_config_values {
 					name: "module_name",
 					srcs: [ "blah.aconfig_values" ],
-					namespace: "foo.namespace"
+					package: "foo.package"
 				}
 			`
 	result := runTest(t, android.FixtureExpectsNoErrors, bp)
@@ -34,6 +34,6 @@
 
 	// Check that the provider has the right contents
 	depData := result.ModuleProvider(module, valuesProviderKey).(valuesProviderData)
-	android.AssertStringEquals(t, "namespace", "foo.namespace", depData.Namespace)
+	android.AssertStringEquals(t, "package", "foo.package", depData.Package)
 	android.AssertPathsEndWith(t, "srcs", []string{"blah.aconfig_values"}, depData.Values)
 }
diff --git a/device_config/init.go b/device_config/init.go
index 04bbab6..c6e7df1 100644
--- a/device_config/init.go
+++ b/device_config/init.go
@@ -26,7 +26,7 @@
 	aconfigRule = pctx.AndroidStaticRule("aconfig",
 		blueprint.RuleParams{
 			Command: `${aconfig} create-cache` +
-				` --package ${namespace}` +
+				` --package ${package}` +
 				` --declarations ${in}` +
 				` ${values}` +
 				` --cache ${out}.tmp` +
@@ -36,7 +36,7 @@
 				"${aconfig}",
 			},
 			Restat: true,
-		}, "release_version", "namespace", "values")
+		}, "release_version", "package", "values")
 
 	// For java_device_config_definitions_library: Generate java file
 	srcJarRule = pctx.AndroidStaticRule("aconfig_srcjar",
diff --git a/device_config/java_device_config_definitions_library.go b/device_config/java_device_config_definitions_library.go
index 6e48ece..39f8431 100644
--- a/device_config/java_device_config_definitions_library.go
+++ b/device_config/java_device_config_definitions_library.go
@@ -62,7 +62,7 @@
 	srcJarPath := android.PathForModuleGen(ctx, ctx.ModuleName()+".srcjar")
 	ctx.Build(pctx, android.BuildParams{
 		Rule:        srcJarRule,
-		Input:       definitions.intermediatePath,
+		Input:       definitions.IntermediatePath,
 		Output:      srcJarPath,
 		Description: "device_config.srcjar",
 	})