Commit 251eff66 authored by Chris T's avatar Chris T

More Code clean up, Make sure you can't activate the bearer if there's no modem.

parent d0d5a215
......@@ -168,7 +168,7 @@ handle_method_call (GDBusConnection *connection,
} else {
g_dbus_method_invocation_return_dbus_error (invocation,
"org.ofono.mms.ModemManager",
"Modem and/or Context not active!");
"Modem is not active!");
}
}
......@@ -211,8 +211,14 @@ handle_method_call (GDBusConnection *connection,
g_dbus_method_invocation_return_value (invocation, NULL);
}
else if (g_strcmp0 (method_name, "ProcessMessageQueue") == 0) {
activate_bearer(modem->service);
g_dbus_method_invocation_return_value (invocation, NULL);
if (modem->modem_available == TRUE) {
activate_bearer(modem->service);
g_dbus_method_invocation_return_value (invocation, NULL);
} else {
g_dbus_method_invocation_return_dbus_error (invocation,
"org.ofono.mms.ModemManager",
"Modem is not active!");
}
}
}
......@@ -613,6 +619,7 @@ pur_mm_state (int state)
modem->registration_id);
g_bus_unown_name (modem->owner_id);
mms_error("ModemManagerPlugin(): ModemManager vanished");
modem->modem_available = FALSE;
} else {
mms_error("ModemManagerPlugin(): Could not connect to ModemManager");
}
......@@ -887,6 +894,8 @@ static int modemmanager_init(void)
introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
g_assert (introspection_data != NULL);
modem->modem_available = FALSE;
modem->manager_available = FALSE;
modem->context_active = FALSE;
modem->plugin_registered = FALSE;
mm_get_modem_manager ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment