#include <dpl/log/log.h>
namespace InstallerCallbacksTranslate {
-WrtErrStatus TranslateError(CommonError::Type status)
-{
- switch (status) {
- case CommonError::WrtSuccess:
- return WRT_SUCCESS;
-
- case CommonError::HandleNotFound:
- return WRT_ERROR_HANDLE_NOT_FOUND;
-
- case CommonError::AlreadyRunning:
- return WRT_ERROR_ALREADY_RUNNING;
-
- case CommonError::InvalidLanguage:
- return WRT_ERROR_INVALID_LANGUAGE;
-
- case CommonError::AlreadyStopped:
- return WRT_ERROR_ALREADY_STOPPED;
-
- case CommonError::StillAuthorizing:
- return WRT_ERROR_STILL_AUTHORIZING;
-
- case CommonError::EarlyKilled:
- return WRT_ERROR_EARLY_KILLED;
-
- case CommonError::AccessDenied:
- return WRT_ERROR_ACCESS_DENIED;
-
- default:
- LogError("Untranslatable error: " << status);
- return WRT_ERROR_INTERNAL;
- }
-}
-
-void StatusCallback(int widget_handle,
- CommonError::Type result,
- void *data)
-{
- LogDebug("StatusCallback called " << widget_handle << " | " << result);
- Assert(data != NULL);
-
- WrtErrStatus error = TranslateError(result);
- StatusCallbackStruct* statusCallbackStruct =
- static_cast<StatusCallbackStruct*>(data);
-
- if (statusCallbackStruct->status_callback) {
- statusCallbackStruct->status_callback(widget_handle,
- error,
- statusCallbackStruct->userdata);
- } else {
- LogInfo("StatusCallback: ignoring NULL callback pointer");
- }
-
- delete statusCallbackStruct;
-}
// callback for finished install
void installFinishedCallback(void *userParam,
- WidgetHandle widget_handle,
- Jobs::WidgetInstall::Exceptions::Type status)
+ std::string tizenId,
+ Jobs::WidgetInstall::Exceptions::Type status)
{
Assert(userParam != NULL);
errorStatus = WRT_SUCCESS;
break;
- case Jobs::WidgetInstall::Exceptions::ErrorInvalidWidgetPackage:
- errorStatus = WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE;
- break;
-
case Jobs::WidgetInstall::Exceptions::ErrorWidgetDoesNotExist:
errorStatus = WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST;
break;
- case Jobs::WidgetInstall::Exceptions::ErrorFactoryWidget:
- errorStatus = WRT_INSTALLER_ERROR_FACTORY_WIDGET;
- break;
-
case Jobs::WidgetInstall::Exceptions::ErrorAreadyUninstalling:
errorStatus = WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING;
break;
- case Jobs::WidgetInstall::Exceptions::ErrorOutOfDiskSpace:
- errorStatus = WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE;
- break;
-
case Jobs::WidgetInstall::Exceptions::ErrorInvalidPackage:
errorStatus = WRT_INSTALLER_ERROR_INVALID_CERTIFICATE;
break;
- case Jobs::WidgetInstall::Exceptions::ErrorAlreadyInstalled:
- errorStatus = WRT_INSTALLER_ERROR_ALREADY_INSTALLED;
- break;
-
case Jobs::WidgetInstall::Exceptions::ErrorInternal:
errorStatus = WRT_INSTALLER_ERROR_INTERNAL;
break;
errorStatus = WRT_INSTALLER_ERROR_DATABASE_FAILURE;
break;
+ case Jobs::WidgetInstall::Exceptions::ErrorInstallOspServcie:
+ errorStatus = WRT_INSTALLER_ERROR_OSPSVC;
+ break;
+
case Jobs::WidgetInstall::Exceptions::ErrorUnknown:
errorStatus = WRT_INSTALLER_ERROR_UNKNOWN;
break;
}
// Callback
- apiStr->status_callback(widget_handle, errorStatus, apiStr->userdata);
+ apiStr->status_callback(tizenId, errorStatus, apiStr->userdata);
} else {
LogInfo("installFinishedCallback: No callback");
}
// callback for finished install
void uninstallFinishedCallback(void *userParam,
- WidgetHandle widget_handle,
- Jobs::WidgetUninstall::Exceptions::Type status)
+ std::string tizenId,
+ Jobs::WidgetUninstall::Exceptions::Type status)
{
Assert(userParam != NULL);
errorStatus = WRT_SUCCESS;
break;
- // case Jobs::WidgetInstall::Exceptions::ErrorAreadyUninstalling:
- // errorStatus = WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING;
- // break;
+ case Jobs::WidgetUninstall::Exceptions::ErrorAlreadyUninstalling:
+ errorStatus = WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING;
+ break;
+
+ case Jobs::WidgetUninstall::Exceptions::ErrorWidgetDoesNotExist:
+ errorStatus = WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST;
+ break;
case Jobs::WidgetUninstall::Exceptions::ErrorDatabaseFailure:
errorStatus = WRT_INSTALLER_ERROR_DATABASE_FAILURE;
break;
+ case Jobs::WidgetUninstall::Exceptions::ErrorUninstallOspSvcFailed:
+ errorStatus = WRT_INSTALLER_ERROR_OSPSVC;
+ break;
+
case Jobs::WidgetUninstall::Exceptions::ErrorUnknown:
errorStatus = WRT_INSTALLER_ERROR_UNKNOWN;
break;
}
// Callback
- apiStr->status_callback(widget_handle, errorStatus, apiStr->userdata);
+ apiStr->status_callback(tizenId, errorStatus, apiStr->userdata);
} else {
LogInfo("uninstallFinishedCallback: No callback");
}
}
void pluginInstallFinishedCallback(void *userParam,
- Jobs::PluginInstall::Exceptions::Type status)
+ Jobs::PluginInstall::Exceptions::Type status)
{
Assert(userParam);
// callback for progress of install OR uninstall
void installProgressCallback(void *userParam,
- ProgressPercent percent,
- const ProgressDescription &description)
+ ProgressPercent percent,
+ const ProgressDescription &description)
{
Assert(userParam != NULL);
LogInfo("installProgressCallback: ignoring NULL callback pointer");
}
}
-
} //namespace