[REFACTOR] DynamicPartitionControl: combine DAP feature flag APIs
Combine IsDynamicPartitionsEnabled/Retrofit into one API that
returns a FeatureFlag struct instead.
This allows us to add new feature flags more easily.
Test: unittest
Change-Id: I32f0f0c4d5c636d2eac3bf99d6f92fcc6b71c7a9
diff --git a/boot_control_android.cc b/boot_control_android.cc
index b820ded..44fc0fa 100644
--- a/boot_control_android.cc
+++ b/boot_control_android.cc
@@ -193,7 +193,7 @@
// current payload doesn't encode them as dynamic partitions. This may happen
// when applying a retrofit update on top of a dynamic-partitions-enabled
// build.
- if (dynamic_control_->IsDynamicPartitionsEnabled() &&
+ if (dynamic_control_->GetDynamicPartitionsFeatureFlag().IsEnabled() &&
(slot == GetCurrentSlot() || is_target_dynamic_)) {
switch (GetDynamicPartitionDevice(
device_dir, partition_name_suffix, slot, device)) {
@@ -288,7 +288,7 @@
"resources.\n"
<< "run adb enable-verity to deactivate if required and try again.";
}
- if (!dynamic_control_->IsDynamicPartitionsEnabled()) {
+ if (!dynamic_control_->GetDynamicPartitionsFeatureFlag().IsEnabled()) {
return true;
}