DynamicPartitionControl: support retrofit devices

On retrofit devices:

* The retrofit update includes block devices at source
  slot (for example, system_a, vendor_a, product_a).
  This is done automatically because the retrofit update
  does not look different from regular updates in OTA
  client's perspective.

* The first update after the retrofit update includes
  the rest of the block devices (in the above example,
  system_b, vendor_b and product_b).

In order to do the second,

* use NewForUpdate() API from liblp to automatically
  include block devices at the target slot when the metadata
  is loaded.

* Use FlashPartitionTable() API to flash metadata to system_b
  directly without reading existing metadata from it.

Test: manual OTA on retrofit devices
Bug: 118506262
Change-Id: Ib2c15b8a1a04271320bfef408813723a5b2a7bd7
diff --git a/boot_control_android.cc b/boot_control_android.cc
index 4568fe4..1d13139 100644
--- a/boot_control_android.cc
+++ b/boot_control_android.cc
@@ -119,7 +119,8 @@
     const string& partition_name_suffix,
     Slot slot,
     string* device) {
-  auto builder = dynamic_control->LoadMetadataBuilder(super_device, slot);
+  auto builder = dynamic_control->LoadMetadataBuilder(
+      super_device, slot, BootControlInterface::kInvalidSlot);
 
   if (builder == nullptr) {
     if (!dynamic_control->IsDynamicPartitionsEnabled()) {
@@ -284,8 +285,8 @@
     Slot target_slot,
     const string& target_suffix,
     const PartitionMetadata& partition_metadata) {
-  auto builder =
-      dynamic_control->LoadMetadataBuilder(super_device, source_slot);
+  auto builder = dynamic_control->LoadMetadataBuilder(
+      super_device, source_slot, target_slot);
   if (builder == nullptr) {
     // TODO(elsk): allow reconstructing metadata from partition_metadata
     // in recovery sideload.