Proper split of BootControl and DynamicPartitionControl.
All dynamic/static partitions stuff are moved to
DynamicPartitionControlAndroid.
After this patch:
(1) BootControl remains a simple shim over the boot control HAL.
(BootControl still have two calls that is a delegate
to DynamicPartitionControl, which will be cleaned up
in follow up CLs.)
(2) DynamicPartitionControlInterface API is minimized. All
libdm and other Android specific details are hidden from the
API surface now.
Also move tests from boot_control_unittest to
dynamic_partition_control_unittest because functionalities are moved.
Test: update_engine_unittests
Change-Id: I6ed902197569f9f0ef40e02703634e9078a4b060
diff --git a/boot_control_android.h b/boot_control_android.h
index 65543ca..c81f86d 100644
--- a/boot_control_android.h
+++ b/boot_control_android.h
@@ -22,10 +22,10 @@
#include <string>
#include <android/hardware/boot/1.0/IBootControl.h>
-#include <base/files/file_util.h>
#include <liblp/builder.h>
#include "update_engine/common/boot_control.h"
+#include "update_engine/dynamic_partition_control_android.h"
#include "update_engine/dynamic_partition_control_interface.h"
namespace chromeos_update_engine {
@@ -58,35 +58,10 @@
private:
::android::sp<::android::hardware::boot::V1_0::IBootControl> module_;
- std::unique_ptr<DynamicPartitionControlInterface> dynamic_control_;
+ std::unique_ptr<DynamicPartitionControlAndroid> dynamic_control_;
friend class BootControlAndroidTest;
- // Wrapper method of IBootControl::getSuffix().
- bool GetSuffix(Slot slot, std::string* out) const;
-
- enum class DynamicPartitionDeviceStatus {
- SUCCESS,
- ERROR,
- TRY_STATIC,
- };
-
- DynamicPartitionDeviceStatus GetDynamicPartitionDevice(
- const base::FilePath& device_dir,
- const std::string& partition_name_suffix,
- Slot slot,
- std::string* device) const;
-
- // Return true if |partition_name_suffix| is a block device of
- // super partition metadata slot |slot|.
- bool IsSuperBlockDevice(const base::FilePath& device_dir,
- Slot slot,
- const std::string& partition_name_suffix) const;
-
- // Whether the target partitions should be loaded as dynamic partitions. Set
- // by PreparePartitionsForUpdate() per each update.
- bool is_target_dynamic_{false};
-
DISALLOW_COPY_AND_ASSIGN(BootControlAndroid);
};