Revert "Fix to send different signal based on recovery info" 38/167938/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 23 Jan 2018 05:18:25 +0000 (14:18 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 23 Jan 2018 05:20:36 +0000 (14:20 +0900)
This reverts commit c9c50607c02b66ae82dd120374f68e8a77813328.

Change-Id: I92028da9cc1888087288c75031fa1ef1602d6c29

src/common/app_installer.cc
src/common/pkgmgr_signal.cc
src/common/pkgmgr_signal.h

index 57643882f02caa2567a2237ca504cf7c465f60a7..c670a3aa44c1995a39930c3e33c43a42b4704879 100644 (file)
@@ -199,8 +199,7 @@ void AppInstaller::SendProgress(int progress) {
     // send START signal as soon as possible if not sent
     if (pi_->state() == PkgmgrSignal::State::NOT_SENT) {
       if (!context_->pkgid.get().empty()) {
-        pi_->SendStarted(context_->pkg_type.get(), context_->pkgid.get(),
-            context_->recovery_info.get());
+        pi_->SendStarted(context_->pkg_type.get(), context_->pkgid.get());
       }
     }
 
index da070a2315e7dad2d03d6695aa9b84c0c57cadef..d5444233d067661bac9cc4869493c0f17af61a87 100644 (file)
@@ -59,8 +59,7 @@ PkgmgrSignal::PkgmgrSignal(pkgmgr_installer* pi, RequestType req_type)
 }
 
 bool PkgmgrSignal::SendStarted(
-    const std::string& type, const std::string& pkgid,
-    const RecoveryInfo& recovery_info) {
+    const std::string& type, const std::string& pkgid) {
   if (state_ != State::NOT_SENT) {
     return false;
   }
@@ -72,23 +71,14 @@ bool PkgmgrSignal::SendStarted(
   if (key == kEventStr.end()) {
     return false;
   }
-  const char* value;
-  if (request_type_ == ci::RequestType::Recovery) {
-    value = GetRecoverySignalValue(recovery_info.recovery_file->type());
-    if (!value)
-      return false;
-  }
-  else {
-    value = key->second;
-  }
-  if (!SendSignal(PKGMGR_INSTALLER_START_KEY_STR, value, type, pkgid)) {
+  if (!SendSignal(PKGMGR_INSTALLER_START_KEY_STR, key->second, type, pkgid)) {
     return false;
   }
   for (auto l : user_list_) {
     key = kEventStr.find(l.second);
     if (key == kEventStr.end())
       continue;
-    SendSignal(l.first, PKGMGR_INSTALLER_START_KEY_STR, value, type,
+    SendSignal(l.first, PKGMGR_INSTALLER_START_KEY_STR, key->second, type,
         pkgid);
   }
 
@@ -105,24 +95,6 @@ bool PkgmgrSignal::SendStarted(
   return true;
 }
 
-const char* PkgmgrSignal::GetRecoverySignalValue(RequestType recovery_type) {
-  switch (recovery_type) {
-  case RequestType::Install:
-  case RequestType::Uninstall:
-  case RequestType::MountInstall:
-    return PKGMGR_INSTALLER_UNINSTALL_EVENT_STR;
-  case RequestType::Update:
-  case RequestType::Reinstall:
-  case RequestType::Delta:
-  case RequestType::MountUpdate:
-  case RequestType::ReadonlyUpdateInstall:
-    return PKGMGR_INSTALLER_UPGRADE_EVENT_STR;
-  default:
-    LOG(ERROR) << "Unsupported request type for recovery";
-    return nullptr;
-  }
-}
-
 bool PkgmgrSignal::SendProgress(int progress,
     const std::string& type, const std::string& pkgid) {
   if (state_ != State::STARTED) {
index 899dc20180f79c66d4e096ac5552cc499b4eb282..b5bbd845094a27f8e7e939f9d2c3dc3dc5613104 100644 (file)
@@ -50,14 +50,12 @@ class PkgmgrSignal {
    *
    * \param type package type
    * \param pkgid package pkgid
-   * \param recovery_info recovery information
    *
    * \return true if success
    */
   bool SendStarted(
       const std::string& type = std::string(),
-      const std::string& pkgid = std::string(),
-      const RecoveryInfo& recovery_info = RecoveryInfo());
+      const std::string& pkgid = std::string());
 
   /**
    * "progress" Signal sending
@@ -122,7 +120,6 @@ class PkgmgrSignal {
   bool SendAppids(uid_t uid, const std::string& type,
       const std::string& pkgid) const;
   bool SetupUserList(const std::string& pkgid);
-  const char* GetRecoverySignalValue(RequestType recovery_type);
 
   pkgmgr_installer* pi_;
   static State state_;