[TSAM-9582] Fixed display issue when settings changed
[apps/native/ug-mobile-ap.git] / src / mh_view_wifi_setup.c
index 0be374c..c567b56 100755 (executable)
@@ -26,6 +26,8 @@ static void __gl_realized(void *data, Evas_Object *obj, void *event_info);
 static void __cancel_btn_cb(void *data, Evas_Object *object, void *event_info);
 static void __save_btn_cb(void *data, Evas_Object *object, void *event_info);
 
+static guint tethering_param_timer = 0;
+
 static void __hide_btn_changed_cb(void *data, Evas_Object *obj, void *event_info)
 {
        __MOBILE_AP_FUNC_ENTER__;
@@ -699,6 +701,8 @@ static void __settings_reloaded_cb(tethering_error_e result, void *user_data)
 
        __MOBILE_AP_FUNC_ENTER__;
 
+       g_source_remove(tethering_param_timer);
+
        mh_appdata_t *ad = (mh_appdata_t *)user_data;
 
        if (result != TETHERING_ERROR_NONE)
@@ -710,6 +714,27 @@ static void __settings_reloaded_cb(tethering_error_e result, void *user_data)
        return;
 }
 
+static gboolean _update_tethering_param(gpointer data)
+{
+       __MOBILE_AP_FUNC_ENTER__;
+       mh_appdata_t *ad = (mh_appdata_t *)data;
+       int ret;
+
+       if (ad == NULL) {
+               ERR("Invalid parameter\n");
+               return FALSE;
+       }
+
+       /* reload wifi settings */
+       ret = tethering_wifi_reload_settings(ad->handle, __settings_reloaded_cb,
+                       (void *)ad);
+       if (ret != TETHERING_ERROR_NONE)
+               ERR("reload_configuration is failed : %d\n", ret);
+
+       __MOBILE_AP_FUNC_EXIT__;
+       return FALSE;
+}
+
 static void __save_btn_cb(void *data, Evas_Object *object, void *event_info)
 {
        DBG("+\n");
@@ -771,11 +796,13 @@ static void __save_btn_cb(void *data, Evas_Object *object, void *event_info)
                if (ad->main.help_item)
                        elm_genlist_item_update(ad->main.help_item);
 
-               /* reload wifi settings */
-               ret = tethering_wifi_reload_settings(ad->handle, __settings_reloaded_cb,
-                               (void *)ad);
-               if (ret != TETHERING_ERROR_NONE)
-                       ERR("reload_configuration is failed : %d\n", ret);
+               /* Here, The Dbus takes some amount of time
+                  to set the tethering parameters, due to
+                  which UI shows incorrect display, to avoid
+                  this issue, CAPI will be called after 0.1sec for smooth
+                  transition of UI frames */
+               tethering_param_timer = g_timeout_add(100,
+                                                 _update_tethering_param, ad);
        }
 
        elm_naviframe_item_pop(ad->naviframe);