summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPerttu Pohjonen <perttu.pohjonen@nokia.com>2010-11-15 07:49:32 (GMT)
committerPerttu Pohjonen <perttu.pohjonen@nokia.com>2010-11-15 07:49:32 (GMT)
commit113a23a61b3ac840cfdec2d2297b7881f495c924 (patch)
tree329c1f809d2c83a1b0dcf251c919b7febff30172 /src/plugins
parent96a3848f8f460a39d5bad1e5c78e61857645c28f (diff)
downloadQt-113a23a61b3ac840cfdec2d2297b7881f495c924.zip
Qt-113a23a61b3ac840cfdec2d2297b7881f495c924.tar.gz
Qt-113a23a61b3ac840cfdec2d2297b7881f495c924.tar.bz2
Fix for E32User-CBASE 46 Panic when using CActiveSchedulerWait
Fixing the initial problem of this error opened up a possibility to start a new WLAN scan while there was one still ongoing. This caused a crash. Task-number: QT-3996
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp41
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h6
2 files changed, 33 insertions, 14 deletions
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index b4dfc4d..33fa508 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 occurred.
+ // By default, start relistening notifications. Stop only if interesting event occured.
iWaitingCommsDatabaseNotifications = true;
RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
switch (event) {
@@ -1356,27 +1361,39 @@ 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);
+ 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);
+ }
+
+ if (!IsActive()) {
+ SetActive();
+ }
} else {
- iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus);
+ // Queue scan for getting WLAN info after first request returns
+ if (iOwner.iFirstUpdate) {
+ iOwner.iScanInQueue = ETrue;
+ }
}
-
- if (!IsActive())
- SetActive();
}
void AccessPointsAvailabilityScanner::RunL()
{
QMutexLocker locker(&iOwner.mutex);
+ iScanActive = EFalse;
if (iStatus.Int() != KErrNone) {
iIapBuf().iCount = 0;
QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(false,iIapBuf()));
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 7c1076e..337d4d1 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -207,6 +207,7 @@ private: // Data
TBool iInitOk;
TBool iUpdateGoingOn;
TBool iUpdatePending;
+ TBool iScanInQueue;
AccessPointsAvailabilityScanner* ipAccessPointsAvailabilityScanner;
@@ -234,9 +235,10 @@ protected: // From CActive
void DoCancel();
private: // Data
- SymbianEngine& iOwner;
+ SymbianEngine& iOwner;
RConnectionMonitor& iConnectionMonitor;
- TConnMonIapInfoBuf iIapBuf;
+ TConnMonIapInfoBuf iIapBuf;
+ TBool iScanActive;
};
QT_END_NAMESPACE