iface-modem-messaging: Validate supported storages
Check for supported storages before setting default storage. Signed-off-by: Akula Susmitha <quic_asusmith@quicinc.com>
This commit is contained in:
committed by
Dan Williams
parent
7055b94eee
commit
0d6c9279d3
@@ -428,11 +428,9 @@ handle_set_default_storage_auth_ready (MMBaseModem *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->storage == MM_SMS_STORAGE_UNKNOWN) {
|
||||
mm_dbus_method_invocation_return_error (ctx->invocation,
|
||||
MM_CORE_ERROR,
|
||||
MM_CORE_ERROR_UNSUPPORTED,
|
||||
"Cannot set default storage: Unknown storage");
|
||||
/* Check if the requested storage is supported or not */
|
||||
if (!mm_iface_modem_messaging_is_storage_supported_for_storing (ctx->self, ctx->storage, &error)) {
|
||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
handle_set_default_storage_context_free (ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user