From: jongmyeongko Date: Tue, 10 Nov 2015 06:13:02 +0000 (+0900) Subject: merge tizen 2.4 X-Git-Tag: accepted/tizen/4.0/unified/20170816.011601~6^2~99^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfa2e869b69b6ce5214010f082944d22d48587ad;p=platform%2Fcore%2Fapi%2Fapp-control.git merge tizen 2.4 Change-Id: Ib37db83efd77b8281beeee6c7e17702db9ebbc16 Signed-off-by: jongmyeongko --- diff --git a/event/event.c b/event/event.c index 8317d20..8ce5fe4 100644 --- a/event/event.c +++ b/event/event.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #ifdef LOG_TAG @@ -142,50 +141,6 @@ static void event_eventsystem_callback(const char *event_name, } } -static void event_remove_handler_list(gpointer data, gpointer user_data) -{ - int ret = 0; - - event_handler_h handler = (event_handler_h)data; - - if (handler) { - ret = eventsystem_unregister_application_event(handler->reg_id); - if (ret < 0) { - LOGE("unregister event error"); - return; - } - free(handler->event_name); - free(handler); - } -} - -static void event_finalize(void *data) -{ - GHashTableIter iter; - gpointer key, value; - - LOGD("event finalizer"); - - if (interested_event_table) { - g_hash_table_iter_init(&iter, interested_event_table); - - while (g_hash_table_iter_next(&iter, &key, &value)) { - GList *handler_list = (GList *)value; - if (handler_list) { - g_list_foreach(handler_list, event_remove_handler_list, NULL); - g_list_free(handler_list); - } else { - LOGE("handler list is NULL"); - } - } - - g_hash_table_unref(interested_event_table); - interested_event_table = NULL; - } - - eventsystem_application_finalize(); -} - int event_add_event_handler(const char *event_name, event_cb callback, void *user_data, event_handler_h *event_handler) { @@ -202,11 +157,6 @@ int event_add_event_handler(const char *event_name, event_cb callback, void *use __FUNCTION__, NULL); } } - ret = app_finalizer_add(event_finalize, NULL); - if (ret != APP_ERROR_NONE) { - return event_error(EVENT_ERROR_OUT_OF_MEMORY, __FUNCTION__, - "add finalizer error"); - } _initialized = 1; } diff --git a/include/app_event.h b/include/app_event.h index 61b0588..706b506 100644 --- a/include/app_event.h +++ b/include/app_event.h @@ -79,29 +79,39 @@ typedef enum * @see EVENT_VAL_BATTERY_CHARGER_DISCONNECTED * @see EVENT_VAL_BATTERY_CHARGER_CONNECTED * @see EVENT_VAL_BATTERY_CHARGER_CHARGING + * @see EVENT_VAL_BATTERY_CHARGER_DISCHARGING */ #define EVENT_KEY_BATTERY_CHARGER_STATUS "battery_charger_status" /** * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. * @since_tizen 2.4 + * @remarks charger disconnected */ #define EVENT_VAL_BATTERY_CHARGER_DISCONNECTED "disconnected" /** * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. * @since_tizen 2.4 - * @remarks Connected but not-available. + * @remarks charger connected */ #define EVENT_VAL_BATTERY_CHARGER_CONNECTED "connected" /** * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. * @since_tizen 2.4 + * @remarks charging is enabled */ #define EVENT_VAL_BATTERY_CHARGER_CHARGING "charging" /** + * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. + * @since_tizen 2.4 + * @remarks charging is disabled + */ +#define EVENT_VAL_BATTERY_CHARGER_DISCHARGING "discharging" + +/** * @brief Definition for system-event of battery : level status. * @since_tizen 2.4 * @see EVENT_KEY_BATTERY_LEVEL_STATUS @@ -778,6 +788,8 @@ typedef enum * @retval #EVENT_ERROR_NONE Successful * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #EVENT_ERROR_PERMISSION_DENIED Permission denied + * @retval #EVENT_ERROR_IO_ERROR Adding handler failed + * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory */ int event_add_event_handler(const char *event_name, event_cb callback, void *user_data, event_handler_h *event_handler);