Remove InstallerFactory, InstallerRunner
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 6 Feb 2020 11:14:59 +0000 (20:14 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 6 Feb 2020 11:14:59 +0000 (20:14 +0900)
These classes is moved to app-installer library.

Change-Id: I0a22d5b04826b53f7bec946951632daf7c02bf42
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/unified/installer_factory.h [deleted file]
src/unified/installer_runner.cc [deleted file]
src/unified/installer_runner.h [deleted file]
src/unified/unified_backend.cc
src/unified/unified_installer_factory.h

diff --git a/src/unified/installer_factory.h b/src/unified/installer_factory.h
deleted file mode 100644 (file)
index f574101..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2020 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 UNIFIED_INSTALLER_FACTORY_H_
-#define UNIFIED_INSTALLER_FACTORY_H_
-
-#include <common/pkgmgr_interface.h>
-
-#include <memory>
-
-namespace common_installer {
-
-class AppInstaller;
-
-class InstallerFactory {
- public:
-  virtual std::unique_ptr<AppInstaller> CreateInstaller(PkgMgrPtr pkgmgr,
-      int idx) = 0;
-};
-
-}  // namespace common_installer
-
-#endif  // UNIFIED_INSTALLER_FACTORY_H_
diff --git a/src/unified/installer_runner.cc b/src/unified/installer_runner.cc
deleted file mode 100644 (file)
index cc7815f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2020 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 "unified/installer_runner.h"
-
-#include <common/app_installer.h>
-#include <common/pkgmgr_interface.h>
-#include <manifest_parser/utils/logging.h>
-
-#include <list>
-
-#include "unified/installer_factory.h"
-
-namespace common_installer {
-
-InstallerRunner::InstallerRunner(
-    std::unique_ptr<InstallerFactory> factory, PkgMgrPtr pkgmgr)
-    : factory_(std::move(factory)), pkgmgr_(pkgmgr) {
-  if (!Init())
-    LOG(ERROR) << "Initialize failed!";
-}
-
-AppInstaller::Result InstallerRunner::Run() {
-  AppInstaller::Result result = AppInstaller::Result::OK;
-  std::list<std::unique_ptr<AppInstaller>>::iterator it(installers_.begin());
-  for (; it != installers_.end(); ++it) {
-    result = (*it)->Process();
-    if (result != AppInstaller::Result::OK)
-      break;
-  }
-  if (it != installers_.end() && result == AppInstaller::Result::ERROR) {
-    do {
-      if ((*it)->Undo() != AppInstaller::Result::OK)
-        result = AppInstaller::Result::UNDO_ERROR;
-    } while (it-- != installers_.begin());
-  } else {
-    --it;
-    do {
-      if ((*it)->Clean() != AppInstaller::Result::OK)
-        result = AppInstaller::Result::CLEANUP_ERROR;
-    } while (it-- != installers_.begin());
-  }
-
-  return result;
-}
-
-bool InstallerRunner::Init() {
-  for (int i = 0; i < pkgmgr_->GetRequestInfoCount(); i++) {
-    std::unique_ptr<AppInstaller> installer =
-        factory_->CreateInstaller(pkgmgr_, i);
-    installers_.emplace_back(std::move(installer));
-  }
-
-  return true;
-}
-
-}  // namespace common_installer
diff --git a/src/unified/installer_runner.h b/src/unified/installer_runner.h
deleted file mode 100644 (file)
index 2a4adec..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2020 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 UNIFIED_INSTALLER_RUNNER_H_
-#define UNIFIED_INSTALLER_RUNNER_H_
-
-#include <common/app_installer.h>
-#include <common/pkgmgr_interface.h>
-
-#include <memory>
-#include <list>
-
-namespace common_installer {
-
-class InstallerFactory;
-
-class InstallerRunner {
- public:
-  explicit InstallerRunner(
-      std::unique_ptr<InstallerFactory> factory, PkgMgrPtr pkgmgr);
-
-  AppInstaller::Result Run();
-
- private:
-  bool Init();
-
-  std::unique_ptr<InstallerFactory> factory_;
-  PkgMgrPtr pkgmgr_;
-  std::list<std::unique_ptr<AppInstaller>> installers_;
-};
-
-}  // namespace common_installer
-
-#endif  // UNIFIED_INSTALLER_RUNNER_H_
index a6eaddbd5c14c4b9264a47b77a741f67ff9b19de..ddff9bc3091237efa55d8c74842d3889cce6c567 100644 (file)
@@ -3,9 +3,9 @@
 // found in the LICENSE file.
 
 #include <common/app_installer.h>
+#include <common/installer_factory.h>
+#include <common/installer_runner.h>
 
-#include "unified/installer_factory.h"
-#include "unified/installer_runner.h"
 #include "unified/unified_installer_factory.h"
 
 namespace ci = common_installer;
index 53caa877cdbcff0df1bd713d3b69538a54193e13..9e12aa8f2e189b85833d29827ad316b9296e03d4 100644 (file)
@@ -5,12 +5,11 @@
 #ifndef UNIFIED_UNIFIED_INSTALLER_FACTORY_H_
 #define UNIFIED_UNIFIED_INSTALLER_FACTORY_H_
 
+#include <common/installer_factory.h>
 #include <common/pkgmgr_interface.h>
 
 #include <memory>
 
-#include "unified/installer_factory.h"
-
 namespace common_installer {
 
 class AppInstaller;