ErrorInstallOspServcie, ///< Failure in installing osp service
ErrorPluginInstallationFailed, ///< failure in plugin installation
ErrorWidgetUninstallationFailed, ///< failure in uninstallation
+ ErrorNotSupportRDSUpdate, ///< failure in rds update
ErrorUnknown = 140, ///< do not use this error code.
};
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
LogDebug("backup resource directory path : " << backPath);
std::string pkgPath = m_context.locations->getPackageInstallationDir();
+ if (0 == access(backPath.c_str(), F_OK)) {
+ WrtUtilRemove(backPath);
+ }
LogDebug("copy : " << pkgPath << " to " << backPath);
if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {
LogError("Failed to rename " << pkgPath << " to " << backPath);
DECLARE_JOB_EXCEPTION(Base, EncryptionFailed, ErrorEncryptionFailed)
DECLARE_JOB_EXCEPTION(Base, InstallOspsvcFailed, ErrorInstallOspServcie)
DECLARE_JOB_EXCEPTION(Base, PrivilegeLevelViolation, ErrorPrivilegeLevelViolation)
+DECLARE_JOB_EXCEPTION(Base, NotSupportRDSUpdate, ErrorNotSupportRDSUpdate)
} //namespace
} //namespace
} //namespace