diff -r 2c8580950a26 -r 5d0ec111abfc syncmlfw/ds/syncagent/src/nsmldsagent.cpp --- a/syncmlfw/ds/syncagent/src/nsmldsagent.cpp Fri May 14 16:42:50 2010 +0300 +++ b/syncmlfw/ds/syncagent/src/nsmldsagent.cpp Thu May 27 13:43:36 2010 +0300 @@ -22,6 +22,9 @@ #include #include #include +#include +#include +#include // common includes with DM #include "nsmlagenttestdefines.h" @@ -1888,23 +1891,39 @@ profileUtil->AccessPointIdL(LastUsedIAPId); if(LastUsedIAPId > 0) { - //Check Whether the IAPID still exists - TApBearerType bearertype = CheckAPBearerTypeL(LastUsedIAPId); - if(bearertype != TApBearerType(-1)) - { - iIAPId = LastUsedIAPId; - DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:")); - } - else - { - //Stop the DS Sync Session - DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid so stopping the session")); - iPacketDataUnAvailable = ETrue; - StopDSSession(); - } + //Check Whether the IAPID still exists + RCmManager cmmanager; + cmmanager.OpenL(); + CleanupClosePushL(cmmanager); + RCmConnectionMethod cm; + TRAPD(err, cm = cmmanager.ConnectionMethodL( LastUsedIAPId )); + CleanupClosePushL( cm ); + TUint32 bearer = 0; + if( err == KErrNone ) + { + bearer = cm.GetIntAttributeL( CMManager::ECmBearerType ); + DBG_FILE_CODE( bearer ,_S8("CNSmlDSAgent::ReadSettingsL, BearerType")); + if ( bearer == KUidWlanBearerType ) + { + DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid WLAN")); + iPacketDataUnAvailable = ETrue; + StopDSSession(); + } + else + { + iIAPId = LastUsedIAPId; + DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:")); + } + } + else + { + DBG_FILE_CODE( err ,_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid")); + iPacketDataUnAvailable = ETrue; + StopDSSession(); + } + CleanupStack::PopAndDestroy( 2 ); //cmmanagerext,cm } - } - + } CleanupStack::PopAndDestroy(profileUtil); } }