GNOME Bugzilla – Bug 688944
Guess operator name from MCC/MNC or SID when not explicitly given
Last modified: 2013-02-12 16:44:37 UTC
When the modem doesn't know the operator name, try to guess it using the mobile broadband providers database through libnm-gtk (see bug 688206): * GSM/HSPA/LTE modems can look for Operator name using Operator code (MCC/MNC) * CDMA/EV-DO modems can look for the Operator name using SID This logic is currently used also in gnome-shell.
Yep, though waiting on updated packages for ModemManager to test this. Also, is there a way to fake such a modem, or make MM unable to find out the operator name in the first place?
The updated package should be in network-manager-applet, not in MM. In my case, I test this by forcing the modem into 2G or 3G; my main operator only does 3G and in that case it gives both MCCMNC and operator ID; when forced to do 2G it roams to another operator and in this case it only gives me MCCMNC. In order to test this, though, I usually just hack an empty string operator-id hardcoded directly...
Once bug 688238 has landed, a patch would be much appreciated.
Both things are completely orthogonal actually; the operator name guessing depends on network-manager-applet (which is already in git master); while the MM1 interface integration depends on NM (which is also in git master). I'll sure provide a patch for this one anyway - actually, I thought I already had done it :)
Created attachment 235243 [details] [review] Try to guess operator name from MCCMNC or SID This patch implements the logic using the mobile providers database handled in libnm-gtk. Patch is based on top of the one for bug 688238.
Review of attachment 235243 [details] [review]: Please bump the libnm-gtk requirement in configure.ac. ::: panels/network/net-device-mobile.c @@ +271,3 @@ +static gchar * +device_mobile_find_provider (NetDeviceMobile *device_mobile, + const gchar *mccmnc, Line the arguments here. @@ +333,3 @@ + operator_name = device_mobile_find_provider (device_mobile, + modem_3gpp ? mm_modem_3gpp_get_operator_code (modem_3gpp) : NULL, + modem_cdma ? mm_modem_cdma_get_sid (modem_cdma) : 0); This is pretty horrible, use temporary variables. @@ +360,3 @@ + panel_set_device_widget_details (device_mobile->priv->builder, + "provider", + str ? str : (gsm ? gsm : (cdma ? cdma : NULL))); I can't really parse that. @@ +567,3 @@ + /* If none give, try to guess it */ + if (!operator_name || !operator_name[0]) { if (operator_name == NULL || *operator_name == '\0')
(In reply to comment #6) > Review of attachment 235243 [details] [review]: > > Please bump the libnm-gtk requirement in configure.ac. > Not really needed to bump, the one specified in git master should already contain the MobileProvidersDatabase thing.
Created attachment 235771 [details] [review] Updated patch
Review of attachment 235771 [details] [review]: Looks good.
(In reply to comment #7) > (In reply to comment #6) > > Review of attachment 235243 [details] [review] [details]: > > > > Please bump the libnm-gtk requirement in configure.ac. > > > > Not really needed to bump, the one specified in git master should already > contain the MobileProvidersDatabase thing. I was wrong, as the min required version was reduced for the GNOME 3.7.5 release. As danw suggested, I'll revert this one first: network: Allow compiling against NM 0.9.6 NM 0.9.7 has still not been released, even as a tarball, so allow compiling against 0.9.6 (without certain bits of new functionality). https://bugzilla.gnome.org/show_bug.cgi?id=691721
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.