diff --git a/src/gprs.c b/src/gprs.c index 4aa00f9d..5f7620b0 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -135,6 +135,7 @@ struct pri_context { struct ofono_gprs *gprs; }; +static void gprs_attached_update(struct ofono_gprs *gprs); static void gprs_netreg_update(struct ofono_gprs *gprs); static void gprs_deactivate_next(struct ofono_gprs *gprs); @@ -946,6 +947,16 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data) ofono_dbus_signal_property_changed(conn, ctx->path, OFONO_CONNECTION_CONTEXT_INTERFACE, "Active", DBUS_TYPE_BOOLEAN, &value); + + /* + * If "Attached" property was about to be signalled as TRUE but there + * were still active contexts, try again to signal "Attached" property + * to registered applications after active contexts have been released. + */ + if (ctx->gprs->flags & GPRS_FLAG_ATTACHED_UPDATE) { + ctx->gprs->flags &= ~GPRS_FLAG_ATTACHED_UPDATE; + gprs_attached_update(ctx->gprs); + } } static void pri_read_settings_callback(const struct ofono_error *error,