From dc0187811f8a7f08d3a35224c3f0c76566d6cdcd Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 28 Aug 2024 11:08:06 -0700 Subject: [PATCH] Add com.google.pixel.camera.hal.manifest to build number allowlist So that it can be removed from the genrule sandboxing allowlist. Because this is an internal module, I'm submitting this allowlist addition first, then will make the genrule use it, then will remove it from the sandboxing allowlist. Bug: 307824623 Test: Presubmits Change-Id: Ia7001d89a57fd1d2fbe3b0f79fb68fecf859fbb4 --- genrule/genrule.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/genrule/genrule.go b/genrule/genrule.go index 39dd7703d..fd72d3c15 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -253,13 +253,21 @@ var buildNumberAllowlistKey = android.NewOnceKey("genruleBuildNumberAllowlistKey // soong plugins cannot add entries to the allowlist func isModuleInBuildNumberAllowlist(ctx android.ModuleContext) bool { allowlist := ctx.Config().Once(buildNumberAllowlistKey, func() interface{} { - return map[string]bool{ + // Define the allowlist as a list and then copy it into a map so that + // gofmt doesn't change unnecessary lines trying to align the values of the map. + allowlist := []string{ // go/keep-sorted start - "build/soong/tests:gen": true, - "hardware/google/camera/common/hal/aidl_service:aidl_camera_build_version": true, - "tools/tradefederation/core:tradefed_zip": true, + "build/soong/tests:gen", + "hardware/google/camera/common/hal/aidl_service:aidl_camera_build_version", + "tools/tradefederation/core:tradefed_zip", + "vendor/google/services/LyricCameraHAL/src/apex:com.google.pixel.camera.hal.manifest", // go/keep-sorted end } + allowlistMap := make(map[string]bool, len(allowlist)) + for _, a := range allowlist { + allowlistMap[a] = true + } + return allowlistMap }).(map[string]bool) _, ok := allowlist[ctx.ModuleDir()+":"+ctx.ModuleName()]