From 804cd7f07710362a6454fbf2cee689492b3060d4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 2 Aug 2011 12:43:26 -0500 Subject: [PATCH] gsm: work around Motorola Android phone modem bugs (bgo #637327) It seems the Motorola Flipout with Android 2.1 doesn't like to return configured PDP contexts via AT+CGDCONT?; it returns an error. It seems to accept the rest of the dial sequence though, so just ignore the error when reading existing PDP contexts. --- src/mm-generic-gsm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index a3a1833e..674b78f5 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -3622,7 +3622,12 @@ existing_apns_read (MMAtSerialPort *port, return; if (error) { - info->error = g_error_copy (error); + /* Some Android phones don't support querying existing PDP contexts, + * but will accept setting the APN. So if CGDCONT? isn't supported, + * just ignore that error and hope for the best. (bgo #637327) + */ + if (g_error_matches (error, MM_MOBILE_ERROR, MM_MOBILE_ERROR_NOT_SUPPORTED) == FALSE) + info->error = g_error_copy (error); } else if (g_str_has_prefix (response->str, "+CGDCONT:")) { GRegex *r; GMatchInfo *match_info;