Recovery mode for hybrid application 19/57519/5 devel/ivi accepted/tizen/mobile/20160203.051934 accepted/tizen/tv/20160203.051947 accepted/tizen/wearable/20160203.052018 submit/devel/ivi/20160202.111818 submit/tizen/20160203.003555
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 18 Jan 2016 09:31:48 +0000 (10:31 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 27 Jan 2016 12:18:55 +0000 (13:18 +0100)
Requires:
 - https://review.tizen.org/gerrit/58104

Change-Id: I174cd185ad12bb97b406d250b3d339568e79345f

src/hybrid/hybrid_installer.cc

index d2070d5..d26de1d 100644 (file)
 #include <common/step/step_remove_files.h>
 #include <common/step/step_remove_icons.h>
 #include <common/step/step_revoke_security.h>
+#include <common/step/step_open_recovery_file.h>
+#include <common/step/step_recover_application.h>
+#include <common/step/step_recover_files.h>
+#include <common/step/step_recover_icons.h>
+#include <common/step/step_recover_manifest.h>
+#include <common/step/step_recover_security.h>
+#include <common/step/step_recover_storage_directories.h>
+#include <common/step/step_remove_temporary_directory.h>
 #include <common/step/step_rollback_deinstallation_security.h>
 #include <common/step/step_rollback_installation_security.h>
 #include <common/step/step_unregister_app.h>
@@ -42,6 +50,7 @@
 #include "wgt/step/step_check_wgt_background_category.h"
 #include "wgt/step/step_create_symbolic_link.h"
 #include "wgt/step/step_generate_xml.h"
+#include "wgt/step/step_parse_recovery.h"
 #include "wgt/step/step_remove_encryption_data.h"
 #include "wgt/step/step_wgt_patch_icons.h"
 #include "wgt/step/step_wgt_patch_storage_directories.h"
@@ -173,8 +182,21 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::pkgmgr::StepUpdateApplication>();
       break;
     case ci::RequestType::Recovery:
-      // TODO(t.iwanek): implement recovery for hybrid apps if possible
-      AddStep<ci::configuration::StepFail>();
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::recovery::StepOpenRecoveryFile>();
+      AddStep<ci::parse::StepParseManifest>(
+          ci::parse::StepParseManifest::ManifestLocation::RECOVERY,
+          ci::parse::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<hybrid::parse::StepStashTpkConfig>();
+      AddStep<wgt::parse::StepParseRecovery>();
+      AddStep<hybrid::parse::StepMergeTpkConfig>();
+      AddStep<ci::pkgmgr::StepRecoverApplication>();
+      AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
+      AddStep<ci::filesystem::StepRecoverIcons>();
+      AddStep<ci::filesystem::StepRecoverManifest>();
+      AddStep<ci::filesystem::StepRecoverStorageDirectories>();
+      AddStep<ci::filesystem::StepRecoverFiles>();
+      AddStep<ci::security::StepRecoverSecurity>();
       break;
     default:
       AddStep<ci::configuration::StepFail>();