diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-09-18 17:50:36 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-09-19 12:46:31 +0300 |
commit | 6b1c6cb2f84f5824d765da1d7a54ea81eb0389f8 (patch) | |
tree | e97aad11b960332215ee854a00c33b52794f0dc1 /src/qconnectivity | |
parent | 2671db076e6b27f4267c488a50aef24285738a61 (diff) |
Fix timing issues in wifi library
There is a timing issue on a device startup if the
default application calls Wifi.Interface.wifiSupported()
before qconnectivity service has finished initialize wifi
firmware/driver. This results in wifiSupported() returing
false on nexus 2013, even if this device supports wifi.
The solution is to move firmware/driver initialization
to Qt Wifi library.
Change-Id: If5b4650181f8b7237bd19f3fc3afbd2c75f759e8
Task-number: QTEE-770
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'src/qconnectivity')
-rw-r--r-- | src/qconnectivity/main.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/qconnectivity/main.cpp b/src/qconnectivity/main.cpp index 97f9582..e9ded93 100644 --- a/src/qconnectivity/main.cpp +++ b/src/qconnectivity/main.cpp @@ -163,7 +163,7 @@ QConnectivityDaemon::QConnectivityDaemon() m_linkUp(false), m_leaseTimer(0), m_isEmulator(isEmulator()), - m_attemptCount(12) + m_attemptCount(50) { qDebug() << "starting QConnectivityDaemon..."; if (!m_isEmulator) { @@ -213,9 +213,9 @@ void QConnectivityDaemon::initNetdConnection() connect(m_netdSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(handleError(QLocalSocket::LocalSocketError))); } else { - qWarning() << "QConnectivityDaemon: failed to connect to netd socket"; + qWarning() << "QConnectivityDaemon: failed to connect to netd socket, reattempting..."; if (--m_attemptCount != 0) - QTimer::singleShot(2000, this, SLOT(initNetdConnection())); + QTimer::singleShot(200, this, SLOT(initNetdConnection())); return; } if (ethernetSupported()) { @@ -224,11 +224,6 @@ void QConnectivityDaemon::initNetdConnection() sendCommand(QByteArray("0 interface setcfg ").append(m_ethInterface).append(" down").constData()); sendCommand(QByteArray("0 interface setcfg ").append(m_ethInterface).append(" up").constData()); } - char wifiInterface[PROPERTY_VALUE_MAX]; - property_get("wifi.interface", wifiInterface, NULL); - if (wifiInterface) - // reload wifi firmware - sendCommand(QByteArray("0 softap fwreload ").append(wifiInterface).append(" STA").constData()); // disable firewall - this setting seems to be enabled only when using "Always-on VPN" // mode on Android phones, see setLockdownTracker() in ConnectivityService.java sendCommand("0 firewall disable"); @@ -271,10 +266,8 @@ void QConnectivityDaemon::sendCommand(const char *command) const void QConnectivityDaemon::handleInterfaceChange(const QList<QByteArray> &message) { // Format: "Code Iface linkstate <name> <up/down>" - if (message.size() < 5) { - qWarning() << "QConnectivityDaemon: broken command"; + if (message.size() < 5) return; - } if (message.at(2) == "linkstate" && message.at(3) == m_ethInterface) { if (message.at(4) == "up") { |