api,core,mmcli: Add new 'API' support to set-default-storage for SMS

API support has been added to set default storage for SMS.
Changes were made to get, set the deafult storage value.
This commit is contained in:
Akula Susmitha
2024-10-07 16:35:09 +05:30
parent a63c300437
commit f22d099f38
6 changed files with 299 additions and 1 deletions
+94
View File
@@ -642,6 +642,100 @@ mm_modem_messaging_delete_sync (MMModemMessaging *self,
/*****************************************************************************/
/**
* mm_modem_messaging_set_default_storage_finish
* @self: A #MMModemMessaging.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to
* mm_modem_messaging_set_default_storage()
* @error: Return location for error or %NULL.
*
* Finishes an operation started with mm_modem_messaging_set_default_storage().
*
* Returns: %TRUE if set default storage is sucess, %FALSE if @error is set.
*
* Since: 1.24
*/
gboolean
mm_modem_messaging_set_default_storage_finish (MMModemMessaging *self,
GAsyncResult *res,
GError **error)
{
g_return_val_if_fail (MM_IS_MODEM_MESSAGING (self), FALSE);
return mm_gdbus_modem_messaging_call_set_default_storage_finish (MM_GDBUS_MODEM_MESSAGING (self),
res,
error);
}
/**
* mm_modem_messaging_set_default_storage
* @self: A #MMModemMessaging.
* @storage: A #MMSmsStorage to set default storage.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or
* %NULL
* @user_data: User data to pass to @callback.
*
* Asynchronously set deafult #MMSmsStorage in the modem.
*
* When the operation is finished, @callback will be invoked in the
* <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
* of the thread you are calling this method from. You can then call
* mm_modem_messaging_set_default_storage_finish() to get the result of the operation.
*
* See mm_modem_messaging_set_default_storage_sync() for the synchronous, blocking version
* of this method.
*
* Since: 1.24
*/
void
mm_modem_messaging_set_default_storage (MMModemMessaging *self,
MMSmsStorage storage,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail (MM_IS_MODEM_MESSAGING (self));
mm_gdbus_modem_messaging_call_set_default_storage (MM_GDBUS_MODEM_MESSAGING (self),
storage,
cancellable,
callback,
user_data);
}
/**
* mm_modem_messaging_set_default_storage_sync
* @self: A #MMModemMessaging.
* @storage: A #MMSmsStorage to set default storage.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
*
* Synchronously set deafult #MMSmsStorage in the modem.
*
* The calling thread is blocked until a reply is received. See
* mm_modem_messaging_set_default_storage() for the asynchronous version of this method.
*
* Returns: %TRUE if set default storage is sucess, %FALSE if @error is set.
*
* Since: 1.24
*/
gboolean
mm_modem_messaging_set_default_storage_sync (MMModemMessaging *self,
MMSmsStorage storage,
GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (MM_IS_MODEM_MESSAGING (self), FALSE);
return mm_gdbus_modem_messaging_call_set_default_storage_sync (MM_GDBUS_MODEM_MESSAGING (self),
storage,
cancellable,
error);
}
/*****************************************************************************/
static void
mm_modem_messaging_init (MMModemMessaging *self)
{
+13
View File
@@ -116,6 +116,19 @@ gboolean mm_modem_messaging_delete_sync (MMModemMessaging *self,
GCancellable *cancellable,
GError **error);
void mm_modem_messaging_set_default_storage (MMModemMessaging *self,
MMSmsStorage storage,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean mm_modem_messaging_set_default_storage_finish (MMModemMessaging *self,
GAsyncResult *res,
GError **error);
gboolean mm_modem_messaging_set_default_storage_sync (MMModemMessaging *self,
MMSmsStorage storage,
GCancellable *cancellable,
GError **error);
G_END_DECLS
#endif /* _MM_MODEM_MESSAGING_H_ */