resolve merge conflicts of 7169f754cc to rvc-dev-plus-aosp

Change-Id: Ic1a44cfe929707e2fb76282dcd06f839a8159735
This commit is contained in:
Yifan Hong
2020-05-13 17:43:31 +00:00
7 changed files with 93 additions and 17 deletions

View File

@@ -78,6 +78,13 @@ Common options that apply to both of non-A/B and A/B OTAs
Write a copy of the metadata to a separate file. Therefore, users can
read the post build fingerprint without extracting the OTA package.
--force_non_ab
This flag can only be set on an A/B device that also supports non-A/B
updates. Implies --two_step.
If set, generate that non-A/B update package.
If not set, generates A/B package for A/B device and non-A/B package for
non-A/B device.
Non-A/B OTA specific options
-b (--binary) <file>
@@ -251,6 +258,7 @@ OPTIONS.skip_compatibility_check = False
OPTIONS.output_metadata_path = None
OPTIONS.disable_fec_computation = False
OPTIONS.boot_variable_values = None
OPTIONS.force_non_ab = False
METADATA_NAME = 'META-INF/com/android/metadata'
@@ -932,7 +940,7 @@ def GetPackageMetadata(target_info, source_info=None):
'ro.build.version.security_patch'),
}
if target_info.is_ab:
if target_info.is_ab and not OPTIONS.force_non_ab:
metadata['ota-type'] = 'AB'
metadata['ota-required-cache'] = '0'
else:
@@ -2066,6 +2074,8 @@ def main(argv):
OPTIONS.output_metadata_path = a
elif o == "--disable_fec_computation":
OPTIONS.disable_fec_computation = True
elif o == "--force_non_ab":
OPTIONS.force_non_ab = True
else:
return False
return True
@@ -2102,6 +2112,7 @@ def main(argv):
"skip_compatibility_check",
"output_metadata_path=",
"disable_fec_computation",
"force_non_ab",
], extra_option_handler=option_handler)
if len(args) != 2:
@@ -2163,11 +2174,17 @@ def main(argv):
OPTIONS.skip_postinstall = True
ab_update = OPTIONS.info_dict.get("ab_update") == "true"
allow_non_ab = OPTIONS.info_dict.get("allow_non_ab") == "true"
if OPTIONS.force_non_ab:
assert allow_non_ab, "--force_non_ab only allowed on devices that supports non-A/B"
assert ab_update, "--force_non_ab only allowed on A/B devices"
generate_ab = not OPTIONS.force_non_ab and ab_update
# Use the default key to sign the package if not specified with package_key.
# package_keys are needed on ab_updates, so always define them if an
# ab_update is getting created.
if not OPTIONS.no_signing or ab_update:
# A/B update is getting created.
if not OPTIONS.no_signing or generate_ab:
if OPTIONS.package_key is None:
OPTIONS.package_key = OPTIONS.info_dict.get(
"default_system_dev_certificate",
@@ -2175,7 +2192,7 @@ def main(argv):
# Get signing keys
OPTIONS.key_passwords = common.GetKeyPasswords([OPTIONS.package_key])
if ab_update:
if generate_ab:
GenerateAbOtaPackage(
target_file=args[0],
output_file=args[1],