switch (popup_type) {
case MH_POP_WIFI_ON_CONF:
wifi_is_activated(&wifi_state);
- if (wifi_state == true) {
- if (_turn_off_wifi(ad) != 0) {
- ERR("_turn_off_wifi is failed\n");
+ DBG("wifi_state : %d\n", wifi_state);
+ if (wifi_state == false) {
+ ret = vconf_set_int(VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE,
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_PENDING_ON);
+ if (ret < 0)
+ ERR("vconf_set_int() is failed : %d\n", ret);
+
+ if (_turn_on_wifi(ad) != 0) {
+ ERR("_turn_on_wifi is failed\n");
_update_wifi_item(ad, MH_STATE_NONE);
}
} else if (_is_wifi_direct_on() == true) {
break;
case MH_POP_WIFI_OFF_CONF:
+ ret = vconf_set_int(VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE,
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_PENDING_OFF);
+ if (ret < 0)
+ ERR("vconf_set_int() is failed : %d\n", ret);
+
ret = tethering_disable(ad->handle, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
ERR("wifi tethering off is failed : %d\n", ret);
elm_access_object_unregister(label);
return label;
-}
\ No newline at end of file
+}
return;
}
-static void __recover_wifi_station_mode(void)
-{
- DBG("+\n");
-
- if (__get_vconf_prev_wifi_state() == false) {
- DBG("No need to recover wifi station mode\n");
- return;
- }
-
- if (_turn_on_wifi() != 0)
- ERR("_turn_on_wifi is failed\n");
- if (vconf_set_bool(VCONF_MOBILE_AP_PREV_WIFI_STATUS, 0) < 0)
- ERR("vconf_set_bool failed\n");
-
- return;
-}
-
/* Wi-Fi Direct callback */
static void _wifi_direct_state_cb(int error_code, wifi_direct_device_state_e state, void *user_data)
{
{
__MOBILE_AP_FUNC_ENTER__;
+ if (user_data == NULL) {
+ ERR("The param is NULL\n");
+ return;
+ }
+
+ mh_appdata_t *ad = (mh_appdata_t *)user_data;
+ int ret = 0;
+
+ if (result != WIFI_ERROR_NONE) {
+ ERR("__wifi_activated_cb error : %d\n", result);
+ _update_main_view(ad);
+ return;
+ }
+
DBG("Wi-Fi on is done\n");
+ ret = tethering_enable(ad->handle, TETHERING_TYPE_WIFI);
+ if (ret != TETHERING_ERROR_NONE) {
+ ERR("wifi tethering on is failed : %d\n", ret);
+ return;
+ }
+ _update_main_view(ad);
+
__MOBILE_AP_FUNC_EXIT__;
return;
}
return;
}
+ if (result == TETHERING_ERROR_NONE) {
+ int ret = vconf_set_int(
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE,
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_ON);
+ if (ret < 0)
+ ERR("vconf_set_int() is failed : %d\n", ret);
+ }
+
mh_appdata_t *ad = (mh_appdata_t *)user_data;
ad->main.need_recover_wifi_tethering = false;
return;
}
+ if (result == TETHERING_ERROR_NONE) {
+ int ret = vconf_set_int(
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE,
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_OFF);
+ if (ret < 0)
+ ERR("vconf_set_int() is failed : %d\n", ret);
+ }
+
mh_appdata_t *ad = (mh_appdata_t *)user_data;
if (ad->main.need_recover_wifi_tethering == true) {
}
DBG("Tethering [%d] is disabled by reqeust\n", type);
- if (type == TETHERING_TYPE_WIFI) {
- __recover_wifi_station_mode();
- }
_update_main_view(ad);
_("IDS_MOBILEAP_POP_DISABLING_TETHERING_WILL_PREVENT_LINKED_DEVICES_FROM_ACCESSING_THE_INTERNET_CONTINUE_Q"));
_create_popup(ad);
} else {
+ ret = vconf_set_int(
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE,
+ VCONFKEY_MOBILE_HOTSPOT_WIFI_PENDING_OFF);
+ if (ret < 0)
+ ERR("vconf_set_int() is failed : %d\n", ret);
+
ret = tethering_disable(ad->handle, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
ERR("wifi tethering off is failed : %d\n", ret);
return 0;
}
-int _turn_on_wifi(void)
+int _turn_on_wifi(mh_appdata_t *ad)
{
int ret;
- ret = wifi_activate(__wifi_activated_cb, NULL);
+ ret = wifi_activate(__wifi_activated_cb, (void *)ad);
if (ret != WIFI_ERROR_NONE) {
ERR("wifi_activate() is failed : %d\n", ret);
return -1;