# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268649731 -7200 # Node ID 68f0c7cd80ec27732cb57979c113a17579d42e44 # Parent ea6e024ea6f9610c2cee55a3d30118dc36d0f65d Revision: 201009 Kit: 201010 diff -r ea6e024ea6f9 -r 68f0c7cd80ec apengine/apeng/src/APSelect.cpp --- a/apengine/apeng/src/APSelect.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/apengine/apeng/src/APSelect.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -70,7 +70,7 @@ // LOCAL CONSTANTS AND MACROS - +#define VPN_SERVICE_SNAP _S("HomeSNAP") // LOCAL FUNCTION PROTOTYPES @@ -856,9 +856,39 @@ CApUtils* util = CApUtils::NewLC( *iDb ); for ( i = 0; i < count; i++ ) { - // get home wap id first - pos = PosInArray( ipiapid, - vpnArray->At( i ).iHomeIapId ); + if ( vpnArray->At( i ).iHomeIapId != 0 ) + { + // get home wap id first + pos = PosInArray( ipiapid, + vpnArray->At( i ).iHomeIapId ); + + } + else if ( vpnArray->At( i ).iHomeSnapId != 0 ) + { + // VPN IAP points to a SNAP. Just mark it available. + pos = PosInArray( iapArrays[KVPN][1], vpnArray->At( i ).iVpnIapId ); + if ( pos != KErrNotFound ) + { // now get VPN IAP ID + TUint32 tempvpniapid = iapArrays[KVPN][0]->At( pos ); + TUint32 tempvpnwapid ( 0 ); + TRAP( err, tempvpnwapid = + util->WapIdFromIapIdL( + tempvpniapid ) ); + + item = CApListItem::NewLC + ( + EIspTypeInternetAndWAP, + tempvpnwapid, + *vpnArray->At( i ).iName, + EApBearerTypeAllBearers + ); + item->SetVpnFlag( ETrue ); + iApList->AppendL( item ); + CleanupStack::Pop( item ); + continue; + } + } + TInt foundpos( KErrNotFound ); if ( pos!= KErrNotFound ) { // now we have the index in the @@ -2216,7 +2246,8 @@ if ( err != KErrNotFound ) { TUint32 tempvpn( 0 ); - TUint32 temphome( 0 ); + TUint32 temphomeiap( 0 ); + TUint32 temphomesnap( 0 ); HBufC* tempname = NULL; TVpnData data; TBool goon( ETrue ); @@ -2226,10 +2257,20 @@ tempvpn ); if ( ( err == KErrNone ) && ( tempvpn ) ) { + // First try to check if VPN IAP uses another IAP directly err = ApCommons::ReadUintL( aTable, - TPtrC(VPN_SERVICE_IAP), - temphome ); - if ( ( err == KErrNone ) && ( temphome ) ) + TPtrC(VPN_SERVICE_IAP), + temphomeiap ); + + if ( (err != KErrNone ) || ( !tempvpn ) ) + { + // IAP field was empty. VPN IAP must point to SNAP. + err = ApCommons::ReadUintL( aTable, + TPtrC(VPN_SERVICE_SNAP), + temphomesnap ); + } + + if ( ( err == KErrNone ) && ( temphomeiap || temphomesnap ) ) { // now get the name @@ -2238,7 +2279,16 @@ TPtrC(COMMDB_NAME) ); // everything is O.K., we can add the item - data.iHomeIapId = temphome; + if ( temphomesnap ) + { + data.iHomeSnapId = temphomesnap; + data.iHomeIapId = 0; + } + else + { + data.iHomeSnapId = 0; + data.iHomeIapId = temphomeiap; + } data.iVpnIapId = tempvpn; data.iName = tempname; aVpnArray->AppendL( data ); // array owns it... diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/inc/s60mcpractivities.h --- a/bearermanagement/S60MCPR/inc/s60mcpractivities.h Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mcpractivities.h Mon Mar 15 12:42:11 2010 +0200 @@ -611,6 +611,21 @@ DECLARE_SMELEMENT_FOOTER( TNoTagOrInformMigrationAvailableBackwardsOrErrorOrCancel ) /** + * FORK/DECISION: + * 1. Inform that the migration complete or go to error + * 2. Error + * @return + */ + DECLARE_SMELEMENT_HEADER( TInformMigrationCompletedOrError, + MeshMachine::TStateFork, + NetStateMachine::MStateFork, + TContext ) + virtual TInt TransitionTag(); + DECLARE_SMELEMENT_FOOTER( TInformMigrationCompletedOrError ) + + + + /** * Class that is responsible for managing mobility on MCPR side. * CS60MobilityActivity is the S60 version of the CMobilityActivity -class */ @@ -789,6 +804,21 @@ DECLARE_SMELEMENT_FOOTER( TNoTagOrApplicationRejectedMigrationOrCancel ) /** + * FORK/DECISION: + * 1. Proceed to reconnection + * 2. Re-establish connection to the same IAP, inform data client that migration is complete + * 3. Error + * @return + */ + DECLARE_SMELEMENT_HEADER( TNoTagOrRequestReConnectToCurrentSPOrErrorTag, + MeshMachine::TStateFork, + NetStateMachine::MStateFork, + TContext ) + virtual TInt TransitionTag(); + DECLARE_SMELEMENT_FOOTER( TNoTagOrRequestReConnectToCurrentSPOrErrorTag ) + + + /** * Mutex protected TRANSITION. * Mopility scenario should wait until the connection recovery finishes. */ diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/inc/s60mcprstates.h --- a/bearermanagement/S60MCPR/inc/s60mcprstates.h Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mcprstates.h Mon Mar 15 12:42:11 2010 +0200 @@ -56,6 +56,9 @@ const TInt KInformMigrationAvailable = 11052; const TInt KSendInitialApplicationReject = 11053; const TInt KConsumeRejectedMsg = 11054; + const TInt KInformMigrationCompleted = 11055; + const TInt KRequestReConnectToCurrentSP = 11056; + /** * Execution context */ @@ -105,6 +108,17 @@ DECLARE_SMELEMENT_FOOTER( TRequestReConnect ) /** + * TRANSITION/ACTION: Starts ReConnect -activity to current service provider + */ + DECLARE_SMELEMENT_HEADER( TRequestReConnectToCurrentSP, + MeshMachine::TStateTransition, + NetStateMachine::MStateTransition, + TContext ) + virtual void DoL(); + DECLARE_SMELEMENT_FOOTER( TRequestReConnectToCurrentSP ) + + + /** * TRANSITION/ACTION: Requests Policy Server to process the error. * The error is taken from the error context or activity error in that order. */ diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/inc/s60mpmrequests.h --- a/bearermanagement/S60MCPR/inc/s60mpmrequests.h Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mpmrequests.h Mon Mar 15 12:42:11 2010 +0200 @@ -38,6 +38,12 @@ // Forward declaration class CMPMPolicyNotifications; +// Initial reconnect timeout is 100 000 microseconds (0.1 sec), +// which is doubled upon issuing the first timer request +const TInt KMPMReconnectTimeoutMultiplier = 2; +const TInt KMPMInitialReconnectTimeout = 100000 / KMPMReconnectTimeoutMultiplier; +const TInt KMPMMaxReconnectTimeout = 800000; + /** * S60 NetMCPR MPM interface management Class inherits from CActive */ @@ -257,7 +263,7 @@ * @since 5.2 */ void IssueDeleteRequest(); - + private: // policy request list RArray iPolicyRequests; @@ -269,6 +275,11 @@ TBool iCommitedToDeleteItself; CMPMPolicyNotifications* iPolicyNotifications; MMPMPolicyNotificationUser* iPolicyNotificationsUser; + + // Reconnect timer related variables + RTimer iReconnectTimer; + TBool iReconnectTimerRunning; + TInt iReconnectTimeout; }; #endif // S60MPMREQUESTS_H diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/src/s60mcpr.cpp --- a/bearermanagement/S60MCPR/src/s60mcpr.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcpr.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -300,31 +300,21 @@ //HandlePreferredIAPAvailable( const_cast( notification ) ); - // Check if the TPrefIAPNotifInfo contains new or old IAP. - // - if ( ServiceProvider() && - ((RMetaServiceProviderInterface*)ServiceProvider())->ProviderInfo().APId() != notification.iNewIapId ) - { - S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable IAP %d",(TInt*)this,notification.iNewIapId); + S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable IAP %d",(TInt*)this,notification.iNewIapId); + - // Store PolicyNotification - // This could happen if PolicyServer sends notification too early. - // - StorePolicyNotification( aNotification ); - - // Send preferred carrier message into meshmachine. - // - RNodeInterface ni; - ni.OpenPostMessageClose( NodeId(), - NodeId(), - TCFS60MCPRMessage::TMPMPreferredCarrierAvailableMsg( (TAny*)¬ification ).CRef() ); - } -#ifdef _DEBUG - else - { - S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable SAME IAP %d",(TInt*)this,notification.iNewIapId ); - } -#endif + // Store PolicyNotification + // This could happen if PolicyServer sends notification too early. + // + StorePolicyNotification( aNotification ); + + // Send preferred carrier message into meshmachine. + // + RNodeInterface ni; + ni.OpenPostMessageClose( NodeId(), + NodeId(), + TCFS60MCPRMessage::TMPMPreferredCarrierAvailableMsg( (TAny*)¬ification ).CRef() ); + break; } case EMPMMobilityErrorNotification: diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/src/s60mcpractivities.cpp --- a/bearermanagement/S60MCPR/src/s60mcpractivities.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcpractivities.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -289,34 +289,31 @@ S60MCprMobilityActivity::TDoNothingOrReSendPendingNotification, CS60MobilityActivity::TAwaitingPreferredCarrierOrStartIAPNotificationOrErrorNotificationOrCancel, // Ok. Error is fatal S60MCprMobilityActivity::TNoTagOrInformMigrationAvailableBackwardsOrErrorOrCancel ) + // Select the next layer MCPR. NODEACTIVITY_ENTRY( KNoTag, MCprStates::TSelectNextLayer, MCprStates::TAwaitingSelectNextLayerCompleted, // Ok. Error is fatal. - MeshMachine::TNoTagOrErrorTag ) - //S60MCprStates::TAwaitingSelectNextLayerCompletedOrError, // Not required Error is fatal. MPM should only give valid IAPs. - //MeshMachine::TNoTagOrErrorTag )// Not required Error is fatal. MPM should only give valid IAPs. + CS60MobilityActivity::TNoTagOrRequestReConnectToCurrentSPOrErrorTag ) + // For the moment it is sufficient to use the re-connect activity, in the future we may want to // customise the behavior, for example start the new layer before rebinding it, etc. NODEACTIVITY_ENTRY( KNoTag, S60MCprStates::TRequestReConnect, MCprStates::TAwaitingReConnectCompleteOrError, // Ok. Error is fatal. - MeshMachine::TNoTagOrErrorTag ) //Own error handling MPM must be informed when error happens. - // Select or activation failed, Ask MPM to decide if it it possible/sensible to ignore the error and continue. - // EDoReselect return will fall into EIgnoreError branch. MPM shouldn't return Reselect in this case. - // And if it does, then the use of startiapnotification in mobility scenarios should be - // removed and only reselect should be used. - /* Not required. PolicyServer should only give valid IAPs. - NODEACTIVITY_ENTRY( KErrorTag, - S60MCprStates::TProcessError, - S60MCprStates::TAwaitingProcessErrorCompleteOrError, - S60MCprMobilityActivity::TWaitPolicyServerResponseBackwardOrErrorTag ) - */ + S60MCprMobilityActivity::TInformMigrationCompletedOrError ) //Own error handling MPM must be informed when error happens. + + NODEACTIVITY_ENTRY( S60MCprStates::KRequestReConnectToCurrentSP, + S60MCprStates::TRequestReConnectToCurrentSP, + MCprStates::TAwaitingReConnectCompleteOrError, + S60MCprMobilityActivity::TInformMigrationCompletedOrError ) + // If the migration was acepted we loop again waiting for a new, preferred one - NODEACTIVITY_ENTRY( KNoTag, + NODEACTIVITY_ENTRY( S60MCprStates::KInformMigrationCompleted, CS60MobilityActivity::TInformMigrationCompleted, S60MCprMobilityActivity::TAwaitingMigrationAcceptedOrRejectedOrStartupErrorIgnoredOrCancel, S60MCprMobilityActivity::TNoTagOrErrorTagOrApplicationRejectedOrConsumeRejected ) + // Informs policy server that application has accepted the carrier THROUGH_NODEACTIVITY_ENTRY( KNoTag, CS60MobilityActivity::TSendApplicationAccept, diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp --- a/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -194,12 +194,29 @@ { S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrInformMigrationAvailableBackwardsOrErrorOrCancel::TransitionTag() TMPMPreferredCarrierAvailableMsg",(TInt*)&iContext.Node()) return S60MCprStates::KInformMigrationAvailable | NetStateMachine::EBackward; - } + } // else cancel return KCancelTag | NetStateMachine::EForward; } - + // ----------------------------------------------------------------------------- + // S60MCprMobilityActivity::TInformMigrationCompletedOrError::TransitionTag + // ----------------------------------------------------------------------------- + // + DEFINE_SMELEMENT( TInformMigrationCompletedOrError, NetStateMachine::MStateFork, TContext ) + TBool TInformMigrationCompletedOrError::TransitionTag() + { + // Error notification falls into the error -case. + if ( iContext.iNodeActivity->Error() ) + { + return MeshMachine::KErrorTag | NetStateMachine::EForward; + } + else + { + return S60MCprStates::KInformMigrationCompleted; + } + } + // ----------------------------------------------------------------------------- // S60MCprMobilityActivity::TStartMobilityHandshakeBackwardsOrError::TransitionTag // ----------------------------------------------------------------------------- @@ -488,7 +505,7 @@ TClientType(TCFClientType::EData, TCFClientType::ELeaving)); iContext.iNodeActivity->PostRequestTo(*dc, TCFDataClient::TStop(iContext.iNodeActivity->Error()).CRef()); } - + // ----------------------------------------------------------------------------- // CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept // ----------------------------------------------------------------------------- @@ -666,29 +683,40 @@ return MeshMachine::KCancelTag | NetStateMachine::EForward; } -/* else - { - S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrErrorTagOrApplicationRejectedMigrationOrCancel::TransitionTag() Generating ApplicationIgnoredTheCarrier", (TInt*)&iContext.Node() ); - - // Need to put MPM in consistent state and continue. - CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node(); - CS60MobilityActivity& activity = static_cast(*iContext.iNodeActivity); - TRAP_IGNORE( node.Policy()->ApplicationIgnoredTheCarrierL( activity.iPreferredAPId ) ); - - if ( iContext.iNodeActivity->Error() == KErrNone ) - { - ASSERT(EFalse); // should not happend - iContext.iNodeActivity->SetError( KErrGeneral ); // doesn't have effect if already set. - return MeshMachine::KErrorTag | NetStateMachine::EForward; - } - - return MeshMachine::KErrorTag | NetStateMachine::EForward; - }*/ S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrApplicationRejectedMigrationOrCancel::TransitionTag() KErrorTag ESock_IP Panic",(TInt*)&iContext.Node()) ASSERT(EFalse); // error, IPCPR should not send TError in this case. return MeshMachine::KErrorTag | NetStateMachine::EForward; } + // ----------------------------------------------------------------------------- + // CS60MobilityActivity::TNoTagOrRequestReConnectToCurrentSPOrErrorTag::DoL + // ----------------------------------------------------------------------------- + // + DEFINE_SMELEMENT( CS60MobilityActivity::TNoTagOrRequestReConnectToCurrentSPOrErrorTag, + NetStateMachine::MStateFork, CS60MobilityActivity::TContext ) + TInt CS60MobilityActivity::TNoTagOrRequestReConnectToCurrentSPOrErrorTag::TransitionTag() + { + CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node(); + RMetaServiceProviderInterface* sp = (RMetaServiceProviderInterface*)node.ServiceProvider(); + + if ( iContext.iNodeActivity->Error() ) + { + S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrBearerPresentOrError::TransitionTag() KErrorTag",(TInt*)&iContext.Node()) + return MeshMachine::KErrorTag | NetStateMachine::EForward; + } + // Check whether we're bound to a provider for the given IAP ID already + else if (sp && sp->ProviderInfo().APId() == node.PolicyPrefs().IapId()) + { + // Restart the whole layer + S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrBearerPresentOrError::TransitionTag() Re-establishment",(TInt*)&iContext.Node()); + return S60MCprStates::KRequestReConnectToCurrentSP | NetStateMachine::EForward; + } + else + { + S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrBearerPresentOrError::TransitionTag() KNoTag",(TInt*)&iContext.Node()) + return MeshMachine::KNoTag | NetStateMachine::EForward; + } + } // ----------------------------------------------------------------------------- // CS60MobilityActivity::ClearHandshakingFlag diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/src/s60mcprstates.cpp --- a/bearermanagement/S60MCPR/src/s60mcprstates.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcprstates.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -180,7 +180,28 @@ startingSP->RecipientId()).CRef() ); } +// ----------------------------------------------------------------------------- +// TRequestReConnectToCurrentSP::DoL +// ----------------------------------------------------------------------------- +// +DEFINE_SMELEMENT( TRequestReConnectToCurrentSP, NetStateMachine::MStateTransition, TContext ) +void TRequestReConnectToCurrentSP::DoL() // codescanner::leave + { + __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity)); + S60MCPRLOGSTRING1("S60MCPR<%x>::TRequestReConnectToCurrentSP::DoL()",(TInt*)&iContext.Node()) + RNodeInterface* currentSP = iContext.Node().ServiceProvider(); + // There MUST be a service provider + __ASSERT_DEBUG( currentSP != NULL, User::Panic(KS60MCprPanic, KPanicNoServiceProvider)); + + // Diagnostic - there must be a data client or we cannot be here + __ASSERT_DEBUG(iContext.Node().GetFirstClient(TClientType(TCFClientType::EData)), + User::Panic(KS60MCprPanic, KPanicNoDataClient)); + + iContext.iNodeActivity->PostRequestTo( iContext.NodeId(), + TCFMcpr::TReConnect( currentSP->RecipientId(), + currentSP->RecipientId()).CRef() ); + } // ----------------------------------------------------------------------------- // TProcessError::DoL // ----------------------------------------------------------------------------- diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/S60MCPR/src/s60mpmrequests.cpp --- a/bearermanagement/S60MCPR/src/s60mpmrequests.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mpmrequests.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -86,7 +86,9 @@ // CMPMPolicyRequests::CMPMPolicyRequests() : CActive( EPriorityStandard ), - iCommitedToDeleteItself( EFalse ) + iCommitedToDeleteItself( EFalse ), + iReconnectTimerRunning( EFalse ), + iReconnectTimeout( KMPMInitialReconnectTimeout ) { S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::CMPMPolicyRequests()", this ) CActiveScheduler::Add( this ); @@ -129,6 +131,12 @@ S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::~CMPMPolicyRequests() closing MPM session", this ) iMpm.Close(); } + + if ( iReconnectTimerRunning ) + { + Cancel(); + iReconnectTimer.Close(); + } } // ----------------------------------------------------------------------------- @@ -458,8 +466,6 @@ // void CMPMPolicyRequests::IssueRequest() { - //__ASSERT_ALWAYS(IsActive() || iPolicyRequests.Count() > 0,User::Panic(KNetMCprPanic, KPanicInvalidCActiveUsage)); - // If we have a pending request, back off. // if ( IsActive() || iPolicyRequests.Count() == 0 ) @@ -621,10 +627,22 @@ { S60MCPRLOGSTRING2( "S60MCPR::CMPMPolicyRequests<%x>::RunL() iStatus %d", this, iStatus.Int() ) - // If there's a request waiting and is now completed - // - if ( iPolicyRequests.Count() > 0 && !iCommitedToDeleteItself) + // At first, check if this is a timer activity + if ( iReconnectTimerRunning ) { + // iMpm.Connect() failed at least once. Timeout has expired, try again. +#ifdef _DEBUG + TBool isConnected = iMpm.Connected(); + __ASSERT_DEBUG( !isConnected, User::Panic( KS60MCprPanic, KErrGeneral ) ); +#endif + iReconnectTimerRunning = EFalse; + iReconnectTimer.Close(); + iMpm.Connect( iStatus ); + SetActive(); + } + else if ( iPolicyRequests.Count() > 0 && !iCommitedToDeleteItself) + { + // there's a request waiting and is now completed S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::RunL() Standard processing", this ) PolicyRequest& policydata = iPolicyRequests[0]; // Process the response @@ -635,9 +653,9 @@ { if ( iStatus.Int() != KErrNone ) { - //-jl- MPM connection failed, set MPM connection required again. + // MPM connection failed, set MPM connection required again. iMpm.Close(); - //-jl- Go to RunError + // Go to RunError User::Leave( iStatus.Int() ); } else @@ -755,9 +773,16 @@ // void CMPMPolicyRequests::DoCancel() { - // Not allowed! Cancel() may cause deadlock! _LIT( KPanicMsg, "CMPMPolicyRequests::DoCancel" ); - User::Panic( KPanicMsg, KErrNotSupported ); + if ( iReconnectTimerRunning ) + { + iReconnectTimer.Cancel(); + } + else + { + // Not allowed! Cancel() may cause deadlock! + User::Panic( KPanicMsg, KErrNotSupported ); + } } @@ -769,20 +794,33 @@ { S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::RunError()", this ) // Connect has failed, cleanup and deliver errors - TInt count = iPolicyRequests.Count(); - for ( TInt i = 0; i < count; i++ ) + if ( aError != KErrServerBusy || iReconnectTimeout >= KMPMMaxReconnectTimeout ) { - if ( iPolicyRequests[i].iUser ) + TInt count = iPolicyRequests.Count(); + for ( TInt i = 0; i < count; i++ ) { - S60MCPRLOGSTRING2( "S60MCPR::CMPMPolicyRequests<%x>::RunError() Sending error %d in PolicyResponse", this, aError ) - iPolicyRequests[i].iStatus = aError; - iPolicyRequests[i].iUser->PolicyResponse( iPolicyRequests[i] ); + if ( iPolicyRequests[i].iUser ) + { + S60MCPRLOGSTRING2( "S60MCPR::CMPMPolicyRequests<%x>::RunError() Sending error %d in PolicyResponse", this, aError ) + iPolicyRequests[i].iStatus = aError; + iPolicyRequests[i].iUser->PolicyResponse( iPolicyRequests[i] ); + } + + // Delete prefs + iPolicyRequests[i].Cleanup(); } - - // Delete prefs - iPolicyRequests[i].Cleanup(); + iPolicyRequests.Reset(); } - iPolicyRequests.Reset(); + else + { + // KErrServerBusy received, try reconnecting after a brief pause + iReconnectTimeout *= KMPMReconnectTimeoutMultiplier; + TTimeIntervalMicroSeconds32 timeout( iReconnectTimeout ); + iReconnectTimer.CreateLocal(); + iReconnectTimer.After( iStatus, timeout ); + iReconnectTimerRunning = ETrue; + SetActive(); + } return KErrNone; } @@ -885,5 +923,4 @@ IssueRequest(); } - // End of file diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/mpm/inc/mpmlauncher.h --- a/bearermanagement/mpm/inc/mpmlauncher.h Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmlauncher.h Mon Mar 15 12:42:11 2010 +0200 @@ -26,6 +26,9 @@ // INCLUDES #include +// CONSTANTS +_LIT( KMPMLauncherSemaphore, "MPMLauncherSemaphore" ); + // CLASS DECLARATION /** * Mobility Policy Manager server laucher for client. diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/mpm/src/mpmiapselection.cpp --- a/bearermanagement/mpm/src/mpmiapselection.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/mpm/src/mpmiapselection.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -154,6 +154,17 @@ return; } } + + if ( iChooseIapPref.ConnSelectionDialog() ) + { + // Complete selection with error code if wlan only was set and bearer set as cellular + if ( wlanOnly && + iChooseIapPref.BearerSet() == TExtendedConnPref::EExtendedConnBearerCellular ) + { + ChooseIapComplete( KErrPermissionDenied, NULL ); + return; + } + } MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL:\ connection type %d", iChooseIapPref.ConnType() ) diff -r ea6e024ea6f9 -r 68f0c7cd80ec bearermanagement/mpm/src/mpmlauncher.cpp --- a/bearermanagement/mpm/src/mpmlauncher.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/bearermanagement/mpm/src/mpmlauncher.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -40,18 +40,26 @@ { MPMLOGSTRING("MPMLauncher::LaunchServer") const TUidType serverUid(KNullUid,aServerUid2,aServerUid3); + RSemaphore semaphore; + TInt err( KErrNone ); - // We just create a new server process. Simultaneous - // launching of two such processes should be detected when the second one - // attempts to create the server object, failing with KErrAlreadyExists. - // + err = semaphore.CreateGlobal( KMPMLauncherSemaphore, 0 ); + if ( err != KErrNone ) + { + // Creating semaphore failed, which means some other thread is + // creating the server right. Propagate error KErrServerBusy + // to inform the client it should try connecting again. + return KErrServerBusy; + } + MPMLOGSTRING("Create a new server process") RProcess server; TInt r=server.Create(aServerFileName,KNullDesC,serverUid); - + if ( r != KErrNone ) { MPMLOGSTRING2("Server process creation returned error: %d", r) + semaphore.Close(); return r; } TRequestStatus stat; @@ -70,6 +78,7 @@ // from KErrNone r = ( server.ExitType() == EExitPanic ) ? KErrGeneral : stat.Int(); server.Close(); + semaphore.Close(); return r; } diff -r ea6e024ea6f9 -r 68f0c7cd80ec cmmanager/cmmgr/Framework/Src/cmdesticondialog.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdesticondialog.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/cmmanager/cmmgr/Framework/Src/cmdesticondialog.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -166,7 +166,13 @@ keyEvent.iScanCode = aKeyEvent.iScanCode; keyEvent.iModifiers = aKeyEvent.iModifiers; keyEvent.iRepeats = aKeyEvent.iRepeats; - return CEikDialog::OfferKeyEventL( keyEvent, aModifiers ); + + TKeyResponse res( CEikDialog::OfferKeyEventL( keyEvent, aModifiers ) ); + // It seems Avkon doesn't continue to call OkToExitL after this OfferKeyEventL. + // So, we may have to positively exit by calling TryExitL so that user's selected + // Icon will be return back to caller (i.e., CDestDlg). + TryExitL( EAknSoftkeyOk ); + return res; } default: diff -r ea6e024ea6f9 -r 68f0c7cd80ec dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp --- a/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -801,10 +801,9 @@ // Convert the input parameter to integer TLex lex( *aValue ); - TUint value( 0 ); - - User::LeaveIfError( lex.Val( value, EDecimal) ); - + TInt value( 0 ); + User::LeaveIfError( lex.Val( value ) ); + // Set the paramter value if ( aField == EWlanBGScanInterval ) diff -r ea6e024ea6f9 -r 68f0c7cd80ec dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp --- a/dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp Fri Mar 12 15:44:18 2010 +0200 +++ b/dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp Mon Mar 15 12:42:11 2010 +0200 @@ -32,8 +32,8 @@ // CONSTANTS // WLAN Device Settings table - default settings -const TUint32 KDefaultBGScanInterval = -1; // Automatic scan -const TBool KDefaultUseDefSettings = EFalse; +const TUint32 KDefaultBGScanInterval = 0xFFFFFFFF; // Automatic scan +const TBool KDefaultUseDefSettings = ETrue; const TUint32 KDefaultLongRetry = 4; const TUint32 KDefaultShortRetry = 7; const TUint32 KDefaultRTS = 2347; diff -r ea6e024ea6f9 -r 68f0c7cd80ec dbcreator/conf/commsdatcreator.confml Binary file dbcreator/conf/commsdatcreator.confml has changed diff -r ea6e024ea6f9 -r 68f0c7cd80ec ipcm_pub/access_point_engine_api/inc/APSelect.h --- a/ipcm_pub/access_point_engine_api/inc/APSelect.h Fri Mar 12 15:44:18 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APSelect.h Mon Mar 15 12:42:11 2010 +0200 @@ -65,6 +65,7 @@ { TUint32 iVpnIapId; TUint32 iHomeIapId; + TUint32 iHomeSnapId; HBufC * iName; }TVpnData; diff -r ea6e024ea6f9 -r 68f0c7cd80ec ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h --- a/ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h Fri Mar 12 15:44:18 2010 +0200 +++ b/ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h Mon Mar 15 12:42:11 2010 +0200 @@ -44,18 +44,6 @@ ECmCellularDataUsageDisabled }; -// DEPRECATED enumeration which will be removed within few weeks. -// DO NOT USE THESE VALUES. -// Functionality related to these values is broken although it compiles. -enum TCmSeamlessnessValue - { - ECmSeamlessnessNotRoamedTo, // DO NOT USE - ECmSeamlessnessConfirmFirst, // DO NOT USE - ECmSeamlessnessShowprogress, // DO NOT USE - ECmSeamlessnessFullySeamless, // DO NOT USE - ECmSeamlessnessDisabled // DO NOT USE - }; - // Table for connection settings other than default connection struct TCmGenConnSettings { @@ -65,16 +53,6 @@ TCmCellularDataUsage iCellularDataUsageHome; // Cellular data usage abroad. TCmCellularDataUsage iCellularDataUsageVisitor; - - // DEPRECATED variable that will be removed within few weeks. - // DO NOT USE THESE VARIABLES. - // Functionality related to this variable is broken although it compiles. - TCmSeamlessnessValue iSeamlessnessHome; - // DEPRECATED variable that will be removed within few weeks. - // DO NOT USE THESE VARIABLES. - // Functionality related to this variable is broken although it compiles. - TCmSeamlessnessValue iSeamlessnessVisitor; }; #endif -