From 81641afae444f774163d657ec9c3553a4845c099 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 26 Oct 2021 16:03:25 -0700 Subject: Allow data wipe for full OTAs Test: th Change-Id: I7a751b461a5442d22ebca07c98624f35c02dca15 --- tools/releasetools/ota_from_target_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 4eb2f0c57a..17f373ebe1 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1401,8 +1401,8 @@ def main(argv): # We should only allow downgrading incrementals (as opposed to full). # Otherwise the device may go back from arbitrary build with this full # OTA package. - if OPTIONS.incremental_source is None: - raise ValueError("Cannot generate downgradable full OTAs") + if OPTIONS.incremental_source is None and OPTIONS.downgrade: + raise ValueError("Cannot generate downgradable full OTAs") # TODO(xunchang) for retrofit and partial updates, maybe we should rebuild the # target-file and reload the info_dict. So the info will be consistent with -- cgit v1.2.3