Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b996dd7f authored by Oriol Prieto Gascó's avatar Oriol Prieto Gascó Committed by Automerger Merge Worker
Browse files

Merge "Add RELEASE_ACONFIG_REQUIRE_ALL_READ_ONLY build flag." into main am: dfc9a97e

parents 579810a6 dfc9a97e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -15,12 +15,12 @@
package aconfig

import (
	"android/soong/android"
	"path/filepath"
	"slices"
	"strconv"
	"strings"

	"android/soong/android"

	"github.com/google/blueprint"
)

@@ -185,6 +185,13 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module
				defaultPermission = confPerm
			}
		}
		var allowReadWrite bool
		if requireAllReadOnly, ok := ctx.Config().GetBuildFlag("RELEASE_ACONFIG_REQUIRE_ALL_READ_ONLY"); ok {
			// The build flag (RELEASE_ACONFIG_REQUIRE_ALL_READ_ONLY) is the negation of the aconfig flag
			// (allow-read-write) for historical reasons.
			// Bool build flags are always "" for false, and generally "true" for true.
			allowReadWrite = requireAllReadOnly == ""
		}
		inputFiles := make([]android.Path, len(declarationFiles))
		copy(inputFiles, declarationFiles)
		inputFiles = append(inputFiles, valuesFiles[config]...)
@@ -194,6 +201,7 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module
			"declarations":       android.JoinPathsWithPrefix(declarationFiles, "--declarations "),
			"values":             joinAndPrefix(" --values ", values[config]),
			"default-permission": optionalVariable(" --default-permission ", defaultPermission),
			"allow-read-write":   optionalVariable(" --allow-read-write ", strconv.FormatBool(allowReadWrite)),
		}
		if len(module.properties.Container) > 0 {
			args["container"] = "--container " + module.properties.Container
+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ var (
				` ${declarations}` +
				` ${values}` +
				` ${default-permission}` +
				` ${allow-read-write}` +
				` --cache ${out}.tmp` +
				` && ( if cmp -s ${out}.tmp ${out} ; then rm ${out}.tmp ; else mv ${out}.tmp ${out} ; fi )`,
			//				` --build-id ${release_version}` +
@@ -39,7 +40,7 @@ var (
				"${aconfig}",
			},
			Restat: true,
		}, "release_version", "package", "container", "declarations", "values", "default-permission")
		}, "release_version", "package", "container", "declarations", "values", "default-permission", "allow-read-write")

	// For create-device-config-sysprops: Generate aconfig flag value map text file
	aconfigTextRule = pctx.AndroidStaticRule("aconfig_text",