PkgmgrSignal::PkgmgrSignal(pkgmgr_installer* pi)
: pi_(pi), state_(State::NOT_SENT), request_type_(RequestType::Unknown),
- error_message_sent_(false) {
+ error_message_sent_(false), is_upgrade_(false) {
uid_ = pkgmgr_installer_get_uid(pi_);
request_mode_ = GetRequestMode(uid_);
}
if (key == kEventStr.end())
return false;
+ if (strcmp(key->second, PKGMGR_INSTALLER_UPGRADE_EVENT_STR) == 0)
+ is_upgrade_ = true;
+
+ pkgmgr_installer_set_is_upgrade(pi_, is_upgrade_ ? 1 : 0);
+
if (!SendSignal(PKGMGR_INSTALLER_START_KEY_STR, key->second, type, pkgid))
return false;
if (state_ != State::STARTED)
return false;
+ pkgmgr_installer_set_is_upgrade(pi_, is_upgrade_ ? 1 : 0);
+
if (result != Step::Status::OK && !error_message_sent_) {
if (!SendSignal(
PKGMGR_INSTALLER_ERROR_KEY_STR,
if (state_ != State::STARTED)
return false;
+ pkgmgr_installer_set_is_upgrade(pi_, is_upgrade_ ? 1 : 0);
+
std::string error_value = std::to_string(static_cast<int>(result));
if (!error_message.empty())
error_value = error_value + ":" + error_message;