diff options
Diffstat (limited to 'src/plugins/bearer/symbian/symbianengine.cpp')
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index f759a959a4..f025d865f4 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -135,10 +135,9 @@ void SymbianEngine::initialize() updateConfigurations(); updateStatesToSnaps(); - updateAvailableAccessPoints(); // On first time updates synchronously (without WLAN scans) + updateAvailableAccessPoints(); // On first time updates (without WLAN scans) // Start monitoring IAP and/or SNAP changes in Symbian CommsDB startCommsDatabaseNotifications(); - iFirstUpdate = false; } SymbianEngine::~SymbianEngine() @@ -790,6 +789,12 @@ void SymbianEngine::accessPointScanningReady(TBool scanSuccessful, TConnMonIapIn mutex.unlock(); emit updateCompleted(); mutex.lock(); + } else { + iFirstUpdate = false; + if (iScanInQueue) { + iScanInQueue = EFalse; + updateAvailableAccessPoints(); + } } } @@ -976,7 +981,7 @@ void SymbianEngine::RunL() QMutexLocker locker(&mutex); if (iStatus != KErrCancel) { - // By default, start relistening notifications. Stop only if interesting event occured. + // By default, start relistening notifications. Stop only if interesting event occurred. iWaitingCommsDatabaseNotifications = true; RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int()); switch (event) { @@ -1356,24 +1361,31 @@ AccessPointsAvailabilityScanner::~AccessPointsAvailabilityScanner() void AccessPointsAvailabilityScanner::DoCancel() { iConnectionMonitor.CancelAsyncRequest(EConnMonGetPckgAttribute); + iScanActive = EFalse; + iOwner.iScanInQueue = EFalse; } void AccessPointsAvailabilityScanner::StartScanning() { - if (iOwner.iFirstUpdate) { - // On first update (the mgr is being instantiated) update only those bearers who - // don't need time-consuming scans (WLAN). - // Note: EBearerIdWCDMA covers also GPRS bearer - iConnectionMonitor.GetPckgAttribute(EBearerIdWCDMA, 0, KIapAvailability, iIapBuf, iStatus); - User::WaitForRequest(iStatus); - if (iStatus.Int() == KErrNone) { - iOwner.accessPointScanningReady(true,iIapBuf()); + if (!iScanActive) { + iScanActive = ETrue; + if (iOwner.iFirstUpdate) { + // On first update (the mgr is being instantiated) update only those bearers who + // don't need time-consuming scans (WLAN). + // Note: EBearerIdWCDMA covers also GPRS bearer + iConnectionMonitor.GetPckgAttribute(EBearerIdWCDMA, 0, KIapAvailability, iIapBuf, iStatus); + } else { + iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus); } - } else { - iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus); + if (!IsActive()) { SetActive(); } + } else { + // Queue scan for getting WLAN info after first request returns + if (iOwner.iFirstUpdate) { + iOwner.iScanInQueue = ETrue; + } } } @@ -1381,6 +1393,7 @@ void AccessPointsAvailabilityScanner::RunL() { QMutexLocker locker(&iOwner.mutex); + iScanActive = EFalse; if (iStatus.Int() != KErrNone) { iIapBuf().iCount = 0; QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(false,iIapBuf())); |