equal
deleted
inserted
replaced
24 #include <utf.h> |
24 #include <utf.h> |
25 #include <stringresourcereader.h> |
25 #include <stringresourcereader.h> |
26 #include <barsread.h> |
26 #include <barsread.h> |
27 #include <NSmlDSProvisioningAdapter.rsg> |
27 #include <NSmlDSProvisioningAdapter.rsg> |
28 #include <bautils.h> |
28 #include <bautils.h> |
29 #include <ApUtils.h> |
|
30 #include <barsc.h> |
29 #include <barsc.h> |
|
30 #include <cmconnectionmethoddef.h> |
|
31 #include <cmmanagerext.h> |
31 #include <centralrepository.h> //For central Repository |
32 #include <centralrepository.h> //For central Repository |
32 #include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys |
33 #include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys |
33 |
|
34 #include <nsmlconstants.h> |
34 #include <nsmlconstants.h> |
35 #include <nsmldebug.h> |
35 #include <nsmldebug.h> |
36 #include <nsmldsconstants.h> |
36 #include <nsmldsconstants.h> |
37 #include <CWPCharacteristic.h> |
37 #include <CWPCharacteristic.h> |
38 #include <CWPParameter.h> |
38 #include <CWPParameter.h> |
265 |
265 |
266 else |
266 else |
267 { |
267 { |
268 uid.Copy(iProfiles[aItem]->iVisitParameter->Data() ); |
268 uid.Copy(iProfiles[aItem]->iVisitParameter->Data() ); |
269 |
269 |
270 CCommsDatabase* commDb = CCommsDatabase::NewL(); |
270 RCmManagerExt cmmanagerExt; |
271 CleanupStack::PushL(commDb); |
271 cmmanagerExt.OpenL(); |
272 CApUtils* aputils = CApUtils::NewLC( *commDb); |
272 CleanupClosePushL(cmmanagerExt); |
273 |
273 RCmConnectionMethodExt cm; |
274 TRAP( ERROR, apId = aputils->IapIdFromWapIdL( uid() ) ); |
274 cm = cmmanagerExt.ConnectionMethodL( uid()); |
275 CleanupStack::PopAndDestroy(2); //commdb, aputils |
275 CleanupClosePushL( cm ); |
|
276 |
|
277 TRAP( ERROR, apId = cm.GetIntAttributeL(CMManager::ECmIapId) ); |
|
278 CleanupStack::PopAndDestroy(2); //cmmanager,cm |
276 } |
279 } |
277 |
280 |
278 //Get default access point in failure of getting AP |
281 //Get default access point in failure of getting AP |
279 if (ERROR != KErrNone || err1 != KErrNone) |
282 if (ERROR != KErrNone || err1 != KErrNone) |
280 { |
283 { |
293 if( iProfiles[aItem]->iHostAddress ) |
296 if( iProfiles[aItem]->iHostAddress ) |
294 { |
297 { |
295 // see if address contains also port |
298 // see if address contains also port |
296 TBool portFound = EFalse; |
299 TBool portFound = EFalse; |
297 TInt startPos(0); |
300 TInt startPos(0); |
298 TBool isHTTPS = EFalse; |
|
299 if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTP)==0) |
301 if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTP)==0) |
300 { |
302 { |
301 startPos=KNSmlDsProvisioningHTTP().Length(); |
303 startPos=KNSmlDsProvisioningHTTP().Length(); |
302 } |
304 } |
303 else if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTPS)==0) |
305 else if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTPS)==0) |
304 { |
306 { |
305 startPos=KNSmlDsProvisioningHTTPS().Length(); |
307 startPos=KNSmlDsProvisioningHTTPS().Length(); |
306 isHTTPS = ETrue; |
|
307 } |
308 } |
308 TPtrC uriPtr = iProfiles[aItem]->iHostAddress->Mid(startPos); |
309 TPtrC uriPtr = iProfiles[aItem]->iHostAddress->Mid(startPos); |
309 |
310 |
310 if(uriPtr.Locate(KNSmlDMColon)!=KErrNotFound) |
311 if(uriPtr.Locate(KNSmlDMColon)!=KErrNotFound) |
311 { |
312 { |
332 } |
333 } |
333 CleanupStack::PopAndDestroy(); // uri |
334 CleanupStack::PopAndDestroy(); // uri |
334 } |
335 } |
335 else |
336 else |
336 { |
337 { |
337 TBuf<16> portNum; |
|
338 if (isHTTPS) |
|
339 { |
|
340 portNum.Copy(KNSmlDsHTTPSDefaultPort()); |
|
341 } |
|
342 else |
|
343 { |
|
344 portNum.Copy(KNSmlDsDefaultPort()); |
|
345 } |
|
346 // use default port |
338 // use default port |
347 if( CombineURILC( iProfiles[aItem]->iHostAddress->Des(), |
339 if( CombineURILC( iProfiles[aItem]->iHostAddress->Des(), |
348 portNum, uri ) == KErrNone ) |
340 KNSmlDsDefaultPort(), uri ) == KErrNone ) |
349 { |
341 { |
350 if(iProfiles[aItem]->iHostAddress) |
342 if(iProfiles[aItem]->iHostAddress) |
351 { |
343 { |
352 delete iProfiles[aItem]->iHostAddress; |
344 delete iProfiles[aItem]->iHostAddress; |
353 iProfiles[aItem]->iHostAddress = NULL; |
345 iProfiles[aItem]->iHostAddress = NULL; |