Loading aconfig/aconfig_declarations.go +10 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ package aconfig import ( "android/soong/android" "path/filepath" "slices" "strconv" "strings" "android/soong/android" "github.com/google/blueprint" ) Loading Loading @@ -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]...) Loading @@ -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 Loading aconfig/init.go +2 −1 Original line number Diff line number Diff line Loading @@ -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}` + Loading @@ -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", Loading android/hooks.go +10 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,16 @@ func AddLoadHook(m blueprint.Module, hook func(LoadHookContext)) { }) } func AddLoadHookWithPriority(m blueprint.Module, hook func(LoadHookContext), priority int) { blueprint.AddLoadHookWithPriority(m, func(ctx blueprint.LoadHookContext) { actx := &loadHookContext{ earlyModuleContext: m.(Module).base().earlyModuleContextFactory(ctx), bp: ctx, } hook(actx) }, priority) } type loadHookContext struct { earlyModuleContext bp blueprint.LoadHookContext Loading android/module.go +2 −0 Original line number Diff line number Diff line Loading @@ -1869,6 +1869,7 @@ type CommonModuleInfo struct { // The Target of artifacts that this module variant is responsible for creating. CompileTarget Target SkipAndroidMkProcessing bool BaseModuleName string } var CommonModuleInfoKey = blueprint.NewProvider[CommonModuleInfo]() Loading Loading @@ -2137,6 +2138,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) ReplacedByPrebuilt: m.commonProperties.ReplacedByPrebuilt, CompileTarget: m.commonProperties.CompileTarget, SkipAndroidMkProcessing: shouldSkipAndroidMkProcessing(ctx, m), BaseModuleName: m.BaseModuleName(), } if m.commonProperties.ForcedDisabled { commonData.Enabled = false Loading android/neverallow.go +8 −1 Original line number Diff line number Diff line Loading @@ -245,6 +245,11 @@ func createInstallInRootAllowingRules() []Rule { Without("name", "librecovery_ui_ext"). With("install_in_root", "true"). NotModuleType("prebuilt_root"). NotModuleType("prebuilt_vendor"). NotModuleType("prebuilt_sbin"). NotModuleType("prebuilt_system"). NotModuleType("prebuilt_first_stage_ramdisk"). NotModuleType("prebuilt_res"). Because("install_in_root is only for init_first_stage or librecovery_ui_ext."), } } Loading Loading @@ -340,7 +345,6 @@ func createPrebuiltEtcBpDefineRule() Rule { "prebuilt_priv_app", "prebuilt_rfs", "prebuilt_framework", "prebuilt_res", "prebuilt_wlc_upt", "prebuilt_odm", "prebuilt_vendor_dlkm", Loading @@ -349,6 +353,9 @@ func createPrebuiltEtcBpDefineRule() Rule { "prebuilt_optee", "prebuilt_tvconfig", "prebuilt_vendor", "prebuilt_sbin", "prebuilt_system", "prebuilt_first_stage_ramdisk", ). DefinedInBpFile(). Because("module type not allowed to be defined in bp file") Loading Loading
aconfig/aconfig_declarations.go +10 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ package aconfig import ( "android/soong/android" "path/filepath" "slices" "strconv" "strings" "android/soong/android" "github.com/google/blueprint" ) Loading Loading @@ -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]...) Loading @@ -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 Loading
aconfig/init.go +2 −1 Original line number Diff line number Diff line Loading @@ -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}` + Loading @@ -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", Loading
android/hooks.go +10 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,16 @@ func AddLoadHook(m blueprint.Module, hook func(LoadHookContext)) { }) } func AddLoadHookWithPriority(m blueprint.Module, hook func(LoadHookContext), priority int) { blueprint.AddLoadHookWithPriority(m, func(ctx blueprint.LoadHookContext) { actx := &loadHookContext{ earlyModuleContext: m.(Module).base().earlyModuleContextFactory(ctx), bp: ctx, } hook(actx) }, priority) } type loadHookContext struct { earlyModuleContext bp blueprint.LoadHookContext Loading
android/module.go +2 −0 Original line number Diff line number Diff line Loading @@ -1869,6 +1869,7 @@ type CommonModuleInfo struct { // The Target of artifacts that this module variant is responsible for creating. CompileTarget Target SkipAndroidMkProcessing bool BaseModuleName string } var CommonModuleInfoKey = blueprint.NewProvider[CommonModuleInfo]() Loading Loading @@ -2137,6 +2138,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) ReplacedByPrebuilt: m.commonProperties.ReplacedByPrebuilt, CompileTarget: m.commonProperties.CompileTarget, SkipAndroidMkProcessing: shouldSkipAndroidMkProcessing(ctx, m), BaseModuleName: m.BaseModuleName(), } if m.commonProperties.ForcedDisabled { commonData.Enabled = false Loading
android/neverallow.go +8 −1 Original line number Diff line number Diff line Loading @@ -245,6 +245,11 @@ func createInstallInRootAllowingRules() []Rule { Without("name", "librecovery_ui_ext"). With("install_in_root", "true"). NotModuleType("prebuilt_root"). NotModuleType("prebuilt_vendor"). NotModuleType("prebuilt_sbin"). NotModuleType("prebuilt_system"). NotModuleType("prebuilt_first_stage_ramdisk"). NotModuleType("prebuilt_res"). Because("install_in_root is only for init_first_stage or librecovery_ui_ext."), } } Loading Loading @@ -340,7 +345,6 @@ func createPrebuiltEtcBpDefineRule() Rule { "prebuilt_priv_app", "prebuilt_rfs", "prebuilt_framework", "prebuilt_res", "prebuilt_wlc_upt", "prebuilt_odm", "prebuilt_vendor_dlkm", Loading @@ -349,6 +353,9 @@ func createPrebuiltEtcBpDefineRule() Rule { "prebuilt_optee", "prebuilt_tvconfig", "prebuilt_vendor", "prebuilt_sbin", "prebuilt_system", "prebuilt_first_stage_ramdisk", ). DefinedInBpFile(). Because("module type not allowed to be defined in bp file") Loading