Handle widget abnormal exit 11/131811/2 accepted/tizen/3.0/common/20170602.150632 accepted/tizen/3.0/ivi/20170601.235925 accepted/tizen/3.0/mobile/20170601.235857 accepted/tizen/3.0/tv/20170601.235906 accepted/tizen/3.0/wearable/20170601.235916 submit/tizen_3.0/20170601.004300
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 30 May 2017 11:13:37 +0000 (20:13 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Wed, 31 May 2017 04:26:37 +0000 (04:26 +0000)
While getting AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD event with
AUL_K_WIDGET_FAULT data, the __fault_handler will be invoked.

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/131695/ [widget-viewer]

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

index 4772d2a..d9b169f 100644 (file)
@@ -686,6 +686,7 @@ static int __status_handler(const char *endpoint, aul_app_com_result_e e, bundle
        char *widget_id = NULL;
        char *instance_id = NULL;
        char *sender_pkgid = NULL;
+       char *is_faulted = NULL;
        int *status;
        size_t status_sz = 0;
        struct lifecycle_local_s *cb_info;
@@ -697,6 +698,7 @@ static int __status_handler(const char *endpoint, aul_app_com_result_e e, bundle
        bundle_get_byte(envelope, AUL_K_WIDGET_STATUS, (void **)&status, &status_sz);
        bundle_get_str(envelope, AUL_K_COM_SENDER_PID, &sender_pid_str);
        bundle_get_str(envelope, AUL_K_PKGID, &sender_pkgid);
+       bundle_get_str(envelope, AUL_K_WIDGET_FAULT, &is_faulted);
 
        if (widget_id == NULL || status == NULL) {
                _E("undefined class or instance %s of %s", instance_id, widget_id);
@@ -716,7 +718,8 @@ static int __status_handler(const char *endpoint, aul_app_com_result_e e, bundle
                }
        }
 
-       if (*status == AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD) {
+       if (*status == AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD &&
+                       is_faulted && !strcmp(is_faulted, "true")) {
                _D("handle dead widget instances");
                __fault_handler(sender_pid);
        }