Add managed idler & Fix build warrings(tizen_2.1)
authorsunil85.kim <sunil85.kim@samsung.com>
Tue, 26 Mar 2013 08:08:59 +0000 (17:08 +0900)
committersunil85.kim <sunil85.kim@samsung.com>
Tue, 26 Mar 2013 08:08:59 +0000 (17:08 +0900)
18 files changed:
CMakeLists.txt
debian/changelog
packaging/wifi-efl-ug.spec
sources/libraries/Common/common_eap_connect.c
sources/libraries/Common/common_ip_info.c
sources/libraries/Common/common_utils.c
sources/libraries/Common/include/common_utils.h
sources/libraries/WlanManager/EngineManager/connman-response.c
sources/libraries/WlanManager/WlanManager/wlan_connection.c
sources/libraries/WlanManager/WlanManager/wlan_manager.c
sources/ui-gadget/viewers-layout/view_detail.c
sources/ui-gadget/viewers-layout/viewer_manager.c
sources/ui-gadget/wifi-efl-UG.c
sources/wifi-syspopup/include/wifi-syspopup.h
sources/wifi-syspopup/viewer-popups/include/view-main.h
sources/wifi-syspopup/viewer-popups/view-main.c
sources/wifi-syspopup/wifi-syspopup-engine-callback.c
sources/wifi-syspopup/wifi-syspopup.c

index a4cfc0b..b870604 100644 (file)
@@ -13,6 +13,8 @@ SET(ENGINE_PKGCONFIGS
        capi-network-wifi
        network)
 
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations")
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        ecore
index 5e1539c..aab79ec 100644 (file)
@@ -1,3 +1,11 @@
+wifi-efl-ug (0.5.2-6) precise; urgency=low
+
+  * Add managed idler & Fix build warnings
+  * Git: magnolia/apps/home/ug-wifi-efl
+  * Tag: wifi-efl-ug_0.5.2-5
+
+ -- sunil85.kim <isurit@sunil85.kim>  Tue, 26 Mar 2013 12:22:31 +0900
+
 wifi-efl-ug (0.5.2-5) precise; urgency=low
 
   * Apply new UX for editfield widget
index 1558361..4d1e312 100644 (file)
@@ -1,6 +1,6 @@
 Name:       wifi-efl-ug
 Summary:    Wi-Fi UI Gadget
-Version:    0.5.2_5
+Version:    0.5.2_6
 Release:    1
 Group:      App/Network
 License:    Flora License
index c12f4ef..d79b8f3 100644 (file)
@@ -453,7 +453,7 @@ static void _gl_eap_entry_unfocused_cb(void *data, Evas_Object *obj, void *event
        elm_object_item_signal_emit(entry_info->item, "elm,state,rename,show", "");
 }
 
-static void _gl_eap_entry_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+static void _gl_eap_entry_eraser_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
        common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)data;
        if (!entry_info)
@@ -597,7 +597,7 @@ static void _gl_exp(void *data, Evas_Object *obj, void *event_info)
        common_utils_edit_box_focus_set(eap_data->eap_pw_item, EINA_FALSE);
        ip_info_close_all_keypads(eap_data->ip_info_list);
 
-       int i = 0;
+       unsigned int i = 0;
        eap_type_t eap_type;
        eap_auth_t auth_type;
        INFO_LOG(UG_NAME_RESP, "depth = %d", eap_data->expandable_list_index);
@@ -1073,29 +1073,29 @@ static void __common_eap_connect_done_cb(void *data,  Evas_Object *obj,
        __COMMON_FUNC_EXIT__;
 }
 
