aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-30 11:06:32 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-30 13:47:00 +0200
commit7518772d4bcb5f6a2c5d4fcf33346e1036625755 (patch)
treede9de16e3eae87797bbe8c44c0b8fecbe6ddd276 /src/mm-base-modem.c
parent3b366118b66bb27642a72adb49ceafaab5b6da5d (diff)
core: fatal errors in iface initializations force the modem into a FAILED state
Modems which end up being found unusable (e.g. no SIM, fatal SIM error, no capabilities) will be exposed in DBus, but just with the Modem interface and in a FAILED state which allows no actions.
Diffstat (limited to 'src/mm-base-modem.c')
-rw-r--r--src/mm-base-modem.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c
index c8e042e0..7ad2f259 100644
--- a/src/mm-base-modem.c
+++ b/src/mm-base-modem.c
@@ -565,22 +565,18 @@ initialize_ready (MMBaseModem *self,
if (!mm_base_modem_initialize_finish (self, res, &error)) {
/* Wrong state is returned when modem is found locked */
- if (g_error_matches (error,
- MM_CORE_ERROR,
- MM_CORE_ERROR_WRONG_STATE)) {
+ if (g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE))
mm_dbg ("Couldn't finish initialization in the current state: '%s'",
error->message);
- mm_base_modem_set_valid (self, TRUE);
- } else {
+ else
mm_warn ("couldn't initialize the modem: '%s'", error->message);
- mm_base_modem_set_valid (self, FALSE);
- }
-
g_error_free (error);
- return;
- }
+ } else
+ mm_dbg ("modem properly initialized");
- mm_dbg ("modem properly initialized");
+ /* Even with initialization errors, we do set the state to valid, so
+ * that the modem gets exported and the failure notified to the user.
+ */
mm_base_modem_set_valid (self, TRUE);
}