Send error code for WIDGET_INSTANCE_EVENT_CREATE_ABORTED 28/149328/6
authorJunghoon Park <jh9216.park@samsung.com>
Tue, 12 Sep 2017 05:50:32 +0000 (14:50 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Tue, 12 Sep 2017 08:51:41 +0000 (08:51 +0000)
- Require:
  https://review.tizen.org/gerrit/#/c/149326/

Change-Id: Ied624c2c811f40cb5f33614e8256c24d4d978401
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
widget_viewer_evas/src/widget_viewer_evas.c

index f09903a504105ff9515c2049cadd07a1e0850783..d32ce19be049ed270b583fdd8b1998e9e7dcddd2 100644 (file)
@@ -609,6 +609,7 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
        const char *smart_signal = NULL;
        char *content_info;
        widget_instance_h handle;
+       int err;
 
        DbgPrint("widget_id : %s (%d)", widget_id, event);
        if (event == WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST) {
@@ -687,7 +688,20 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
                __display_overlay_text(info);
                break;
        case WIDGET_INSTANCE_EVENT_CREATE_ABORTED:
-               event_info.error = WIDGET_ERROR_CANCELED;
+               handle = widget_instance_get_instance(info->widget_id,
+                               info->instance_id);
+               if (!handle) {
+                       ErrPrint("instance handle of widget(%s) is invalid data",
+                                       info->instance_id);
+                       break;
+               }
+
+               widget_instance_get_error_code(handle, &err);
+               widget_instance_unref(handle);
+               if (err == 0)
+                       err = WIDGET_ERROR_CANCELED;
+
+               event_info.error = err;
                event_info.event = WIDGET_EVENT_CREATED;
                smart_signal = WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED;
                info->pid = -1;