Build product/odm build.prop with Soong
Bug: 322090587 Test: compare build.prop before and after, boot Change-Id: I7a7dc785030a0c17e5c09b7f65c978fe9bbcb7a7
This commit is contained in:
@@ -472,6 +472,8 @@ def append_additional_product_props(args):
|
||||
# Add the 16K developer args if it is defined for the product.
|
||||
props.append(f"ro.product.build.16k_page.enabled={'true' if config['Product16KDeveloperOption'] else 'false'}")
|
||||
|
||||
props.append(f"ro.product.page_size={16384 if config['TargetBoots16K'] else 4096}")
|
||||
|
||||
props.append(f"ro.build.characteristics={config['AAPTCharacteristics']}")
|
||||
|
||||
if "AbOtaUpdater" in config and config["AbOtaUpdater"]:
|
||||
@@ -537,6 +539,7 @@ def build_vendor_prop(args):
|
||||
]
|
||||
|
||||
build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=variables)
|
||||
'''
|
||||
|
||||
def build_product_prop(args):
|
||||
config = args.config
|
||||
@@ -547,8 +550,32 @@ def build_product_prop(args):
|
||||
"ADDITIONAL_PRODUCT_PROPERTIES",
|
||||
"PRODUCT_PRODUCT_PROPERTIES",
|
||||
]
|
||||
|
||||
gen_common_build_props = True
|
||||
|
||||
# Skip common /product properties generation if device released before R and
|
||||
# has no product partition. This is the first part of the check.
|
||||
if config["Shipping_api_level"] and int(config["Shipping_api_level"]) < 30:
|
||||
gen_common_build_props = False
|
||||
|
||||
# The second part of the check - always generate common properties for the
|
||||
# devices with product partition regardless of shipping level.
|
||||
if config["UsesProductImage"]:
|
||||
gen_common_build_props = True
|
||||
|
||||
build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=variables)
|
||||
|
||||
if config["OemProperties"]:
|
||||
print("####################################")
|
||||
print("# PRODUCT_OEM_PROPERTIES")
|
||||
print("####################################")
|
||||
|
||||
for prop in config["OemProperties"]:
|
||||
print(f"import /oem/oem.prop {prop}")
|
||||
|
||||
def build_odm_prop(args):
|
||||
variables = ["ADDITIONAL_ODM_PROPERTIES", "PRODUCT_ODM_PROPERTIES"]
|
||||
build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=variables)
|
||||
'''
|
||||
|
||||
def build_prop(args, gen_build_info, gen_common_build_props, variables):
|
||||
config = args.config
|
||||
@@ -570,18 +597,19 @@ def main():
|
||||
args = parse_args()
|
||||
|
||||
with contextlib.redirect_stdout(args.out):
|
||||
if args.partition == "system":
|
||||
build_system_prop(args)
|
||||
elif args.partition == "system_ext":
|
||||
build_system_ext_prop(args)
|
||||
'''
|
||||
elif args.partition == "vendor":
|
||||
build_vendor_prop(args)
|
||||
elif args.partition == "product":
|
||||
build_product_prop(args)
|
||||
'''
|
||||
else:
|
||||
sys.exit(f"not supported partition {args.partition}")
|
||||
match args.partition:
|
||||
case "system":
|
||||
build_system_prop(args)
|
||||
case "system_ext":
|
||||
build_system_ext_prop(args)
|
||||
case "odm":
|
||||
build_odm_prop(args)
|
||||
case "product":
|
||||
build_product_prop(args)
|
||||
# case "vendor": # NOT IMPLEMENTED
|
||||
# build_vendor_prop(args)
|
||||
case _:
|
||||
sys.exit(f"not supported partition {args.partition}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Reference in New Issue
Block a user