Skip to content

Commit

Permalink
Revert "[connectionagent] fix connecting after flight mode."
Browse files Browse the repository at this point in the history
This reverts commit 80d9292.
  • Loading branch information
Lorn Potter committed Oct 21, 2013
1 parent 80d9292 commit 1c8e1da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 11 additions & 9 deletions connd/qconnectionmanager.cpp
Expand Up @@ -62,7 +62,7 @@ QConnectionManager::QConnectionManager(QObject *parent) :
handoverInProgress(0),
oContext(0),
tetheringWifiTech(0),
tetheringEnabled(false)
tetheringEnabled(0)
{
qDebug() << Q_FUNC_INFO;
connect(netman,SIGNAL(availabilityChanged(bool)),this,SLOT(connmanAvailabilityChanged(bool)));
Expand Down Expand Up @@ -235,6 +235,7 @@ void QConnectionManager::serviceStateChanged(const QString &state)
if (serviceInProgress == service->path())
serviceInProgress.clear();

previousConnectedService = service->path();
if (service->type() == "ethernet") { //keep this alive
NetworkTechnology tech;
tech.setPath(netman->technologyPathForService(service->path()));
Expand Down Expand Up @@ -465,18 +466,20 @@ QString QConnectionManager::findBestConnectableService()
QString path = orderedServicesList.at(i);

NetworkService *service = servicesMap.value(path);
qDebug() << "looking at" << service->name() << service->autoConnect();

bool online = isStateOnline(netman->defaultRoute()->state());
qDebug() << "looking at" << service->name() << service->autoConnect() << online;

if (online && netman->defaultRoute()->path() == service->path()) {
qDebug() << "best already connected";
if (online && netman->defaultRoute()->path() == service->path())
return QString();//best already connected
}

if (!service->autoConnect()) {
continue;
}
qDebug() << previousConnectedService << service->path();

if (!online && previousConnectedService == service->path()) {
continue;
}

qDebug() <<Q_FUNC_INFO<< "continued"
<< online
Expand All @@ -491,7 +494,7 @@ QString QConnectionManager::findBestConnectableService()
if (isBestService(service->path())
&& service->favorite()
&& !isCellRoaming) {
qDebug() <<"best connectable is"<< path;
qDebug() << path;
return path;
}
}
Expand Down Expand Up @@ -584,6 +587,7 @@ void QConnectionManager::setup()
updateServicesMap();

if (isStateOnline(netman->state())) {
previousConnectedService = netman->defaultRoute()->path();

if (netman->defaultRoute()->type() == "ethernet")
isEthernet = true;
Expand All @@ -606,14 +610,12 @@ void QConnectionManager::setup()
void QConnectionManager::technologyPowerChanged(bool b)
{
NetworkTechnology *tech = static_cast<NetworkTechnology *>(sender());
qDebug() << tech->type();
if (b && (tech->type() == "wifi" || tech->type() == "cellular"))
tech->scan();
}

void QConnectionManager::techChanged()
{
qDebug() << Q_FUNC_INFO;
Q_FOREACH(const NetworkTechnology *technology,netman->getTechnologies()) {
connect(technology,SIGNAL(poweredChanged(bool)),this,SLOT(technologyPowerChanged(bool)));
}
Expand Down
1 change: 1 addition & 0 deletions connd/qconnectionmanager.h
Expand Up @@ -96,6 +96,7 @@ public Q_SLOTS:
bool isEthernet;
bool connmanAvailable;
bool handoverInProgress;
QString previousConnectedService;
bool manualConnected;
QString serviceInProgress;
QString autoConnectService;
Expand Down

0 comments on commit 1c8e1da

Please sign in to comment.