-static Eina_Bool __common_eap_connect_show_ime(void *data)
+static gboolean __common_eap_connect_show_ime(void *data)
 {
        Elm_Object_Item *list_entry_item = (Elm_Object_Item *)data;
        if (!list_entry_item)
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
 
        Evas_Object *entry = elm_object_item_part_content_get(list_entry_item, "elm.icon.entry");
        if (!entry)
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
 
        g_eap_id_show_keypad = TRUE;
        elm_genlist_item_update(list_entry_item);
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
-static Eina_Bool __common_eap_connect_load_ip_info_list_cb(void *data)
+static gboolean __common_eap_connect_load_ip_info_list_cb(void *data)
 {
        eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
        Elm_Object_Item *navi_it = NULL;
        Evas_Object *list = NULL;
 
        if (!eap_data)
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
 
        if (eap_data->navi_frame) {
                Evas_Object *layout = NULL;
@@ -1113,9 +1113,9 @@ static Eina_Bool __common_eap_connect_load_ip_info_list_cb(void *data)
        /* Add a separator */
        common_utils_add_dialogue_separator(list, "dialogue/separator");
 
-       ecore_idler_add(__common_eap_connect_show_ime, eap_data->eap_id_item);
+       common_util_managed_idle_add(__common_eap_connect_show_ime, eap_data->eap_id_item);
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 eap_connect_data_t *create_eap_view(Evas_Object *win_main,
@@ -1183,7 +1183,7 @@ eap_connect_data_t *create_eap_view(Evas_Object *win_main,
                        connect_btn);
 
        /* Append ip info items and add a seperator */
-       ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
+       common_util_managed_idle_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
 
        /* Title Connect button */
        connect_btn = elm_button_add(navi_frame);
@@ -1271,7 +1271,7 @@ eap_connect_data_t *create_eap_popup(Evas_Object *win_main,
        list = _create_list(box, eap_data);
 
        /* Append ip info items and add a seperator */
-       ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
+       common_util_managed_idle_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
 
        /* Pack the list into the box */
        elm_box_pack_end(box, list);
index 3ba29f5..9f95719 100644 (file)
@@ -490,17 +490,17 @@ static void _delete_static_ip_table(ip_info_list_t *ip_info_list_data)
        __COMMON_FUNC_EXIT__;
 }
 
-static Eina_Bool __genlist_item_disable_later(void *data)
+static gboolean __genlist_item_disable_later(void *data)
 {
        elm_genlist_item_selected_set((Elm_Object_Item *)data, FALSE);
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 static void _gl_deselect_callback(void* data,
                Evas_Object* obj, void* event_info)
 {
-       ecore_idler_add(__genlist_item_disable_later, event_info);
+       common_util_managed_idle_add(__genlist_item_disable_later, event_info);
 }
 
 static char* _ip_info_iptoggle_text_get(void *data, Evas_Object *obj,
@@ -634,7 +634,7 @@ static void __ip_info_toggle_item_sel_cb(void* data,
        elm_genlist_item_update(ip_info_list_data->ip_toggle_item);
        elm_object_item_disabled_set(ip_info_list_data->ip_toggle_item, FALSE);
 
-       ecore_idler_add(__genlist_item_disable_later, event_info);
+       common_util_managed_idle_add(__genlist_item_disable_later, event_info);
 
        __COMMON_FUNC_EXIT__;
 }
index d3cb405..d19e2c6 100644 (file)
@@ -19,8 +19,8 @@
 
 #include <vconf.h>
 #include <syspopup_caller.h>
-
 #include <aul.h>
+
 #include "common.h"
 #include "common_utils.h"
 #include "i18nmanager.h"
@@ -33,6 +33,8 @@ typedef struct {
        char *info_str;
 } two_line_disp_data_t;
 
+static GSList *managed_idler_list = NULL;
+
 static char *__common_utils_2line_text_get(void *data, Evas_Object *obj, const char *part)
 {
        two_line_disp_data_t *item_data = (two_line_disp_data_t *)data;
@@ -453,6 +455,7 @@ int common_utils_send_message_to_net_popup(const char *title, const char *conten
        bundle_add(b, "_AP_NAME_", ssid);
 
        ret = aul_launch_app("net.netpopup", b);
+
        bundle_free(b);
 
        return ret;
@@ -489,3 +492,79 @@ int common_util_get_system_registry(const char *key)
        __COMMON_FUNC_EXIT__;
        return value;
 }
+
+struct managed_idle_data {
+       GSourceFunc func;
+       gpointer user_data;
+       guint id;
+};
+
+static void __managed_idle_destroy_cb(gpointer data)
+{
+       if (!data)
+               return;
+
+       managed_idler_list = g_slist_remove(managed_idler_list, data);
+}
+
+static gboolean __managed_idle_hook_cb(gpointer user_data)
+{
+       struct managed_idle_data *data = user_data;
+
+       if (!data)
+               return FALSE;
+
+       return data->func(data->user_data);
+}
+
+guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data)
+{
+       guint id;
+       struct managed_idle_data *data;
+
+       if (!func)
+               return 0;
+
+       data = g_new0(struct managed_idle_data, 1);
+       if (!data)
+               return 0;
+
+       data->func = func;
+       data->user_data = user_data;
+
+       id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, __managed_idle_hook_cb, data,
+                       __managed_idle_destroy_cb);
+       if (!id) {
+               g_free(data);
+               return id;
+       }
+
+       data->id = id;
+
+       managed_idler_list = g_slist_append(managed_idler_list, data);
+
+       return id;
+}
+
+void common_util_managed_idle_cleanup(void)
+{
+       GSList *cur = managed_idler_list;
+       GSource *src;
+       struct managed_idle_data *data;
+
+       for (;cur; cur = cur->next) {
+               data = cur->data;
+
+               src = g_main_context_find_source_by_id(g_main_context_default(),
+                               data->id);
+               if (src) {
+                       g_source_destroy(src);
+               }
+
+               g_free(data);
+       }
+
+       g_slist_free (managed_idler_list);
+       managed_idler_list = NULL;
+
+}
index 7ef6e2b..a9fd038 100644 (file)
@@ -26,6 +26,11 @@ extern "C"
 #endif
 
 #include <Elementary.h>
+
+/* Fix build warning (redefine '_()' in appcore-common.h) */
+#ifdef _
+#undef _
+#endif
 #include <appcore-common.h>
 
 #include "wlan_manager.h"
@@ -105,6 +110,9 @@ int common_utils_send_message_to_net_popup(const char *title,
 int common_util_set_system_registry(const char *key, int value);
 int common_util_get_system_registry(const char *key);
 
+guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data);
+void common_util_managed_idle_cleanup(void);
+
 #ifdef __cplusplus
 }
 #endif
index 5bf69f6..04eca74 100644 (file)
@@ -25,7 +25,7 @@ struct _wifi_cb_s {
        void *specific_scan_user_data;
 };
 
-static struct _wifi_cb_s wifi_callbacks = {0,};
+static struct _wifi_cb_s wifi_callbacks = {NULL, NULL};
 
 int wifi_set_specific_scan_cb(wifi_specific_scan_finished_cb cb, void *data)
 {
index 4202d15..70df820 100644 (file)
@@ -26,8 +26,8 @@ struct wlan_connection {
        void *user_data;
 };
 
-static struct wlan_connection current_item = { NULL, };
-static struct wlan_connection next_item = { NULL, };
+static struct wlan_connection current_item = { NULL, NULL, NULL };
+static struct wlan_connection next_item = { NULL, NULL, NULL };
 
 static void wlan_connect_debug(wifi_ap_h ap)
 {
index 41c4499..be4f624 100644 (file)
@@ -728,14 +728,14 @@ wifi_device_info_t* wlan_manager_profile_device_info_blank_create()
        return di_s0;
 }
 
-static Eina_Bool _refresh_ui(void *data)
+static gboolean _refresh_ui(void *data)
 {
        manager_object->refresh_func();
 
        manager_object->b_scan_blocked = FALSE;
        manager_object->b_ui_refresh = FALSE;
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 void wlan_manager_enable_scan_result_update(void)
@@ -747,7 +747,7 @@ void wlan_manager_enable_scan_result_update(void)
                        DEBUG_LOG(COMMON_NAME_LIB, "Refresh the UI with last scan update");
 
                        /* Delayed rendering in order to get smooth effect of popup close */
-                       ecore_idler_add(_refresh_ui, NULL);
+                       common_util_managed_idle_add(_refresh_ui, NULL);
                } else
                        manager_object->b_scan_blocked = FALSE;
        }
index f38fcd5..9eec078 100644 (file)
@@ -151,7 +151,7 @@ static void ok_cb(void *data, Evas_Object *obj, void *event_info)
 
        elm_naviframe_item_pop(viewer_manager_get_naviframe());
 
-       g_idle_add(__forget_wifi_ap, (gpointer)ap);
+       common_util_managed_idle_add(__forget_wifi_ap, (gpointer)ap);
 
        __COMMON_FUNC_EXIT__;
 }
@@ -249,7 +249,7 @@ static void __view_detail_imf_ctxt_evnt_cb(void *data, Ecore_IMF_Context *ctx, i
        return;
 }
 
-static Eina_Bool __view_detail_load_ip_info_list_cb(void *data)
+static gboolean __view_detail_load_ip_info_list_cb(void *data)
 {
        Elm_Object_Item *navi_it = NULL;
        Evas_Object *list = NULL;
@@ -257,7 +257,7 @@ static Eina_Bool __view_detail_load_ip_info_list_cb(void *data)
        view_detail_data *_detail_data = (view_detail_data *)data;
 
        if (!_detail_data)
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
 
        navi_it = elm_naviframe_top_item_get(viewer_manager_get_naviframe());
        layout = elm_object_item_part_content_get(navi_it, "elm.swallow.content");
@@ -270,7 +270,7 @@ static Eina_Bool __view_detail_load_ip_info_list_cb(void *data)
 
        common_utils_add_dialogue_separator(list, "dialogue/separator");
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main)
@@ -365,7 +365,7 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main)
        }
 
        /* Append the ip info details */
-       ecore_idler_add(__view_detail_load_ip_info_list_cb, _detail_data);
+       common_util_managed_idle_add(__view_detail_load_ip_info_list_cb, _detail_data);
 
        __COMMON_FUNC_EXIT__;
 }
