aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-cdma.c
diff options
context:
space:
mode:
authorDan Williams <dan@ioncontrol.co>2025-04-29 20:54:36 -0500
committerDan Williams <dan@ioncontrol.co>2025-05-08 20:08:06 -0500
commitef5cee3ab578c2fde8ca6cc636f10acfdb79f123 (patch)
tree02510944a5782a9c4047234b747fdc02dd8f31c8 /src/mm-iface-modem-cdma.c
parent7262b46a82642b7232ef922b827d77626a93eec0 (diff)
auth-provider: move auth provider logic into each class
Rather than make all of them rely on MMBaseModem for it. This lets us disentangle dependencies for easier unit testing. For interfaces, rather than casting directly to MMBaseModem use intermediate interfaces (MMIfaceAuth and MMIfaceOpLock) that tests can fake out. Signed-off-by: Dan Williams <dan@ioncontrol.co>
Diffstat (limited to 'src/mm-iface-modem-cdma.c')
-rw-r--r--src/mm-iface-modem-cdma.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mm-iface-modem-cdma.c b/src/mm-iface-modem-cdma.c
index 14d1ae9a..9cf5872c 100644
--- a/src/mm-iface-modem-cdma.c
+++ b/src/mm-iface-modem-cdma.c
@@ -136,17 +136,18 @@ handle_activate_ready (MMIfaceModemCdma *self,
}
static void
-handle_activate_auth_ready (MMBaseModem *self,
+handle_activate_auth_ready (MMIfaceAuth *_self,
GAsyncResult *res,
HandleActivateContext *ctx)
{
+ MMIfaceModemCdma *self = MM_IFACE_MODEM_CDMA (_self);
Private *priv;
MMModemState modem_state;
GError *error = NULL;
priv = get_private (MM_IFACE_MODEM_CDMA (self));
- if (!mm_base_modem_authorize_finish (self, res, &error)) {
+ if (!mm_iface_auth_authorize_finish (_self, res, &error)) {
mm_dbus_method_invocation_take_error (ctx->invocation, error);
handle_activate_context_free (ctx);
return;
@@ -254,7 +255,7 @@ handle_activate (MmGdbusModemCdma *skeleton,
ctx->self = g_object_ref (self);
ctx->carrier = g_strdup (carrier);
- mm_base_modem_authorize (MM_BASE_MODEM (self),
+ mm_iface_auth_authorize (MM_IFACE_AUTH (self),
invocation,
MM_AUTHORIZATION_DEVICE_CONTROL,
(GAsyncReadyCallback)handle_activate_auth_ready,
@@ -302,10 +303,11 @@ handle_activate_manual_ready (MMIfaceModemCdma *self,
}
static void
-handle_activate_manual_auth_ready (MMBaseModem *self,
+handle_activate_manual_auth_ready (MMIfaceAuth *_self,
GAsyncResult *res,
HandleActivateManualContext *ctx)
{
+ MMIfaceModemCdma *self = MM_IFACE_MODEM_CDMA (_self);
MMCdmaManualActivationProperties *properties;
Private *priv;
MMModemState modem_state;
@@ -313,7 +315,7 @@ handle_activate_manual_auth_ready (MMBaseModem *self,
priv = get_private (MM_IFACE_MODEM_CDMA (self));
- if (!mm_base_modem_authorize_finish (self, res, &error)) {
+ if (!mm_iface_auth_authorize_finish (_self, res, &error)) {
mm_dbus_method_invocation_take_error (ctx->invocation, error);
handle_activate_manual_context_free (ctx);
return;
@@ -422,7 +424,7 @@ handle_activate_manual (MmGdbusModemCdma *skeleton,
ctx->self = g_object_ref (self);
ctx->dictionary = g_variant_ref (dictionary);
- mm_base_modem_authorize (MM_BASE_MODEM (self),
+ mm_iface_auth_authorize (MM_IFACE_AUTH (self),
invocation,
MM_AUTHORIZATION_DEVICE_CONTROL,
(GAsyncReadyCallback)handle_activate_manual_auth_ready,