aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-12-13 14:08:43 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-12-26 10:12:11 +0100
commit853aa29be80ee397f64d18c4d9cce64be35aec14 (patch)
treecca7f1a813e979b42e8ecacd156102e8e751ef20 /plugins
parent0d0ad722d9da2039ad71ece9c8ae4b1786c7f757 (diff)
iface-modem-3gpp-profile-manager: support 'apn-type' as index field
The modem may report the 'apn-type' field is the one to be used as index; if that's the case, allow setting and deleting profiles based on the given 'apn-type' field. This change also makes the internal profile management operations use one index field or another, based on what the protocol implements.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/icera/mm-broadband-modem-icera.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
index e60d4bd5..26016c4c 100644
--- a/plugins/icera/mm-broadband-modem-icera.c
+++ b/plugins/icera/mm-broadband-modem-icera.c
@@ -1954,15 +1954,21 @@ store_profile_context_free (StoreProfileContext *ctx)
static gint
modem_3gpp_profile_manager_store_profile_finish (MMIfaceModem3gppProfileManager *self,
GAsyncResult *res,
+ gint *out_profile_id,
+ MMBearerApnType *out_apn_type,
GError **error)
{
StoreProfileContext *ctx;
if (!g_task_propagate_boolean (G_TASK (res), error))
- return MM_3GPP_PROFILE_ID_UNKNOWN;
+ return FALSE;
ctx = g_task_get_task_data (G_TASK (res));
- return ctx->profile_id;
+ if (out_profile_id)
+ *out_profile_id = ctx->profile_id;
+ if (out_apn_type)
+ *out_apn_type = MM_BEARER_APN_TYPE_NONE;
+ return TRUE;
}
static void profile_manager_store_profile_auth_settings (GTask *task);
@@ -2076,7 +2082,7 @@ profile_manager_parent_store_profile_ready (MMIfaceModem3gppProfileManager *self
{
GError *error = NULL;
- if (iface_modem_3gpp_profile_manager_parent->store_profile_finish (self, res, &error) == MM_3GPP_PROFILE_ID_UNKNOWN) {
+ if (!iface_modem_3gpp_profile_manager_parent->store_profile_finish (self, res, NULL, NULL, &error)) {
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -2088,12 +2094,15 @@ profile_manager_parent_store_profile_ready (MMIfaceModem3gppProfileManager *self
static void
modem_3gpp_profile_manager_store_profile (MMIfaceModem3gppProfileManager *self,
MM3gppProfile *profile,
+ const gchar *index_field,
GAsyncReadyCallback callback,
gpointer user_data)
{
StoreProfileContext *ctx;
GTask *task;
+ g_assert (g_strcmp0 (index_field, "profile-id") == 0);
+
task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (StoreProfileContext);
ctx->profile = g_object_ref (profile);
@@ -2104,6 +2113,7 @@ modem_3gpp_profile_manager_store_profile (MMIfaceModem3gppProfileManager *self,
iface_modem_3gpp_profile_manager_parent->store_profile (
self,
profile,
+ index_field,
(GAsyncReadyCallback)profile_manager_parent_store_profile_ready,
task);
}