Allow on device spl downgrade check to be bypassed
Certain OEMs bootloader implementation allow SPL downgrades, therefore
provide an option to bypass on device SPL checks.
Test: th
Bug: 306271739
Change-Id: Iee70ac5bc716c4fed9869928ba6e41c00eab5fd5
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index 267805e..8350825 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -485,7 +485,7 @@
block_size_ = manifest_.block_size();
- if (!CheckSPLDowngrade()) {
+ if (!install_plan_->spl_downgrade && !CheckSPLDowngrade()) {
*error = ErrorCode::kPayloadTimestampError;
return false;
}
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index 93aebce..bad34a0 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -171,6 +171,9 @@
// False otherwise.
bool powerwash_required{false};
+ // True if and only if this is an SPL downgrade OTA
+ bool spl_downgrade{false};
+
// True if the updated slot should be marked active on success.
// False otherwise.
bool switch_slot_on_reboot{true};