index d7a3bad..1c8c69a 100644 (file)
@@ -178,7 +178,7 @@ static void _hide_finished_cb(void *data, Evas_Object *obj, void *event_info)
        __COMMON_FUNC_EXIT__;
 }
 
-void _lbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
+static void _lbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
 {
        __COMMON_FUNC_ENTER__;
 
@@ -200,7 +200,7 @@ void _lbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
        __COMMON_FUNC_EXIT__;
 }
 
-void _rbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
+static void _rbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
 {
        __COMMON_FUNC_ENTER__;
 
@@ -222,7 +222,7 @@ void _rbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
        __COMMON_FUNC_EXIT__;
 }
 
-void _back_sk_cb(void *data, Evas_Object *obj, void *event_info)
+static void _back_sk_cb(void *data, Evas_Object *obj, void *event_info)
 {
        __COMMON_FUNC_ENTER__;
 
@@ -619,8 +619,8 @@ static Eina_Bool viewer_manager_scan_button_set(Eina_Bool show_state)
        /* TODO: need to check VIEW_MANAGER_VIEW_TYPE_MAIN ?
         * Evas_Object* navi_frame = viewer_manager_get_naviframe();
         * view_manager_view_type_t top_view_id =
-        *                      (view_manager_view_type_t)evas_object_data_get(navi_frame,
-        *                                                                                      SCREEN_TYPE_ID_KEY);
+        *                      (view_manager_view_type_t)evas_object_data_get(navi_frame,
+        *                                                                                      SCREEN_TYPE_ID_KEY);
         */
 
        if (show_state == EINA_TRUE)
@@ -819,6 +819,8 @@ Eina_Bool viewer_manager_hide(VIEWER_WINSETS winset)
        return EINA_TRUE;
 }
 
