iface-modem: disable unsolicited 3GPP events during quick suspend/resume

This introduces the "terse" mode during quick suspend/resume, right now
it is used by 3GPP interface to disable unsolicited events, but in
future it can be used by other interfaces as well.

This prevents device to wake-up from suspend for each unsolicited while
still allowing to wake up on calls or SMS messages.

Signed-off-by: biemster <biemster@gmail.com>
Signed-off-by: Bhushan Shah <bshah@kde.org>
This commit is contained in:
biemster
2025-07-28 09:45:10 -05:00
committed by Dan Williams
parent 3a1184785b
commit d22bc4d402
8 changed files with 388 additions and 15 deletions
+29
View File
@@ -730,6 +730,7 @@ typedef enum {
STATE_OPERATION_TYPE_DISABLE,
#if defined WITH_SUSPEND_RESUME
STATE_OPERATION_TYPE_SYNC,
STATE_OPERATION_TYPE_TERSE,
#endif
} StateOperationType;
@@ -855,6 +856,12 @@ state_operation (MMBaseModem *self,
ctx->operation = MM_BASE_MODEM_GET_CLASS (self)->sync;
ctx->operation_finish = MM_BASE_MODEM_GET_CLASS (self)->sync_finish;
break;
case STATE_OPERATION_TYPE_TERSE:
operation_description = "terse";
optional = TRUE;
ctx->operation = MM_BASE_MODEM_GET_CLASS (self)->terse;
ctx->operation_finish = MM_BASE_MODEM_GET_CLASS (self)->terse_finish;
break;
#endif
default:
g_assert_not_reached ();
@@ -909,6 +916,28 @@ mm_base_modem_sync (MMBaseModem *self,
user_data);
}
gboolean
mm_base_modem_terse_finish (MMBaseModem *self,
GAsyncResult *res,
GError **error)
{
return state_operation_finish (self, res, error);
}
void
mm_base_modem_terse (MMBaseModem *self,
MMBaseModemOperationLock operation_lock,
GAsyncReadyCallback callback,
gpointer user_data)
{
state_operation (self,
STATE_OPERATION_TYPE_TERSE,
operation_lock,
MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT,
callback,
user_data);
}
#endif /* WITH_SUSPEND_RESUME */
/******************************************************************************/