Commit 6b33c1f4 authored by José Henrique's avatar José Henrique
Browse files

Search for a/b update prop on vendor partition

parent e8741c7a
......@@ -12,6 +12,8 @@ def find_file(path):
def parse_build_prop_file(build_prop_path):
props = {}
if build_prop_path is None:
return props
with open(build_prop_path) as f:
for line in f:
if "=" in line and line.startswith("#") is False:
......@@ -41,9 +43,10 @@ def init_post_build_env_vars(build_env_vars):
build_prop = parse_build_prop_file(
find_file(result["working_dir"] +
"/out/target/product/*/system/build.prop"))
default_prop = parse_build_prop_file(
vendor_build_prop = parse_build_prop_file(
find_file(result["working_dir"] +
"/out/target/product/*/recovery/root/prop.default"))
"/out/target/product/*/vendor/build.prop"))
if "org.pixelexperience.version.display" not in build_prop:
raise Exception(
......@@ -51,9 +54,15 @@ def init_post_build_env_vars(build_env_vars):
result["build_name"] = (
build_prop["org.pixelexperience.version.display"] + ".zip")
# A/B Update
result["ab_update"] = (
"ro.build.ab_update" in build_prop and
build_prop["ro.build.ab_update"] == "true")
("ro.build.ab_update" in build_prop and
build_prop["ro.build.ab_update"] == "true") or
("ro.build.ab_update" in vendor_build_prop and
vendor_build_prop["ro.build.ab_update"] == "true")
)
# AOSP Recovery
result["aosp_recovery"] = result["ab_update"] or (
"persist.sys.recovery_update" in build_prop and
build_prop["persist.sys.recovery_update"] == "true")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment