summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathmesh Prabhu <pprabhu@chromium.org>2013-10-30 15:57:03 -0700
committerAleksander Morgado <aleksander@lanedo.com>2013-11-08 08:45:38 +0100
commit3c6428fa588cbd9f81f30de259af20d3825b0320 (patch)
tree2dbd61b4913d3ac960285e1e9c986b26b128a4f2
parent1b3114a0f9ca28273e1446535b73d5b83c54c6cf (diff)
downloadModemManager-3c6428fa588cbd9f81f30de259af20d3825b0320.tar.gz
bearer: notify final disconnect status using mm_bearer_report_connection_status
Some MMBearer methods to disconnect the bearer assume that the bearer is disconnected even if the operation fails in a subclass. This leaves MMBearer and MMBroadbandBearer states out of sync. This patch notifies the bearer object of the final disconnection using mm_bearer_report_connection_status. This gives the subclasses a chance to update their state even when the disconnection attempt fails.
-rw-r--r--src/mm-bearer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-bearer.c b/src/mm-bearer.c
index f57ea8be6..6592619b3 100644
--- a/src/mm-bearer.c
+++ b/src/mm-bearer.c
@@ -441,7 +441,12 @@ disconnect_after_cancel_ready (MMBearer *self,
else
mm_dbg ("Disconnected bearer '%s'", self->priv->path);
- bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED);
+ /* Report disconnection to the bearer object using class method
+ * mm_bearer_report_connection_status. This gives subclass implementations a
+ * chance to correctly update their own connection state, in case this base
+ * class ignores a failed disconnection attempt.
+ */
+ mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
}
static void
@@ -945,7 +950,12 @@ disconnect_force_ready (MMBearer *self,
else
mm_dbg ("Disconnected bearer '%s'", self->priv->path);
- bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED);
+ /* Report disconnection to the bearer object using class method
+ * mm_bearer_report_connection_status. This gives subclass implementations a
+ * chance to correctly update their own connection state, in case this base
+ * class ignores a failed disconnection attempt.
+ */
+ mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
}
void