Implement pkg enable/disable 70/79070/3 accepted/tizen/common/20160719.171836 accepted/tizen/ivi/20160718.104404 accepted/tizen/mobile/20160718.104254 accepted/tizen/tv/20160718.104132 accepted/tizen/wearable/20160718.104313 submit/tizen/20160718.020809
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 8 Jul 2016 05:27:18 +0000 (14:27 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 11 Jul 2016 07:48:29 +0000 (16:48 +0900)
Related changes
[pkgmgr-tool] https://review.tizen.org/gerrit/78916
[slp-pkgmgr] https://review.tizen.org/gerrit/78917
[pkgmgr-server] https://review.tizen.org/gerrit/78918
[app-installers] https://review.tizen.org/gerrit/78919

Change-Id: Ia991ce2e270bfb235b6191bf9ce05384d65e7c26
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/tpk/tpk_installer.cc
src/tpk/tpk_installer.h

index 20a81eabe9e8a82b5cc55247099dedfceb7ae932..c8480dcfdfb5e3e1e7a7a6450f5a8cf00d159ca3 100644 (file)
@@ -45,6 +45,7 @@
 #include <common/step/pkgmgr/step_run_parser_plugins.h>
 #include <common/step/pkgmgr/step_unregister_app.h>
 #include <common/step/pkgmgr/step_update_app.h>
+#include <common/step/pkgmgr/step_update_pkg_disable_info.h>
 #include <common/step/rds/step_rds_parse.h>
 #include <common/step/recovery/step_open_recovery_file.h>
 #include <common/step/security/step_check_old_certificate.h>
@@ -128,6 +129,12 @@ void TpkInstaller::Prepare() {
     case ci::RequestType::Clear:
       ClearSteps();
       break;
+    case ci::RequestType::EnablePkg:
+      EnablePkgSteps();
+      break;
+    case ci::RequestType::DisablePkg:
+      DisablePkgSteps();
+      break;
     default:
       AddStep<ci::configuration::StepFail>();
       break;
@@ -441,4 +448,27 @@ void TpkInstaller::ClearSteps() {
   AddStep<ci::filesystem::StepClearData>();
 }
 
+void TpkInstaller::DisablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+    ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+    ci::Plugin::ActionType::Uninstall);
+}
+
+void TpkInstaller::EnablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+    ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+    ci::Plugin::ActionType::Install);
+}
+
 }  // namespace tpk
index ff33a60c93b993d45ab032543c78f26d41ffed65..7de06d9412a58b185aea63e0e9054695b0b5de1d 100644 (file)
@@ -30,6 +30,8 @@ class TpkInstaller : public common_installer::AppInstaller {
   void ReinstallSteps();
   void DeltaSteps();
   void MoveSteps();
+  void DisablePkgSteps();
+  void EnablePkgSteps();
   void RecoverySteps();
   void MountInstallSteps();
   void MountUpdateSteps();