X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_install%2Fjob_widget_install.cpp;h=72c2332bf849b5b485d0699d500fb4225270c0b7;hb=64adfd29349f450e7739213765abbc2db7f7f57a;hp=aa46a4ebfdf7f41989c78054848e8b21c032afac;hpb=bb6a49cba8cf075304d971b519809b1816bc53ad;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index aa46a4e..72c2332 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -90,6 +90,7 @@ const size_t PACKAGE_ID_LENGTH = 10; static const DPL::String SETTING_VALUE_ENCRYPTION = L"encryption"; static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = L"enable"; +static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE = L"disable"; const DPL::String SETTING_VALUE_INSTALLTOEXT_NAME = L"install-location"; const DPL::String SETTING_VALUE_INSTALLTOEXT_PREPER_EXT = @@ -139,6 +140,9 @@ class InstallerTaskFail : } else if (m_result == ConfigureResult::Failed_DrmError) { ThrowMsg(Jobs::WidgetInstall::Exceptions::DRMFailed, "drm failed"); + } else if (m_result == ConfigureResult::Failed_NotSupportRDSUpdate) { + ThrowMsg(Jobs::WidgetInstall::Exceptions::NotSupportRDSUpdate, + "RDS update failed"); } else { ThrowMsg(Jobs::WidgetInstall::Exceptions::NotAllowed, "widget installation or update not allowed!"); @@ -480,6 +484,9 @@ ConfigureResult JobWidgetInstall::ConfigureInstallation( // Already installed TizenAppId. return failed return ConfigureResult::Failed_AlreadyInstalled; } + if (!checkSupportRDSUpdate(configData)) { + return ConfigureResult::Failed_NotSupportRDSUpdate; + } m_installerContext.isUpdateMode = true; } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) { @@ -1104,5 +1111,40 @@ bool JobWidgetInstall::DecryptDRMWidget(std::string /*widgetPath*/, /* TODO */ return false; } + +bool JobWidgetInstall::checkSupportRDSUpdate(const WrtDB::ConfigParserData + &configInfo) +{ + if (m_installerContext.mode.command == + InstallMode::Command::REINSTALL) + { + DPL::String configValue = SETTING_VALUE_ENCRYPTION_DISABLE; + DPL::String dbValue = SETTING_VALUE_ENCRYPTION_DISABLE; + + WidgetDAOReadOnly dao(m_installerContext.widgetConfig.tzAppid); + WrtDB::WidgetSettings widgetSettings; + dao.getWidgetSettings(widgetSettings); + + FOREACH(it, widgetSettings) { + if (it->settingName == SETTING_VALUE_ENCRYPTION) { + dbValue = it->settingValue; + } + } + + FOREACH(data, configInfo.settingsList) + { + if (data->m_name == SETTING_VALUE_ENCRYPTION) + { + configValue = data->m_value; + } + } + if (configValue != dbValue) { + LogError("Not Support RDS mode because of encryption setting"); + return false; + } + } + + return true; +} } //namespace WidgetInstall } //namespace Jobs