iface-modem: ensure the state change is flushed before the detailed notify

In order to ease the life for clients listening to the 'state-changed' signal,
the change in the 'state' property in the DBus interface skeleton is flushed
right away, before emitting 'state-changed'. By doing this we make sure that
the 'state-changed' callbacks in the clients are able to see exactly the same
current state in the modem proxy.
This commit is contained in:
Aleksander Morgado
2012-09-28 14:57:25 +02:00
parent 65c3976cad
commit 00a8ed3af4

View File

@@ -1001,11 +1001,16 @@ mm_iface_modem_update_state (MMIfaceModem *self,
NULL);
/* Signal status change */
if (skeleton)
if (skeleton) {
/* Flush current change before signaling the state change,
* so that clients get the proper state already in the
* state-changed callback */
g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (skeleton));
mm_gdbus_modem_emit_state_changed (skeleton,
old_state,
new_state,
reason);
}
/* If we go to registered state (from unregistered), setup signal
* quality and access technologies periodic retrieval */