Ok, so indeed two issues:
1) Applications unable to retrieve network status of ofono based modems:
That's because the only way to retrieve that information, currently, is indeed 
via ofono:
src/systeminfo/linux/qnetworkinfo_linux.cpp:
===
...
    case QNetworkInfo::GsmMode:                                                 
                                                        
    case QNetworkInfo::CdmaMode:                                                
                                                        
    case QNetworkInfo::WcdmaMode:                                               
                                                        
    case QNetworkInfo::LteMode:
    case QNetworkInfo::TdscdmaMode:                                             
                                                        
#if !defined(QT_NO_OFONO)
        qDebug() << "getting network status for modem";                         
                                                        
        if (QOfonoWrapper::isOfonoAvailable()) {
            if (!ofonoWrapper)
                ofonoWrapper = new QOfonoWrapper(this);                         
                                                        
            QStringList modems = ofonoWrapper->allModems();                     
                                                        
            if (interface < modems.size()) {
                QString modem = ofonoWrapper->allModems().at(interface);        
                                                        
                if (!modem.isEmpty())
                    return ofonoWrapper->networkStatus(modem);                  
                                                        
            }       
    }       
#endif                                                                          
                                                        
        break;   
===

Status, following the oFono doc:
        string Status [readonly]

            The current registration status of a modem.

            The possible values are:
                "unregistered"  Not registered to any network
                "registered"    Registered to home network
                "searching"     Not registered, but searching
                "denied"        Registration has been denied
                "unknown"       Status is unknown
                "roaming"       Registered, but roaming

Which is what we want indeed.

Now before we go and implement another method to provide the information
we need, why do you think GetProperties reveals too much information for
the apps?

2) The issue with Mako, when ofono is disabled, is that it returns 
NoNetworkAvailable for wlan because mako's driver fails to report the proper 
signal via /proc/net/wireless. As a quick workaround (due the broken drivers), 
I'd suggest trusting only on
/sys/class/net/wlan0/carrier instead.

Follows the patch:
diff --git a/src/systeminfo/linux/qnetworkinfo_linux.cpp 
b/src/systeminfo/linux/qnetworkinfo_linux.cpp
index effdc93..03649c1 100644
--- a/src/systeminfo/linux/qnetworkinfo_linux.cpp
+++ b/src/systeminfo/linux/qnetworkinfo_linux.cpp
@@ -869,8 +869,7 @@ QNetworkInfo::NetworkStatus 
QNetworkInfoPrivate::getNetworkStatus(QNetworkInfo::
             if (carrier.open(QIODevice::ReadOnly)) {
                 char state;
                 if ((carrier.read(&state, 1) == 1) &&
-                        (state == '1') &&
-                        (networkSignalStrength(QNetworkInfo::WlanMode, 
interface) > -1)) {
+                        (state == '1')) {
                     return QNetworkInfo::HomeNetwork;
                 }
             }

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1226844

Title:
  QtSystemInfo fails when using ofono and there are DBus denials to
  ofono

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtsystems-opensource-src/+bug/1226844/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to