return -1;
}
+static int __convert_aul_error(int res)
+{
+ int ret;
+
+ switch (res) {
+ case AUL_R_EREJECTED:
+ case AUL_R_ENOAPP:
+ ret = WIDGET_ERROR_NOT_EXIST;
+ break;
+ case AUL_R_EILLACC:
+ ret = WIDGET_ERROR_PERMISSION_DENIED;
+ break;
+ case AUL_R_ETIMEOUT:
+ ret = WIDGET_ERROR_TIMED_OUT;
+ break;
+ case AUL_R_ECANCELED:
+ ret = WIDGET_ERROR_CANCELED;
+ break;
+ case AUL_R_EINVAL:
+ ret = WIDGET_ERROR_INVALID_PARAMETER;
+ break;
+ default:
+ ret = WIDGET_ERROR_FAULT;
+ break;
+ }
+
+ return ret;
+}
+
static int __launch(const char *widget_id, const char *instance_id, bundle *extra)
{
int ret = 0;
aul_svc_set_operation(b, AUL_SVC_OPERATION_LAUNCH_WIDGET);
ret = aul_launch_app_async(appid, b);
+ if (ret < 0)
+ ret = __convert_aul_error(ret);
if (!extra) {
bundle_free(b);