gsm: treat "no network" error as zero signal for Simple.GetStatus

This commit is contained in:
Dan Williams
2011-12-14 14:19:10 -06:00
parent 2af1a612e9
commit 9f14d83047

View File

@@ -5777,8 +5777,15 @@ simple_status_got_signal_quality (MMModem *modem,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
GHashTable *properties;
gboolean error_no_network = FALSE;
if (!error) {
/* Treat "no network" as zero strength */
if (g_error_matches (error, MM_MOBILE_ERROR, MM_MOBILE_ERROR_NO_NETWORK)) {
error_no_network = TRUE;
result = 0;
}
if (!error || error_no_network) {
properties = (GHashTable *) mm_callback_info_get_data (info, SS_HASH_TAG);
g_hash_table_insert (properties, "signal_quality", simple_uint_value (result));
} else {