3G auto-connection may fail as the cellular network service may not be
ready to connect.
With this patch, the cellular network service should be exposed only after
PS network attachment is done.
if (g_str_equal(key, "Attached") == TRUE) {
DBG("Attached %d", value);
if (g_str_equal(key, "Attached") == TRUE) {
DBG("Attached %d", value);
+ if (modem->attached == value)
+ return;
+
modem_clear_network_errors(modem);
modem_clear_network_errors(modem);
+ check_networks(modem);
+ }
} else if (g_str_equal(key, "Powered") == TRUE) {
DBG("Powered %d", value);
} else if (g_str_equal(key, "Powered") == TRUE) {
DBG("Powered %d", value);
dbus_pending_call_unref(call);
dbus_pending_call_unref(call);
}
static void check_gprs(struct modem_data *modem)
}
static void check_gprs(struct modem_data *modem)
if (modem == NULL || modem->device == NULL)
return TRUE;
if (modem == NULL || modem->device == NULL)
return TRUE;
+ /* Create the related network only when we are attached */
+ if (modem->attached == FALSE)
+ return TRUE;
+
if (dbus_message_iter_init(message, &iter) == FALSE)
return TRUE;
if (dbus_message_iter_init(message, &iter) == FALSE)
return TRUE;