daemon: more efficient poll resetting

If the poll timeout is actually changed because the warning level
has changed, only reset the actual poll code, not the warning level
notifications and the booking structures.

https://bugs.freedesktop.org/show_bug.cgi?id=99862
This commit is contained in:
Christian Kellner 2017-02-22 17:46:11 +01:00 committed by Bastien Nocera
parent 7171ce38d6
commit e4b85ef5df

View file

@ -777,9 +777,9 @@ change_idle_timeout (UpDevice *device,
g_debug ("Resetting for polling for '%s' (warning-level change)",
up_device_get_object_path (device));
g_source_remove (data->id);
data->timeout = timeout;
up_daemon_stop_poll (G_OBJECT (device));
up_daemon_start_poll (G_OBJECT (device), callback);
enable_poll_for_device (device, data);
}
g_object_unref (daemon);