+#if 0
+/* Unused function */
 Eina_Bool viewer_manager_genlist_item_update(Elm_Object_Item* item)
 {
        __COMMON_FUNC_ENTER__;
@@ -826,12 +828,13 @@ Eina_Bool viewer_manager_genlist_item_update(Elm_Object_Item* item)
                __COMMON_FUNC_EXIT__;
                return EINA_FALSE;
        }
-       
+
        elm_genlist_item_update(item);
 
        __COMMON_FUNC_EXIT__;
        return EINA_FALSE;
 }
+#endif
 
 void viewer_manager_update_hidden_btn(void)
 {
index 6af8dab..563bc95 100644 (file)
@@ -45,12 +45,16 @@ struct ug_data {
        ui_gadget_h ug;
 };
 
-static Eina_Bool __wifi_efl_ug_del_found_ap_noti(void *data)
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops);
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops);
+UG_MODULE_API int setting_plugin_reset(bundle *data, void *priv);
+
+static gboolean __wifi_efl_ug_del_found_ap_noti(void *data)
 {
        common_utils_send_message_to_net_popup(NULL, NULL,
                                                                                "del_found_ap_noti", NULL);
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 static void __make_scan_if_bss_expired(void)
@@ -165,7 +169,7 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode,
                                                                VCONFKEY_WIFI_UG_RUN_STATE_ON_FOREGROUND);
 
        /* Remove the "WiFi networks found" from the notification tray.*/
