iface-modem-3gpp: load initial set of enabled facility locks
This commit is contained in:
@@ -1537,6 +1537,7 @@ static void interface_initialization_step (InitializationContext *ctx);
|
||||
typedef enum {
|
||||
INITIALIZATION_STEP_FIRST,
|
||||
INITIALIZATION_STEP_IMEI,
|
||||
INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS,
|
||||
INITIALIZATION_STEP_LAST
|
||||
} InitializationStep;
|
||||
|
||||
@@ -1578,6 +1579,27 @@ initialization_context_complete_and_free (InitializationContext *ctx)
|
||||
g_free (ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
|
||||
GAsyncResult *res,
|
||||
InitializationContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
MMModem3gppFacility facilities;
|
||||
|
||||
facilities = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_enabled_facility_locks_finish (self, res, &error);
|
||||
mm_gdbus_modem3gpp_set_enabled_facility_locks (ctx->skeleton, facilities);
|
||||
|
||||
if (error) {
|
||||
mm_warn ("couldn't load facility locks: '%s'", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
/* Go on to next step */
|
||||
ctx->step++;
|
||||
interface_initialization_step (ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
load_imei_ready (MMIfaceModem3gpp *self,
|
||||
GAsyncResult *res,
|
||||
@@ -1624,6 +1646,18 @@ interface_initialization_step (InitializationContext *ctx)
|
||||
/* Fall down to next step */
|
||||
ctx->step++;
|
||||
|
||||
case INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS:
|
||||
if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks &&
|
||||
MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks_finish) {
|
||||
MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks (
|
||||
ctx->self,
|
||||
(GAsyncReadyCallback)load_enabled_facility_locks_ready,
|
||||
ctx);
|
||||
return;
|
||||
}
|
||||
/* Fall down to next step */
|
||||
ctx->step++;
|
||||
|
||||
case INITIALIZATION_STEP_LAST:
|
||||
/* We are done without errors! */
|
||||
|
||||
|
||||
@@ -58,6 +58,14 @@ struct _MMIfaceModem3gpp {
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Loading of the facility locks property */
|
||||
void (*load_enabled_facility_locks) (MMIfaceModem3gpp *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMModem3gppFacility (*load_enabled_facility_locks_finish) (MMIfaceModem3gpp *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Asynchronous setup of indicators */
|
||||
void (*setup_indicators) (MMIfaceModem3gpp *self,
|
||||
GAsyncReadyCallback callback,
|
||||
|
||||
Reference in New Issue
Block a user