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 =
} 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!");
// Already installed TizenAppId. return failed
return ConfigureResult::Failed_AlreadyInstalled;
}
+ if (!checkSupportRDSUpdate(configData)) {
+ return ConfigureResult::Failed_NotSupportRDSUpdate;
+ }
m_installerContext.isUpdateMode = true;
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
/* 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