diff -r aaabc7526ded -r a9524956f6b5 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -31,6 +31,10 @@ #include #include +// CONSTANTS +const TInt KRetryCount = 20; +const TInt KRetryTimeout = 100000; + using namespace CMManager; // ============================ MEMBER FUNCTIONS =============================== @@ -276,12 +280,31 @@ eaps->SetL( enabledEapList ); } } - // now update the access point - iWLANRecord->ModifyL( *dbSession ); + + // Update access point, be prepared that Commsdat might be locked + TInt errCode( KErrLocked ); + TInt retryCount( 0 ); + + while( errCode == KErrLocked && retryCount < KRetryCount ) + { + TRAP( errCode, iWLANRecord->ModifyL( *dbSession ) ); + + if ( errCode == KErrLocked ) + { + User::After( KRetryTimeout ); + } + retryCount++; + } + + if ( errCode ) + { + // override previous ret value only when error happened + ret = errCode; + } CleanupStack::PopAndDestroy( dbSession ); DEBUG("CHssIapHandler::ChangeSettingsL DONE"); - return ret; + return ret; } // ----------------------------------------------------------------------------- @@ -557,8 +580,11 @@ { DEBUG("CHssIapSettingsHandler::GetClientsIapsL"); TBuf<32> buffer; // Temporary buffer for found UID from destination. - TUidName uidClient = aUId.Name(); // UID of the client. TUint32 iapId = 0; // IAP Identifiier. + TBuf uidClient; // UID of the client. + + uidClient.Copy( aUId.Name() ); + ModifyClientUid( uidClient ); RArray destArray = RArray( 10 ); // KCmArrayGranularity instead of 10 CleanupClosePushL( destArray ); @@ -610,4 +636,23 @@ CleanupStack::PopAndDestroy( &destArray ); } +// ----------------------------------------------------------------------------- +// ModifyClientUid +// ----------------------------------------------------------------------------- +// +void CHssIapHandler::ModifyClientUid( TDes& aUid ) + { + DEBUG("CHssIapHandler::ModifyClientUid"); + TInt indx = aUid.Find( KMark1 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + indx = aUid.Find( KMark2 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + } + } + } + // End of File