fix async API issue of TAPI
[apps/core/preloaded/settings.git] / setting-security / src / setting-security-sim-settings.c
index e849907..710749f 100755 (executable)
@@ -199,6 +199,13 @@ static void get_pin_lock_info_cb(TapiHandle *handle, int result, void *data, voi
 
        SettingSecurityUG *ad = (SettingSecurityUG *)user_data;
 
+       /* delete popup */
+       if(ad->sim_popup)
+       {
+               evas_object_del(ad->sim_popup);
+               ad->sim_popup = NULL;
+       }
+
        int old_state = elm_check_state_get(ad->data_pin_lk->eo_check);
        if (old_state) {
                SETTING_TRACE("Current status of PIN Lock is ON");
@@ -258,6 +265,17 @@ static void get_pin_lock_info_cb(TapiHandle *handle, int result, void *data, voi
                return;
        }
 
+       /* create popup */
+       if(ad->sim_popup)
+       {
+               evas_object_del(ad->sim_popup);
+               ad->sim_popup = NULL;
+       }
+       ad->sim_popup = setting_create_popup_without_btn(ad, ad->win_get,
+                                                                               NULL, _("Waiting response of SIM ..."), 
+                                                                               NULL,
+                                                                               0, FALSE, FALSE);
+
        if(tel_get_sim_lock_info(ad->handle, TAPI_SIM_LOCK_SC, get_pin_lock_info_cb, ad) != 0)
        {
                SETTING_TRACE_ERROR("failed to call tel_get_sim_lock_info()");
@@ -274,6 +292,13 @@ static void get_sim_lock_info_cb(TapiHandle *handle, int result, void *data, voi
 
        SettingSecurityUG *ad = (SettingSecurityUG *)user_data;
 
+       /* delete popup */
+       if(ad->sim_popup)
+       {
+               evas_object_del(ad->sim_popup);
+               ad->sim_popup = NULL;
+       }
+
        int old_state = elm_check_state_get(ad->data_sim_lk->eo_check);
        if (old_state) {
                SETTING_TRACE("Current status of SIM Lock is ON");
@@ -309,6 +334,17 @@ void _draw_sim_onoff_status(void *data, Evas_Object *check)
        if(ret == SETTING_RETURN_FAIL)
                return;
 
+       /* create popup */
+       if(ad->sim_popup)
+       {
+               evas_object_del(ad->sim_popup);
+               ad->sim_popup = NULL;
+       }
+       ad->sim_popup = setting_create_popup_without_btn(ad, ad->win_get,
+                                                                               NULL, _("Waiting response of SIM ..."), 
+                                                                               NULL,
+                                                                               0, FALSE, FALSE);
+
        if(tel_get_sim_lock_info(ad->handle, TAPI_SIM_LOCK_PS, get_sim_lock_info_cb, ad) != 0)
        {
                SETTING_TRACE_ERROR("failed to call tel_get_sim_lock_info()");