static char *appid;
static widget_class_h class_provider;
static int exit_called;
+static char *package_id;
static void _widget_core_set_appcore_event_cb(void);
static void _widget_core_unset_appcore_event_cb(void);
int status)
{
bundle *b = bundle_create();
+ char pkgid[256] = {0, };
int ret;
if (b == NULL) {
return -1; /* LCOV_EXCL_LINE */
}
+ if (package_id == NULL) {
+ ret = aul_app_get_pkgid_bypid(getpid(), pkgid, sizeof(pkgid));
+ if (ret == 0)
+ package_id = strdup(pkgid);
+ }
+
bundle_add_str(b, AUL_K_WIDGET_ID, class_id);
bundle_add_str(b, AUL_K_WIDGET_INSTANCE_ID, instance_id);
bundle_add_byte(b, AUL_K_WIDGET_STATUS, &status, sizeof(int));
+ if (package_id)
+ bundle_add_str(b, AUL_K_PKGID, package_id);
_D("send lifecycle %s(%d)", instance_id, status);
ret = aul_app_com_send("widget.status", b);
_widget_app_free_viewer_endpoint();
_widget_core_unset_appcore_event_cb();
__free_handler_list();
+
+ if (package_id) {
+ free(package_id);
+ package_id = NULL;
+ }
+
elm_shutdown();
}