aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-cdma.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-09 19:48:43 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:24 +0100
commitd27e40ae9aea1166831920a92d4eba4f3f51605d (patch)
tree8afa0f609852eb5a501bdd98e56c7f012e34a007 /src/mm-iface-modem-cdma.c
parent6de2e3f72cb058ce31b93274ede144d95c5440bc (diff)
core: new `Initializing' state in the global modem state machine
We need to define a state to be used while the modem is being initialized, so that we forbid any operation on the modem on already exported interfaces, while there are interfaces pending to get exported. This Initializing state will also cover the state between having the SIM unlocked (which launches re-initialization) and being completely initialized.
Diffstat (limited to 'src/mm-iface-modem-cdma.c')
-rw-r--r--src/mm-iface-modem-cdma.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/mm-iface-modem-cdma.c b/src/mm-iface-modem-cdma.c
index ec5d27e6..bb338893 100644
--- a/src/mm-iface-modem-cdma.c
+++ b/src/mm-iface-modem-cdma.c
@@ -135,12 +135,19 @@ handle_activate_auth_ready (MMBaseModem *self,
g_assert_not_reached ();
break;
- case MM_MODEM_STATE_LOCKED:
+ case MM_MODEM_STATE_INITIALIZING:
g_dbus_method_invocation_return_error (ctx->invocation,
MM_CORE_ERROR,
MM_CORE_ERROR_WRONG_STATE,
"Cannot perform OTA activation: "
- "device locked");
+ "device not fully initialized yet");
+ handle_activate_context_free (ctx);
+ return;
+
+ case MM_MODEM_STATE_LOCKED:
+ /* We should never have such request in LOCKED state
+ * (interface wasn't exported yet) */
+ g_assert_not_reached ();
break;
case MM_MODEM_STATE_ENABLED:
@@ -278,12 +285,19 @@ handle_activate_manual_auth_ready (MMBaseModem *self,
g_assert_not_reached ();
break;
- case MM_MODEM_STATE_LOCKED:
+ case MM_MODEM_STATE_INITIALIZING:
g_dbus_method_invocation_return_error (ctx->invocation,
MM_CORE_ERROR,
MM_CORE_ERROR_WRONG_STATE,
"Cannot perform manual activation: "
- "device locked");
+ "device not fully initialized yet");
+ handle_activate_manual_context_free (ctx);
+ return;
+
+ case MM_MODEM_STATE_LOCKED:
+ /* We should never have such request in LOCKED state
+ * (interface wasn't exported yet) */
+ g_assert_not_reached ();
break;
case MM_MODEM_STATE_ENABLED: