diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2017-07-24 15:55:10 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2017-07-25 09:22:18 +0900 |
commit | 5f5f28850939dff8a37a01730c5e8b4194fa4745 (patch) | |
tree | 4b62c62da5c58e58f2614fe404b31c5e11c5fb19 | |
parent | f7a1e2d314e1d31104d0f51a6bb92656464cf805 (diff) | |
download | widget-service-5f5f28850939dff8a37a01730c5e8b4194fa4745.tar.gz widget-service-5f5f28850939dff8a37a01730c5e8b4194fa4745.tar.bz2 widget-service-5f5f28850939dff8a37a01730c5e8b4194fa4745.zip |
Add a function to convert aul errorsubmit/tizen_3.0/20170726.030918submit/tizen_3.0/20170725.224529accepted/tizen/3.0/wearable/20170728.004822accepted/tizen/3.0/tv/20170728.004805accepted/tizen/3.0/mobile/20170728.004750accepted/tizen/3.0/ivi/20170728.004835accepted/tizen/3.0/common/20170728.153310
Change-Id: Id6a1ef0fa86525113e1cf24c4d689196f6d38357
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/widget_instance.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/widget_instance.c b/src/widget_instance.c index 4b321ef..e6a2c4f 100644 --- a/src/widget_instance.c +++ b/src/widget_instance.c @@ -309,6 +309,35 @@ EAPI int widget_instance_create(const char *widget_id, char **instance_id) 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; @@ -336,6 +365,8 @@ static int __launch(const char *widget_id, const char *instance_id, bundle *extr 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); |