vconf_ignore_key_changed(VCONFKEY_WIFI_ENABLE_QS, __notification_value_changed_cb);
}
-static void _set_power_save(gboolean power_save)
-{
- gboolean result;
- char *if_path;
- GVariant *input_args = NULL;
- static gboolean old_state = TRUE;
- const gchar *args_disable = "POWERMODE 1";
- const gchar *args_enable = "POWERMODE 0";
- if (old_state == power_save)
- return;
-
- if_path = netconfig_wifi_get_supplicant_interface();
- if (if_path == NULL) {
- ERR("Fail to get wpa_supplicant DBus path");
- return;
- }
-
- if (power_save)
- input_args = g_variant_new("(s)", args_enable);
- else
- input_args = g_variant_new("(s)", args_disable);
-
- result = netconfig_supplicant_invoke_dbus_method_nonblock(
- SUPPLICANT_SERVICE,
- if_path,
- SUPPLICANT_INTERFACE ".Interface",
- "Driver",
- input_args,
- NULL);
- if (result == FALSE)
- ERR("Fail to set power save mode POWERMODE %d", power_save);
- else
- old_state = power_save;
-
- g_free(if_path);
-
- return;
-}
-
static void _set_power_lock(gboolean power_lock)
{
gint32 ret = 0;
/* During DHCP, temporarily disable Wi-Fi power saving */
if ((old_state < NETCONFIG_WIFI_ASSOCIATION || old_state == NETCONFIG_WIFI_FAILURE) && new_state == NETCONFIG_WIFI_CONFIGURATION) {
_set_power_lock(TRUE);
- _set_power_save(FALSE);
dhcp_stage = TRUE;
} else if (dhcp_stage == TRUE) {
_set_power_lock(FALSE);
- _set_power_save(TRUE);
dhcp_stage = FALSE;
}