Implement PKGMGR_REQUEST_TYPE_CLEARDATA for wgt-backend 48/58248/3
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 28 Jan 2016 13:09:20 +0000 (14:09 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 3 Feb 2016 09:19:15 +0000 (01:19 -0800)
Verify by running: pkgcmd -t wgt -c -n $pkgid_of_installed_package
and check if all content of apps_rw/$pkgid/data/ was removed.

Requires:
 - https://review.tizen.org/gerrit/58245

Change-Id: I56a3435bbda9f2034784a52e0f0ab81a1e1f9ca8

src/hybrid/hybrid_installer.cc
src/wgt/wgt_installer.cc

index d26de1d..e7ea48a 100644 (file)
@@ -11,6 +11,7 @@
 #include <common/step/step_copy.h>
 #include <common/step/step_copy_backup.h>
 #include <common/step/step_copy_storage_directories.h>
+#include <common/step/step_clear_data.h>
 #include <common/step/step_create_icons.h>
 #include <common/step/step_create_storage_directories.h>
 #include <common/step/step_delta_patch.h>
@@ -198,6 +199,10 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::filesystem::StepRecoverFiles>();
       AddStep<ci::security::StepRecoverSecurity>();
       break;
+    case ci::RequestType::Clear:
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::filesystem::StepClearData>();
+      break;
     default:
       AddStep<ci::configuration::StepFail>();
       break;
index a5eb03e..8cf97b0 100644 (file)
@@ -11,6 +11,7 @@
 #include <common/step/step_check_blacklist.h>
 #include <common/step/step_create_icons.h>
 #include <common/step/step_create_storage_directories.h>
+#include <common/step/step_clear_data.h>
 #include <common/step/step_copy.h>
 #include <common/step/step_copy_backup.h>
 #include <common/step/step_copy_storage_directories.h>
@@ -191,6 +192,11 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::security::StepRecoverSecurity>();
       break;
     }
+    case ci::RequestType::Clear: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::filesystem::StepClearData>();
+      break;
+    }
     default: {
       AddStep<ci::configuration::StepFail>();
     }