Fix widget_viewer_evas_is_faulted API 95/131695/4
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 30 May 2017 11:15:36 +0000 (20:15 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Wed, 31 May 2017 03:48:23 +0000 (03:48 +0000)
This patch adds the flag about checking widget is faulted or NOT.
The API uses to return the flag.

Requires:
 - https://review.tizen.org/gerrit/#/c/131674/ [aul-1]
 - https://review.tizen.org/gerrit/#/c/131676/ [appcore-widget]
 - https://review.tizen.org/gerrit/#/c/131685/ [amd]
 - https://review.tizen.org/gerrit/#/c/131692/ [widget-service]

Change-Id: Ie642496783d387beff09a2fa24302a9434adbd51
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
widget_viewer_evas/src/widget_viewer_evas.c

index 54b34d0..7ae29a1 100644 (file)
@@ -179,6 +179,7 @@ struct widget_info {
        Evas_Object *layout;
        bool is_created;
        GQueue *pending_queue;
+       bool is_faulted;
 };
 
 static void __flush_event_queue(struct widget_info *info);
@@ -616,11 +617,13 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
                smart_signal = WIDGET_SMART_SIGNAL_WIDGET_FAULTED;
                info->pid = -1;
                info->state = WIDGET_STATE_DETACHED;
+               info->is_faulted = true;
                __display_overlay_text(info);
                break;
        case WIDGET_INSTANCE_EVENT_CREATE_ABORTED:
                event_info.event = WIDGET_EVENT_CREATED;
                smart_signal = WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED;
+               info->is_faulted = true;
                __display_overlay_text(info);
                break;
        default:
@@ -1600,6 +1603,7 @@ EAPI void widget_viewer_evas_activate_faulted_widget(Evas_Object *widget)
                ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
                ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
                screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
+               info->is_faulted = false;
                info->pid = widget_instance_launch(info->instance_id, info->content_info, w, h);
                if (info->pid < 0) {
                        ErrPrint("Failed to launch an widget");
@@ -1648,7 +1652,7 @@ EAPI bool widget_viewer_evas_is_faulted(Evas_Object *widget)
                return false;
        }
 
-       return info->pid < 0 ? true : false;
+       return info->is_faulted;
 }
 
 EAPI int widget_viewer_evas_freeze_visibility(Evas_Object *widget, widget_visibility_status_e status)