diff options
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index 6560b475..6d029e86 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -1221,6 +1221,7 @@ typedef struct { HandleSetInitialEpsBearerSettingsStep step; MmGdbusModem3gpp *skeleton; GDBusMethodInvocation *invocation; + gssize operation_id; MMIfaceModem3gpp *self; GVariant *dictionary; MMBearerProperties *config; @@ -1231,6 +1232,9 @@ typedef struct { static void handle_set_initial_eps_bearer_settings_context_free (HandleSetInitialEpsBearerSettingsContext *ctx) { + if (ctx->operation_id >= 0) + mm_base_modem_operation_unlock (MM_BASE_MODEM (ctx->self), ctx->operation_id); + g_assert (!ctx->saved_error); g_clear_object (&ctx->config); g_variant_unref (ctx->dictionary); @@ -1417,7 +1421,8 @@ set_initial_eps_bearer_settings_auth_ready (MMBaseModem GVariant *old_dictionary; g_autoptr(MMBearerProperties) old_config = NULL; - if (!mm_base_modem_authorize_finish (self, res, &error)) { + ctx->operation_id = mm_base_modem_authorize_and_operation_lock_finish (self, res, &error); + if (ctx->operation_id < 0) { mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_set_initial_eps_bearer_settings_context_free (ctx); return; @@ -1474,12 +1479,15 @@ handle_set_initial_eps_bearer_settings (MmGdbusModem3gpp *skeleton, ctx->self = g_object_ref (self); ctx->dictionary = g_variant_ref (dictionary); ctx->previous_power_state = MM_MODEM_POWER_STATE_UNKNOWN; - - mm_base_modem_authorize (MM_BASE_MODEM (self), - invocation, - MM_AUTHORIZATION_DEVICE_CONTROL, - (GAsyncReadyCallback)set_initial_eps_bearer_settings_auth_ready, - ctx); + ctx->operation_id = -1; + + mm_base_modem_authorize_and_operation_lock (MM_BASE_MODEM (self), + invocation, + MM_AUTHORIZATION_DEVICE_CONTROL, + MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT, + "set-initial-eps-bearer-settings", + (GAsyncReadyCallback)set_initial_eps_bearer_settings_auth_ready, + ctx); return TRUE; } @@ -1796,6 +1804,7 @@ handle_set_packet_service_state (MmGdbusModem3gpp *skeleton, typedef struct { MmGdbusModem3gpp *skeleton; GDBusMethodInvocation *invocation; + gssize operation_id; MMIfaceModem3gpp *self; GVariant *dictionary; MMNr5gRegistrationSettings *settings; @@ -1804,6 +1813,9 @@ typedef struct { static void handle_set_nr5g_registration_settings_context_free (HandleSetNr5gRegistrationSettingsContext *ctx) { + if (ctx->operation_id >= 0) + mm_base_modem_operation_unlock (MM_BASE_MODEM (ctx->self), ctx->operation_id); + g_clear_object (&ctx->settings); g_variant_unref (ctx->dictionary); g_object_unref (ctx->skeleton); @@ -1884,7 +1896,8 @@ set_nr5g_registration_settings_auth_ready (MMBaseModem MMModem3gppDrxCycle new_drx_cycle; MMModem3gppMicoMode new_mico_mode; - if (!mm_base_modem_authorize_finish (self, res, &error)) { + ctx->operation_id = mm_base_modem_authorize_and_operation_lock_finish (self, res, &error); + if (ctx->operation_id < 0) { mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_set_nr5g_registration_settings_context_free (ctx); return; @@ -1957,12 +1970,15 @@ handle_set_nr5g_registration_settings (MmGdbusModem3gpp *skeleton, ctx->invocation = g_object_ref (invocation); ctx->self = g_object_ref (self); ctx->dictionary = g_variant_ref (dictionary); - - mm_base_modem_authorize (MM_BASE_MODEM (self), - invocation, - MM_AUTHORIZATION_DEVICE_CONTROL, - (GAsyncReadyCallback)set_nr5g_registration_settings_auth_ready, - ctx); + ctx->operation_id = -1; + + mm_base_modem_authorize_and_operation_lock (MM_BASE_MODEM (self), + invocation, + MM_AUTHORIZATION_DEVICE_CONTROL, + MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT, + "set-nr5g-registration-settings", + (GAsyncReadyCallback)set_nr5g_registration_settings_auth_ready, + ctx); return TRUE; } |