New step for recover per user storage directories 49/112049/8
authorDamian Pietruchowski <d.pietruchow@samsung.com>
Wed, 25 Jan 2017 12:54:39 +0000 (13:54 +0100)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Fri, 10 Feb 2017 08:38:24 +0000 (00:38 -0800)
This directories should be deleted after recover of installation and mount installation

Change-Id: I2997b5f826e550f80aed0c12df21b2d4de2c5e11
Signed-off-by: Damian Pietruchowski <d.pietruchow@samsung.com>
src/common/step/filesystem/step_recover_per_user_storage_directories.cc [new file with mode: 0644]
src/common/step/filesystem/step_recover_per_user_storage_directories.h [new file with mode: 0644]

diff --git a/src/common/step/filesystem/step_recover_per_user_storage_directories.cc b/src/common/step/filesystem/step_recover_per_user_storage_directories.cc
new file mode 100644 (file)
index 0000000..8d757f1
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "common/step/filesystem/step_recover_per_user_storage_directories.h"
+#include "common/step/filesystem/step_remove_per_user_storage_directories.h"
+
+namespace bf = boost::filesystem;
+
+namespace common_installer {
+namespace filesystem {
+
+Step::Status StepRecoverPerUserStorageDirectories::RecoveryNew() {
+  StepRemovePerUserStorageDirectories step(context_);
+  Status status = step.precheck();
+  if(status != Status::OK)
+      return status;
+  return step.process();
+}
+
+}  // namespace filesystem
+}  // namespace common_installer
+
diff --git a/src/common/step/filesystem/step_recover_per_user_storage_directories.h b/src/common/step/filesystem/step_recover_per_user_storage_directories.h
new file mode 100644 (file)
index 0000000..6e377f7
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_STEP_FILESYSTEM_STEP_RECOVER_PER_USER_STORAGE_DIRECTORIES_H_
+#define COMMON_STEP_FILESYSTEM_STEP_RECOVER_PER_USER_STORAGE_DIRECTORIES_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "common/installer_context.h"
+#include "common/step/recovery/step_recovery.h"
+
+namespace common_installer {
+namespace filesystem {
+
+/**
+ * @brief recovers data and shared directories of application for user
+ *
+ * This is the part of Recovery Mode that is responsible for restoring data and
+ * shared directories for users in case partial install occurs.
+ */
+class StepRecoverPerUserStorageDirectories : public recovery::StepRecovery {
+ public:
+  using StepRecovery::StepRecovery;
+
+  Status RecoveryNew() override;
+  Status RecoveryUpdate() override { return Status::OK; }
+
+ private:
+
+  STEP_NAME(RecoverStorageDirectories)
+};
+
+}  // namespace filesystem
+}  // namespace common_installer
+
+#endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_PER_USER_STORAGE_DIRECTORIES_H_