-       ecore_idler_add(__wifi_efl_ug_del_found_ap_noti, NULL);
+       common_util_managed_idle_add(__wifi_efl_ug_del_found_ap_noti, NULL);
 
        memset(&g_pending_call, 0, sizeof(wifi_pending_call_info_t));
 
@@ -245,7 +249,7 @@ static void on_start(ui_gadget_h ug, service_h service, void *priv)
 {
        __COMMON_FUNC_ENTER__;
 
-       g_idle_add(load_initial_ap_list, NULL);
+       common_util_managed_idle_add(load_initial_ap_list, NULL);
 
        connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
 
@@ -328,6 +332,8 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
                ugd->base = NULL;
        }
 
+       common_util_managed_idle_cleanup();
+
        __COMMON_FUNC_EXIT__;
 }
 
index 350ca30..9caecc2 100644 (file)
@@ -88,7 +88,6 @@ typedef struct {
        gboolean highlighted;
 } syspopup_genlist_data_t;
 
-int wifi_syspopup_create(void);
 int wifi_syspopup_destroy(void);
 
 #ifdef __cplusplus
index 5e25385..79a1f82 100644 (file)
@@ -35,7 +35,7 @@ extern "C"
 Evas_Object *view_main_create(Evas_Object* parent);
 int view_main_destroy(void);
 void view_main_item_state_set(wifi_ap_h ap, ITEM_CONNECTION_MODES state);
-Eina_Bool view_main_show(void *data);
+gboolean view_main_show(void *data);
 
 #ifdef __cplusplus
 }
index f4b2149..652c093 100644 (file)
@@ -201,6 +201,8 @@ static void __view_main_wifi_connect(syspopup_genlist_data_t *gdata)
        }
 }
 
+#if 0
+/* Unused function */
 Elm_Object_Item *__view_main_get_item_in_mode(ITEM_CONNECTION_MODES mode)
 {
        Elm_Object_Item* it = NULL;
@@ -219,6 +221,7 @@ Elm_Object_Item *__view_main_get_item_in_mode(ITEM_CONNECTION_MODES mode)
        __COMMON_FUNC_EXIT__;
        return NULL;
 }
+#endif
 
 static void __gl_sel(void *data, Evas_Object *obj, void *event_info)
 {
@@ -521,7 +524,7 @@ static bool view_main_wifi_found_ap_cb(wifi_ap_h ap, void* user_data)
        return true;
 }
 
-Eina_Bool view_main_show(void *data)
+gboolean view_main_show(void *data)
 {
        __COMMON_FUNC_ENTER__;
 
@@ -529,7 +532,7 @@ Eina_Bool view_main_show(void *data)
                ERROR_LOG( SP_NAME_NORMAL, "list is NULL!!" );
 
                __COMMON_FUNC_EXIT__;
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
        }
 
        view_main_scan_ui_clear();
