AddStep(&TaskDatabase::StepLiveboxDBInsert);
AddAbortStep(&TaskDatabase::StepAbortDBInsert);
+ AddAbortStep(&TaskDatabase::StepAbortAceDBInsert);
}
void TaskDatabase::StepWrtDBInsert()
{
m_handleToRemove = WidgetDAOReadOnly::getHandle(
m_context.widgetConfig.tzAppid);
+
+ std::string makeAppid =
+ DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + "." +
+ "backup";
+ m_backAppId = DPL::FromUTF8String(makeAppid);
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
ThrowMsg(Exceptions::DatabaseFailure,
"Given tizenId not found for update installation");
}
- WidgetDAO::registerOrUpdateWidget(
+
+ WidgetDAO::backupAndUpdateWidget(
+ m_backAppId,
m_context.widgetConfig.tzAppid,
m_context.widgetConfig,
m_context.wacSecurity);
WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage(
m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
vconfData[
+ WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage(
+ m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
+ vconfData[
WrtDB::VconfConfig::GetVconfKeyMemorySavingMode(
m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_OFF;
LogWarning("[DB Update Task] Aborting... (DB Clean)");
Try
{
- WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
+ WidgetDAO::restoreUpdateWidget(m_backAppId,
+ m_context.widgetConfig.tzAppid);
LogDebug("Cleaning DB successful!");
}
Catch(DPL::DB::SqlConnection::Exception::Base)
{
LogError("Failed to handle StepAbortDBClean!");
}
+}
+
+void TaskDatabase::StepAbortAceDBInsert()
+{
+ LogWarning("[DB Update Task] ACE DB Aborting... (DB Clean)");
ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
// Remove also old one. If it was already updated nothing wrong will happen,
if (INVALID_WIDGET_HANDLE != m_handleToRemove) {
ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
}
+
+ if (!AceApi::registerAceWidgetFromDB(m_handleToRemove))
+ {
+ LogError("ace database restore failed");
+ }
+ LogDebug("Ace data inserted");
}
void TaskDatabase::StepLiveboxDBInsert()