iface-modem-3gpp-profile-manager: initialize the 'IndexField' property
This commit is contained in:
@@ -5946,27 +5946,38 @@ modem_signal_setup_thresholds (MMIfaceModemSignal *self,
|
|||||||
/* Check support (3GPP profile management interface) */
|
/* Check support (3GPP profile management interface) */
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
modem_3gpp_profile_manager_check_support_finish (MMIfaceModem3gppProfileManager *self,
|
modem_3gpp_profile_manager_check_support_finish (MMIfaceModem3gppProfileManager *_self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
|
gchar **index_field,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return g_task_propagate_boolean (G_TASK (res), error);
|
MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self);
|
||||||
|
|
||||||
|
g_assert (g_task_propagate_boolean (G_TASK (res), NULL));
|
||||||
|
|
||||||
|
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) {
|
||||||
|
if (self->priv->is_profile_management_ext_supported) {
|
||||||
|
*index_field = g_strdup ("apn-type");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
if (self->priv->is_profile_management_supported) {
|
||||||
|
*index_field = g_strdup ("profile-id");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
modem_3gpp_profile_manager_check_support (MMIfaceModem3gppProfileManager *_self,
|
modem_3gpp_profile_manager_check_support (MMIfaceModem3gppProfileManager *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self);
|
GTask *task;
|
||||||
GTask *task;
|
|
||||||
|
|
||||||
task = g_task_new (self, NULL, callback, user_data);
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self)) && self->priv->is_profile_management_supported)
|
|
||||||
g_task_return_boolean (task, TRUE);
|
|
||||||
else
|
|
||||||
g_task_return_boolean (task, FALSE);
|
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10184,9 +10184,15 @@ modem_signal_load_values (MMIfaceModemSignal *self,
|
|||||||
static gboolean
|
static gboolean
|
||||||
modem_3gpp_profile_manager_check_support_finish (MMIfaceModem3gppProfileManager *self,
|
modem_3gpp_profile_manager_check_support_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
|
gchar **index_field,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return g_task_propagate_boolean (G_TASK (res), error);
|
if (g_task_propagate_boolean (G_TASK (res), error)) {
|
||||||
|
*index_field = g_strdup ("profile-id");;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -1465,19 +1465,22 @@ check_support_ready (MMIfaceModem3gppProfileManager *self,
|
|||||||
{
|
{
|
||||||
InitializationContext *ctx;
|
InitializationContext *ctx;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
g_autofree gchar *index_field = NULL;
|
||||||
|
|
||||||
if (!MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_GET_INTERFACE (self)->check_support_finish (self, res, &error)) {
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
|
if (!MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_GET_INTERFACE (self)->check_support_finish (self, res, &index_field, &error)) {
|
||||||
if (error) {
|
if (error) {
|
||||||
/* This error shouldn't be treated as critical */
|
/* This error shouldn't be treated as critical */
|
||||||
mm_obj_dbg (self, "profile management support check failed: %s", error->message);
|
mm_obj_dbg (self, "profile management support check failed: %s", error->message);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* profile management is supported! */
|
/* profile management is supported! */
|
||||||
|
mm_gdbus_modem3gpp_profile_manager_set_index_field (ctx->skeleton, index_field);
|
||||||
g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (TRUE));
|
g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go on to next step */
|
/* Go on to next step */
|
||||||
ctx = g_task_get_task_data (task);
|
|
||||||
ctx->step++;
|
ctx->step++;
|
||||||
interface_initialization_step (task);
|
interface_initialization_step (task);
|
||||||
}
|
}
|
||||||
|
@@ -41,6 +41,7 @@ struct _MMIfaceModem3gppProfileManager {
|
|||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* check_support_finish) (MMIfaceModem3gppProfileManager *self,
|
gboolean (* check_support_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
|
gchar **index_field,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Asynchronous setup of unsolicited events */
|
/* Asynchronous setup of unsolicited events */
|
||||||
|
Reference in New Issue
Block a user