#include <aul_app_com.h>
#include <Ecore_Wl2.h>
#include <system_info.h>
-#include <vconf.h>
-#include <vconf-internal-keys.h>
#include <screen_connector_provider.h>
#include <appcore_multiwindow_base.h>
return feature;
}
-/* LCOV_EXCL_START */
-static void __on_poweroff(keynode_t *key, void *data)
-{
- int val;
-
- val = vconf_keynode_get_int(key);
- switch (val) {
- case VCONFKEY_SYSMAN_POWER_OFF_DIRECT:
- case VCONFKEY_SYSMAN_POWER_OFF_RESTART:
- LOGI("power off changed: %d", val);
- widget_base_exit();
- break;
- case VCONFKEY_SYSMAN_POWER_OFF_NONE:
- case VCONFKEY_SYSMAN_POWER_OFF_POPUP:
- default:
- /* DO NOTHING */
- break;
- }
-}
-/* LCOV_EXCL_STOP */
-
static void __check_empty_instance(void)
{
int cnt = appcore_multiwindow_base_instance_get_cnt();
/* call stub create */
appcore_multiwindow_base_instance_run(class_id, id, data);
- data->args = NULL;
- bundle_get_str(b, WIDGET_K_CONTENT_INFO, &content);
- if (content)
- data->content = strdup(content);
-
+ if (appcore_multiwindow_base_instance_find(id)) {
+ data->args = NULL;
+ bundle_get_str(b, WIDGET_K_CONTENT_INFO, &content);
+ if (content)
+ data->content = strdup(content);
+ }
}
static void __control_resume(const char *class_id, const char *id, bundle *b)
free(data->id);
free(data);
__check_empty_instance();
+ aul_widget_write_log(LOG_TAG,
+ "[%s:%d] instance_id(%s)", __FUNCTION__, __LINE__, id);
}
static void __control_change_period(const char *class_id, const char *id,
}
screen_connector_provider_init();
- vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS,
- __on_poweroff, NULL);
-
-
if (__context.ops.create)
ret = __context.ops.create(data);
{
if (__context.ops.terminate)
__context.ops.terminate(data);
-
- vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS,
- __on_poweroff);
screen_connector_provider_fini();
if (__viewer_endpoint) {
return 0;
}
+ LOGI("app control operation(%s)", operation);
if (strcmp(operation, "create") == 0)
__control_create(class_id, id, b);
else if (strcmp(operation, "resize") == 0)
EXPORT_API int widget_base_exit(void)
{
- int ret;
+ int ret = 0;
+ int cnt;
appcore_multiwindow_base_exit();
- if (appcore_multiwindow_base_instance_get_cnt() == 0 && __is_permanent) {
+ cnt = appcore_multiwindow_base_instance_get_cnt();
+ if (cnt == 0 && __is_permanent)
ret = aul_notify_exit();
- aul_widget_write_log(LOG_TAG, "[%s:%d] permanent exit : %d",
- __FUNCTION__, __LINE__, ret);
- }
+
+ aul_widget_write_log(LOG_TAG,
+ "[%s:%d] exit : ret(%d), cnt(%d), permanent(%d)",
+ __FUNCTION__, __LINE__, ret, cnt, __is_permanent);
return 0;
}
__instance_drop(instance_h);
} else {
LOGD("%s is created", id);
+ aul_widget_instance_add(class_id, id);
ret = __send_update_status(class_id, id,
WIDGET_INSTANCE_EVENT_CREATE, 0, NULL);
if (ret < 0)
LOGE("Fail to send create status (%d) ", ret);
- aul_widget_instance_add(class_id, id);
-
ret = bundle_get_byte(b, WIDGET_K_PERIOD, (void **)&period,
&size);
if (ret == BUNDLE_ERROR_NONE && *period > 0) {
}
if (!class_id) {
- LOGE("class is is NULL");
+ LOGE("class id is NULL");
set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}