Merge "libsnapshot: forward declare IImageManager"

This commit is contained in:
Treehugger Robot 2019-08-06 15:28:47 +00:00 committed by Gerrit Code Review
commit bb89da85c4
3 changed files with 13 additions and 1 deletions

View file

@ -23,7 +23,6 @@
#include <android-base/unique_fd.h>
#include <libdm/dm_target.h>
#include <libfiemap/image_manager.h>
#ifndef FRIEND_TEST
#define FRIEND_TEST(test_set_name, individual_test) \
@ -32,6 +31,11 @@
#endif
namespace android {
namespace fiemap {
class IImageManager;
} // namespace fiemap
namespace snapshot {
enum class UpdateState {
@ -69,6 +73,8 @@ class SnapshotManager final {
virtual bool IsRunningSnapshot() const = 0;
};
~SnapshotManager();
// Return a new SnapshotManager instance, or null on error. The device
// pointer is owned for the lifetime of SnapshotManager. If null, a default
// instance will be created.

View file

@ -26,6 +26,7 @@
#include <android-base/unique_fd.h>
#include <ext4_utils/ext4_utils.h>
#include <libdm/dm.h>
#include <libfiemap/image_manager.h>
namespace android {
namespace snapshot {
@ -57,6 +58,10 @@ bool DeviceInfo::IsRunningSnapshot() const {
return true;
}
// Note: IIMageManager is an incomplete type in the header, so the default
// destructor doesn't work.
SnapshotManager::~SnapshotManager() {}
std::unique_ptr<SnapshotManager> SnapshotManager::New(IDeviceInfo* info) {
if (!info) {
info = new DeviceInfo();

View file

@ -24,6 +24,7 @@
#include <android-base/strings.h>
#include <gtest/gtest.h>
#include <libfiemap/image_manager.h>
namespace android {
namespace snapshot {