DynamicPartitionControlAndroid::LoadMetadataBuilder: always NewForUpdate
MetadataBuilder::NewForUpdate handles both retrofit DAP and launch
DAP devices, so there is no need to differetiate using sysprops here.
In tests, LoadMetadataBuilder is just mocked, because there's no
interesting logic to be tested.
Test: unit tests
Test: manually apply OTA on launch device
Change-Id: Id24b105e523435f4f273cb57f995e6b778703ef1
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index bfdd375..b5b22df 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -175,16 +175,8 @@
const std::string& super_device,
uint32_t source_slot,
uint32_t target_slot) {
- std::unique_ptr<MetadataBuilder> builder;
-
- if (target_slot != BootControlInterface::kInvalidSlot &&
- IsDynamicPartitionsRetrofit()) {
- builder = MetadataBuilder::NewForUpdate(
- PartitionOpener(), super_device, source_slot, target_slot);
- } else {
- builder =
- MetadataBuilder::New(PartitionOpener(), super_device, source_slot);
- }
+ auto builder = MetadataBuilder::NewForUpdate(
+ PartitionOpener(), super_device, source_slot, target_slot);
if (builder == nullptr) {
LOG(WARNING) << "No metadata slot "