From: Forest Bond <[email protected]>
There is a race that causes the network not to be added if we get the
CDMA netreg changed signal before the CDMA connection manager added
signal. In that case the network is not added because the device has
not been created yet. So we fix this by trying to add the network
whenever the device is created.
---
NOTE: This must be applied on top of my other recent patch
("ofono: Add CDMA network when modem is registered").
plugins/ofono.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 09718a4..847f256 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -2034,8 +2034,11 @@ static void modem_update_interfaces(struct modem_data
*modem,
}
if (api_added(old_ifaces, new_ifaces, OFONO_API_CDMA_CM) == TRUE) {
- if (ready_to_create_device(modem) == TRUE)
+ if (ready_to_create_device(modem) == TRUE) {
create_device(modem);
+ if (modem->registered == TRUE)
+ add_cdma_network(modem);
+ }
if (modem->device != NULL)
cdma_cm_get_properties(modem);
@@ -2131,8 +2134,11 @@ static gboolean modem_changed(DBusConnection *conn,
DBusMessage *message,
if (has_interface(modem->interfaces,
OFONO_API_CDMA_CM) == TRUE) {
- if (ready_to_create_device(modem) == TRUE)
+ if (ready_to_create_device(modem) == TRUE) {
create_device(modem);
+ if (modem->registered == TRUE)
+ add_cdma_network(modem);
+ }
}
}
--
1.7.0.4
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman