static guint network_connected_popup_timer_id = 0;
static gboolean block_network_connected_popup = FALSE;
-static const char *_convert_wifi_service_state_to_string(wifi_service_state_e wifi_service_state_type)
+char *_convert_wifi_service_state_to_string(wifi_service_state_e wifi_service_state_type)
{
switch (wifi_service_state_type) {
case NETCONFIG_WIFI_UNKNOWN:
return "Invalid parameter";
}
-static const char *_convert_wifi_technology_state_to_string(wifi_tech_state_e wifi_tech_state_type)
+char *_convert_wifi_technology_state_to_string(wifi_tech_state_e wifi_tech_state_type)
{
switch (wifi_tech_state_type) {
case NETCONFIG_WIFI_TECH_UNKNOWN:
static void _set_power_save(gboolean power_save)
{
gboolean result;
- const char *if_path;
+ char *if_path;
GVariant *input_args = NULL;
static gboolean old_state = TRUE;
const gchar *args_disable = "POWERMODE 1";
}
if (power_save)
- input_args = g_variant_new_string(args_enable);
+ input_args = g_variant_new("(s)", args_enable);
else
- input_args = g_variant_new_string(args_disable);
+ input_args = g_variant_new("(s)", args_disable);
result = netconfig_supplicant_invoke_dbus_method_nonblock(
SUPPLICANT_SERVICE,
else
old_state = power_save;
- g_variant_unref(input_args);
+ g_free(if_path);
+
return;
}
return;
}
- ret = g_variant_get_int32(reply);
- if (ret < 0)
- ERR("Failed to set power lock %s with ret %d",
+ if (g_variant_is_of_type(reply, G_VARIANT_TYPE_INT32)) {
+ ret = g_variant_get_int32(reply);
+ if (ret < 0)
+ ERR("Failed to set power lock %s with ret %d",
power_lock == TRUE ? "enable" : "disable", ret);
- else
- old_state = power_lock;
+ else
+ old_state = power_lock;
+ }
g_variant_unref(reply);
netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_ON);
netconfig_wifi_bgscan_stop();
+ netconfig_wifi_bgscan_set_interval(SCAN_EXPONENTIAL_MIN);
netconfig_wifi_bgscan_start(TRUE);
/* Add callback to track change in notification setting */
netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_OFF);
- netconfig_wifi_set_bgscan_pause(FALSE);
netconfig_wifi_bgscan_stop();
_set_bss_found(FALSE);
netconfig_wifi_indicator_stop();
- netconfig_wifi_set_bgscan_pause(FALSE);
-
netconfig_wifi_bgscan_stop();
+ netconfig_wifi_bgscan_set_interval(SCAN_EXPONENTIAL_MIN);
netconfig_wifi_bgscan_start(TRUE);
} else if ((old_state > NETCONFIG_WIFI_IDLE && old_state < NETCONFIG_WIFI_CONNECTED) && new_state == NETCONFIG_WIFI_IDLE) {
/* in ipv6 case disconnect/association -> association */
DBG("reset the bg scan period");
- netconfig_wifi_set_bgscan_pause(FALSE);
netconfig_wifi_bgscan_stop();
netconfig_wifi_bgscan_start(TRUE);
DBG("%s", sdata);
}
}
- g_variant_iter_free(next);
}
g_variant_unref(message);