summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorForest Bond <forest.bond@rapidrollout.com>2013-03-29 12:23:55 -0400
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-03 11:11:17 +0300
commitcc451da07895b1b2bc4c20c901344ce2ce3e3f08 (patch)
tree24465a968cfba9d6c1261dcfde319685a64410f5 /plugins
parent4c09e05f07a7777929e05552e659cae09cf5a4cb (diff)
downloadconnman-cc451da07895b1b2bc4c20c901344ce2ce3e3f08.tar.gz
connman-cc451da07895b1b2bc4c20c901344ce2ce3e3f08.tar.bz2
connman-cc451da07895b1b2bc4c20c901344ce2ce3e3f08.zip
ofono: Add the CDMA network when the device is created
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 09718a4b..847f2562 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);
+ }
}
}