iface-modem-messaging: never add UNKNOWN to the lists of supported storages
This commit is contained in:
@@ -1078,6 +1078,21 @@ initialization_context_complete_and_free_if_cancelled (InitializationContext *ct
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
skip_unknown_storages (GArray *mem)
|
||||
{
|
||||
guint i = mem->len;
|
||||
|
||||
if (!mem)
|
||||
return;
|
||||
|
||||
/* Remove UNKNOWN from the list of supported storages */
|
||||
while (i-- > 0) {
|
||||
if (g_array_index (mem, MMSmsStorage, i) == MM_SMS_STORAGE_UNKNOWN)
|
||||
g_array_remove_index (mem, i);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
load_supported_storages_ready (MMIfaceModemMessaging *self,
|
||||
GAsyncResult *res,
|
||||
@@ -1103,6 +1118,11 @@ load_supported_storages_ready (MMIfaceModemMessaging *self,
|
||||
GArray *supported_storages;
|
||||
guint i;
|
||||
|
||||
/* Never add unknown storages */
|
||||
skip_unknown_storages (storage_ctx->supported_mem1);
|
||||
skip_unknown_storages (storage_ctx->supported_mem2);
|
||||
skip_unknown_storages (storage_ctx->supported_mem3);
|
||||
|
||||
mem1 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem1->data,
|
||||
storage_ctx->supported_mem1->len);
|
||||
mem2 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem2->data,
|
||||
|
Reference in New Issue
Block a user