@@ -537,7 +540,7 @@ Eina_Bool view_main_show(void *data)
 
        int state = wlan_manager_state_get();
        if (WLAN_MANAGER_ERROR == state || WLAN_MANAGER_OFF == state) {
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
        }
 
        itc.item_style = "2text.2icon.4";
@@ -555,11 +558,11 @@ Eina_Bool view_main_show(void *data)
                WARN_LOG(SP_NAME_NORMAL, "scan size is ZERO");
 
                __COMMON_FUNC_EXIT__;
-               return ECORE_CALLBACK_CANCEL;
+               return FALSE;
        }
 
        evas_object_show(list);
 
        __COMMON_FUNC_EXIT__;
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
index b6c99b6..8f20898 100644 (file)
@@ -152,7 +152,7 @@ void wlan_engine_refresh_callback(void)
 
        INFO_LOG(SP_NAME_NORMAL, "Wi-Fi QS launch");
 
-       ecore_idler_add(view_main_show, NULL);
+       common_util_managed_idle_add(view_main_show, NULL);
 
        __COMMON_FUNC_EXIT__;
        return;
index 8e5c198..12188f3 100644 (file)
@@ -250,7 +250,7 @@ int wifi_syspopup_destroy(void)
        return 1;
 }
 
-int wifi_syspopup_create(void)
+static int wifi_syspopup_create(void)
 {
        __COMMON_FUNC_ENTER__;
        int rotate_angle;
@@ -302,7 +302,7 @@ int wifi_syspopup_create(void)
        return 1;
 }
 
-int wifi_syspopup_init()
+static int wifi_syspopup_init()
 {
        __COMMON_FUNC_ENTER__;
 
@@ -434,12 +434,12 @@ syspopup_handler handler = {
                .def_timeout_fn = mytimeout
 };
 
-static Eina_Bool __wifi_syspopup_del_found_ap_noti(void *data)
+static gboolean __wifi_syspopup_del_found_ap_noti(void *data)
 {
        common_utils_send_message_to_net_popup(NULL, NULL,
                                                                                "del_found_ap_noti", NULL);
 
-       return ECORE_CALLBACK_CANCEL;
+       return FALSE;
 }
 
 static gboolean load_initial_ap_list(gpointer data)
@@ -465,7 +465,7 @@ static void __pw_lock_state_change_cb(keynode_t *node, void *user_data)
                vconf_ignore_key_changed(VCONFKEY_PWLOCK_STATE, __pw_lock_state_change_cb);
                wifi_syspopup_create();
                ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, (void *)syspopup_app_state);
-               g_idle_add(load_initial_ap_list, NULL);
+               common_util_managed_idle_add(load_initial_ap_list, NULL);
        }
 
        INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);
@@ -488,10 +488,11 @@ static int app_reset(bundle *b, void *data)
        assertm_if(NULL == b, "bundle is NULL!!");
 
        /* Remove the "WiFi networks found" from the notification tray.*/
-       ecore_idler_add(__wifi_syspopup_del_found_ap_noti, NULL);
+       common_util_managed_idle_add(__wifi_syspopup_del_found_ap_noti, NULL);
 
        if (syspopup_has_popup(b)) {
                INFO_LOG(SP_NAME_NORMAL, "Wi-Fi device picker is already launched");
+
                syspopup_reset(b);
        } else {
                win_main = appcore_create_win(PACKAGE);
@@ -546,6 +547,7 @@ static int app_reset(bundle *b, void *data)
                        return 0;
                } else {
                        syspopup_app_state->syspopup_type = WIFI_SYSPOPUP_WITH_AP_LIST;
+
                        int wlan_ret = wifi_syspopup_init();
                        if (WLAN_MANAGER_ERR_NONE != wlan_ret ||
                                                                _power_on_check() == FALSE) {
@@ -588,7 +590,7 @@ static int app_reset(bundle *b, void *data)
 
                                wifi_syspopup_create();
                                ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, (void *)syspopup_app_state);
-                               g_idle_add(load_initial_ap_list, NULL);
+                               common_util_managed_idle_add(load_initial_ap_list, NULL);
                        }
 
                        INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);