Remove unused logic 42/248742/3
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 2 Dec 2020 04:02:06 +0000 (13:02 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 3 Dec 2020 01:08:19 +0000 (01:08 +0000)
According to the previous Tizen concept, same package could be
installed both global and user pkg. And when user tries to
uninstall user pkg, symlinks for global pkg should be created to
change pkg as global pkg. This concept is no longer exists so
related logic should be removed.

Change-Id: I1fdf9b39043940ef3a2ede05695100acaac22105
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/installer/app_installer.cc
src/common/step/filesystem/step_create_globalapp_symlinks.cc

index 9cd1e4e..8c1f6ef 100644 (file)
@@ -418,7 +418,6 @@ void AppInstaller::UninstallSteps() {
   AddStep<ci::filesystem::StepRemoveTep>();
   AddStep<ci::security::StepRevokeSecurity>();
   AddStep<ci::pkgmgr::StepRemoveManifest>();
-  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
 }
 
 void AppInstaller::ReinstallSteps() {
index 9672b45..3a09334 100644 (file)
@@ -22,30 +22,16 @@ namespace common_installer {
 namespace filesystem {
 
 common_installer::Step::Status StepCreateGlobalAppSymlinks::process() {
-  if (context_->is_readonly_package.get())
+  if (context_->is_readonly_package.get() ||
+      context_->request_mode.get() == RequestMode::USER)
     return Step::Status::OK;
-  std::string package_id = context_->pkgid.get();
 
-  if (context_->request_type.get() == RequestType::Uninstall) {
-    PkgQueryInterface pkg_query(context_->pkgid.get(), kGlobalUserUid);
-    if ((context_->request_mode.get() == RequestMode::USER) &&
-        pkg_query.IsPackageInstalled()) {
-      LOG(INFO) << "Creating globalapp symlinks for current user, package: "
-              << package_id;
-      if (!CreateGlobalAppSymlinksForUser(package_id, context_->uid.get())) {
-        LOG(ERROR) << "Failed to create globalapp symlinks";
-        return Status::GLOBALSYMLINK_ERROR;
-      }
-    }
-  } else {
-    if (context_->request_mode.get() == RequestMode::GLOBAL) {
-      LOG(INFO) << "Creating globalapp symlinks for all user, package: "
-                << package_id;
-      if (!CreateGlobalAppSymlinksForAllUsers(package_id)) {
-        LOG(ERROR) << "Failed to create globalapp symlinks";
-        return Status::GLOBALSYMLINK_ERROR;
-      }
-    }
+  std::string package_id = context_->pkgid.get();
+  LOG(INFO) << "Creating globalapp symlinks for all user, package: "
+            << package_id;
+  if (!CreateGlobalAppSymlinksForAllUsers(package_id)) {
+    LOG(ERROR) << "Failed to create globalapp symlinks";
+    return Status::GLOBALSYMLINK_ERROR;
   }
 
   return Status::OK;