# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271420497 -10800 # Node ID fcbbe021d614871c3a82b733077f36dbbe6bf292 # Parent 77415202bfc8e9843f12c8c27457231221abfd93 Revision: 201011 Kit: 201015 diff -r 77415202bfc8 -r fcbbe021d614 accesspointcontrol/apcontrollistplugin/inc/apcontrollistplugin.h --- a/accesspointcontrol/apcontrollistplugin/inc/apcontrollistplugin.h Tue Feb 02 00:24:11 2010 +0200 +++ b/accesspointcontrol/apcontrollistplugin/inc/apcontrollistplugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ // System includes #include -#include +#include #include // This UID is used for both the view UID and the ECOM plugin implementation UID. diff -r 77415202bfc8 -r fcbbe021d614 alwayson_net_plugin/pdpcontextmanager2/src/caoconnectionmonitorimpl.cpp --- a/alwayson_net_plugin/pdpcontextmanager2/src/caoconnectionmonitorimpl.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/alwayson_net_plugin/pdpcontextmanager2/src/caoconnectionmonitorimpl.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -16,7 +16,7 @@ */ // INCLUDE FILES -#include +#include #include "caoconnectionmonitorimpl.h" #include "maosettings.h" #include "logger.h" diff -r 77415202bfc8 -r fcbbe021d614 alwayson_net_plugin/pdpcontextmanager2/src/caoserver.cpp --- a/alwayson_net_plugin/pdpcontextmanager2/src/caoserver.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/alwayson_net_plugin/pdpcontextmanager2/src/caoserver.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -432,9 +432,9 @@ // Create property subscriber iPDPPropertySubscriber = CAOAsyncWrapper::NewL( this, - &PDPPropertySubscriptionIssueRequest, - &PDPPropertySubscriptionRunL, - &PDPPropertySubscriptionDoCancel, + &CAOServer::PDPPropertySubscriptionIssueRequest, + &CAOServer::PDPPropertySubscriptionRunL, + &CAOServer::PDPPropertySubscriptionDoCancel, NULL ); // Subscribe diff -r 77415202bfc8 -r fcbbe021d614 apengine/apeng/src/APNetworks.cpp --- a/apengine/apeng/src/APNetworks.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apeng/src/APNetworks.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -26,7 +26,7 @@ #include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include +#include #else #include #endif diff -r 77415202bfc8 -r fcbbe021d614 apengine/apeng/src/APSelect.cpp --- a/apengine/apeng/src/APSelect.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apeng/src/APSelect.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -24,7 +24,7 @@ #include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include +#include #else #include #endif @@ -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 77415202bfc8 -r fcbbe021d614 apengine/apeng/src/ApProtHandler.cpp --- a/apengine/apeng/src/ApProtHandler.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apeng/src/ApProtHandler.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -22,8 +22,8 @@ #include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#include +#include +#include #else #include #include diff -r 77415202bfc8 -r fcbbe021d614 apengine/apeng/src/VpnApEngine.cpp --- a/apengine/apeng/src/VpnApEngine.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apeng/src/VpnApEngine.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -880,10 +880,11 @@ CleanupStack::PopAndDestroy( buf ); // buf - t->ReadUintL( TPtrC(VPN_SERVICE_IAP), aVpnApItem.iRealIapId ); - - t->ReadUintL( TPtrC(VPN_SERVICE_NETWORKID), aVpnApItem.iHomeNetwork ); - + // These fields might be missing from CommsDat. + // ApEngine does not support SNAPs, use CmManager API to get full support. + TRAP_IGNORE( t->ReadUintL( TPtrC(VPN_SERVICE_IAP), aVpnApItem.iRealIapId ) ) + TRAP_IGNORE( t->ReadUintL( TPtrC(VPN_SERVICE_NETWORKID), aVpnApItem.iHomeNetwork ) ) + CleanupStack::PopAndDestroy( t ); // t // Get real IAP name !!!!! diff -r 77415202bfc8 -r fcbbe021d614 apengine/apsettingsplugin/inc/APSettingsPlugin.h --- a/apengine/apsettingsplugin/inc/APSettingsPlugin.h Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apsettingsplugin/inc/APSettingsPlugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -22,7 +22,7 @@ // System includes #include #include -#include +#include #include // Forward declaration @@ -110,4 +110,4 @@ }; #endif //__AP_SETTINGS_PLUGIN_H__ -//End of file \ No newline at end of file +//End of file diff -r 77415202bfc8 -r fcbbe021d614 apengine/apsettingsplugin/src/APSettingsPlugin.cpp --- a/apengine/apsettingsplugin/src/APSettingsPlugin.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/apengine/apsettingsplugin/src/APSettingsPlugin.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/inc/s60mcpractivities.h --- a/bearermanagement/S60MCPR/inc/s60mcpractivities.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mcpractivities.h Fri Apr 16 15:21:37 2010 +0300 @@ -560,12 +560,12 @@ /** * FORK/DECISION: Decides if needs cancel or not. */ - DECLARE_SMELEMENT_HEADER( TInformMigrationAvailableOrCancelTag, + DECLARE_SMELEMENT_HEADER( TInformMigrationAvailableOrErrorOrCancelTag, MeshMachine::TStateFork, NetStateMachine::MStateFork, TContext ) virtual TInt TransitionTag(); - DECLARE_SMELEMENT_FOOTER( TInformMigrationAvailableOrCancelTag ) + DECLARE_SMELEMENT_FOOTER( TInformMigrationAvailableOrErrorOrCancelTag ) /** * FORK/DECISION: Decides what happens after IPCPR application completes the @@ -601,7 +601,7 @@ * 1. Continue with handshake to select new AP for MCPR. * 2. Return back to migration-phase with new preferred IAP. * 3. Close down the system in case of mobilityerror. - * @return //TODO Cancel from IPCPR. + * @return */ DECLARE_SMELEMENT_HEADER( TNoTagOrInformMigrationAvailableBackwardsOrErrorOrCancel, MeshMachine::TStateFork, @@ -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 */ @@ -767,12 +782,12 @@ * STATE: Waits for preferred carrier message. * @return ETrue if preferred carrier notification is received. */ - DECLARE_SMELEMENT_HEADER( TAwaitingPreferredCarrierOrCancelOrRejected, + DECLARE_SMELEMENT_HEADER( TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification, MeshMachine::TState, NetStateMachine::MState, CS60MobilityActivity::TContext) virtual TBool Accept(); - DECLARE_SMELEMENT_FOOTER( TAwaitingPreferredCarrierOrCancelOrRejected ) + DECLARE_SMELEMENT_FOOTER( TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification ) /** * FORK/DECISION: Decides what happens after IPCPR responds to migration offer. @@ -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. */ @@ -820,16 +850,6 @@ private: // Member variables. - /** - * Pointer to IPProtocoMCPR which is currently active - */ - ESock::RMetaServiceProviderInterface* iCurrent; - - /** - * Pointer to IPProtocoMCPR which is about to become the active. - */ - ESock::RMetaServiceProviderInterface* iPreferred; - TUint iCurrentAssumedAPId; // Current IAP Id TUint iPreferredAPId; // New IAP Id system should roam to. TBool iIsUpgrade; // If the active iPreferredAPId is upgrade to old one. diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/inc/s60mcprstates.h --- a/bearermanagement/S60MCPR/inc/s60mcprstates.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mcprstates.h Fri Apr 16 15:21:37 2010 +0300 @@ -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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/inc/s60mpmrequests.h --- a/bearermanagement/S60MCPR/inc/s60mpmrequests.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60mpmrequests.h Fri Apr 16 15:21:37 2010 +0300 @@ -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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/inc/s60tiermanagerselector.h --- a/bearermanagement/S60MCPR/inc/s60tiermanagerselector.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/inc/s60tiermanagerselector.h Fri Apr 16 15:21:37 2010 +0300 @@ -60,6 +60,7 @@ ESock::CMetaConnectionProviderBase* FindOrCreateProviderL( TUint aAccessPoint ); private: TUint32 iDefaultAp; + TSubSessionUniqueId iSubSessionUniqueId; }; #endif // S60IPTIERMANAGERSELECTOR_H diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mcpr.cpp --- a/bearermanagement/S60MCPR/src/s60mcpr.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcpr.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -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: @@ -398,11 +388,9 @@ notification.iInfo.iIap == 0 )) { S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification IAP %d",(TInt*)this,notification.iInfo.iIap); - - //TODO migrate to use MCPR's TStop and vertical msg down. Not supported at the moment. - /*PostToClients( TNodeCtxId( 0, Id() ), - TCFServiceProvider::TStop( KErrCancel ).CRef(), - TClientType( TCFClientType::EData) );*/ + PostToClients( TNodeCtxId( 0, Id() ), + TCFServiceProvider::TStop( KErrDisconnected ).CRef(), + TClientType( TCFClientType::EServProvider) ); } #ifdef _DEBUG else @@ -464,14 +452,11 @@ // Store PolicyNotification // This could happen if PolicyServer sends notification too early. // - S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification()",(TInt*)this); if ( iPendingNotification.Length() == 0 ) { S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() iPendingNotification.Length() == 0",(TInt*)this); Mem::Copy((TAny*)iPendingNotification.Ptr(), &aNotification, KMpmMessageLength); - S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() Mem::Copy",(TInt*)this); iPendingNotification.SetLength( KMpmMessageLength ); - S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() iPendingNotification.SetLength",(TInt*)this); } #ifdef _DEBUG else diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mcpractivities.cpp --- a/bearermanagement/S60MCPR/src/s60mcpractivities.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcpractivities.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -265,8 +265,8 @@ // Clear handshake status and wait for preferred carrier or mobility API close. NODEACTIVITY_ENTRY( MobilityMCprStates::KStartMobilityHandshake, CS60MobilityActivity::TClearHandshakingFlag, - CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejected, // Ok. Error is fatal. - S60MCprMobilityActivity::TInformMigrationAvailableOrCancelTag ) + CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification, // Ok. Error is fatal. + S60MCprMobilityActivity::TInformMigrationAvailableOrErrorOrCancelTag ) // Application rejected active carrier THROUGH_NODEACTIVITY_ENTRY( S60MCprStates::KSendInitialApplicationReject, S60MCprMobilityActivity::TSendInitialApplicationReject, @@ -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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp --- a/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -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 // ----------------------------------------------------------------------------- @@ -221,23 +238,29 @@ // S60MCprMobilityActivity::TInformMigrationAvailableOrCancelTag::TransitionTag // ----------------------------------------------------------------------------- // - DEFINE_SMELEMENT( TInformMigrationAvailableOrCancelTag, NetStateMachine::MStateFork, TContext ) - TBool TInformMigrationAvailableOrCancelTag::TransitionTag() - { - if ( iContext.iMessage.IsMessage() ) + DEFINE_SMELEMENT( TInformMigrationAvailableOrErrorOrCancelTag, NetStateMachine::MStateFork, TContext ) + TBool TInformMigrationAvailableOrErrorOrCancelTag::TransitionTag() + { + if ( iContext.iNodeActivity->Error() ) { - S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrCancelTag::TransitionTag() KCancelTag",(TInt*)&iContext.Node()) + S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrErrorOrCancelTag::TransitionTag() KErrorTag",(TInt*)&iContext.Node()) + return MeshMachine::KErrorTag | NetStateMachine::EForward; + } + + else if ( iContext.iMessage.IsMessage() ) + { + S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrErrorOrCancelTag::TransitionTag() KCancelTag",(TInt*)&iContext.Node()) return KCancelTag | NetStateMachine::EForward; } else if ( iContext.iMessage.IsMessage() ) { - S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrCancelTag::TransitionTag() KSendInitialApplicationReject", + S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrErrorOrCancelTag::TransitionTag() KSendInitialApplicationReject", (TInt*)&iContext.Node()) return S60MCprStates::KSendInitialApplicationReject | NetStateMachine::EForward; } else { - S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrCancelTag::TransitionTag() KInformMigrationAvailable",(TInt*)&iContext.Node()) + S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableOrErrorOrCancelTag::TransitionTag() KInformMigrationAvailable",(TInt*)&iContext.Node()) return S60MCprStates::KInformMigrationAvailable | NetStateMachine::EForward; } } @@ -341,16 +364,6 @@ //in this implementation. __ASSERT_DEBUG(activity.iPreferredAPId, User::Panic(KS60MCprPanic, KPanicNoServiceProvider)); - //Compute all this here to keep EvaluatePreference() as fast as possible - activity.iCurrent = static_cast( - iContext.Node().GetFirstClient( - TClientType( TCFClientType::EServProvider, TCFClientType::EStarted ))); - - __ASSERT_DEBUG(activity.iCurrent, User::Panic(KS60MCprPanic, KPanicNoServiceProvider)); -/* Not valid ASSERT - __ASSERT_DEBUG(activity.iCurrent->ProviderInfo().APId() == activity.iCurrentAssumedAPId, - User::Panic(KS60MCprPanic, KPanicInConsistentMCPRState)); -*/ // Activity received the necessary information from the policy server earlier // and now holds that information which we'll send to IPCPR. TCFMobilityControlClient::TMigrationNotification msg( activity.iCurrentAssumedAPId, @@ -498,14 +511,14 @@ TClientType(TCFClientType::EData, TCFClientType::ELeaving)); iContext.iNodeActivity->PostRequestTo(*dc, TCFDataClient::TStop(iContext.iNodeActivity->Error()).CRef()); } - + // ----------------------------------------------------------------------------- - // CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejected::Accept + // CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept // ----------------------------------------------------------------------------- // - DEFINE_SMELEMENT( CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejected, + DEFINE_SMELEMENT( CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification, NetStateMachine::MState, TContext ) - TBool CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejected::Accept() + TBool CS60MobilityActivity::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept() { TBool result( EFalse ); @@ -518,7 +531,7 @@ TMpmNotificationPrefIAPAvailable* notif = (TMpmNotificationPrefIAPAvailable*)msg->iPtr; - S60MCPRLOGSTRING4("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejected::Accept() TMPMPreferredCarrierAvailableMsg %d -> %d upgrade=%d", + S60MCPRLOGSTRING4("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept() TMPMPreferredCarrierAvailableMsg %d -> %d upgrade=%d", (TInt*)&iContext.Node(), notif->iOldIapId, notif->iNewIapId, notif->iIsUpgrade) // notif must be there. ASSERT(notif); @@ -538,18 +551,28 @@ } else if ( iContext.iMessage.IsMessage() ) { - S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejected::Accept() TCancel", + S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept() TCancel", (TInt*)&iContext.Node()) result = ETrue; } else if ( iContext.iMessage.IsMessage() ) { - S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejected::Accept() TMigrationRejected", + S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept() TMigrationRejected", (TInt*)&iContext.Node()) result = ETrue; } + else if ( iContext.iMessage.IsMessage() ) + { + CS60MobilityActivity& activity = static_cast(*iContext.iNodeActivity); + TCFS60MCPRMessage::TMPMErrorNotificationMsg* msg = + message_cast( &iContext.iMessage ); + S60MCPRLOGSTRING2("S60MCPR<%x>::TAwaitingPreferredCarrierOrCancelOrRejectedOrErrorNotification::Accept() TMPMErrorNotificationMsg %d",(TInt*)&iContext.Node(),msg->iValue) + ASSERT( msg->iValue != KErrNone ); + activity.SetError( msg->iValue ); + result = ETrue; + } return result; } @@ -666,29 +689,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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mcprsimpleselectactivity.cpp --- a/bearermanagement/S60MCPR/src/s60mcprsimpleselectactivity.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcprsimpleselectactivity.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -155,12 +155,11 @@ TSelectionPrefs prefs; - ESock::RConnPrefList::TIter iterCSR = node.ConnPrefList().getIter(); - //There should be one and only one CSR pref - ASSERT(iterCSR[0] != NULL && iterCSR[1] == NULL); - TConnCSRPref* csrprefs = iterCSR[0]; - - prefs.SetSubSessionUniqueId(csrprefs->SubSessionUniqueId()); + ESock::RConnPrefList::TIter iterCSR = node.ConnPrefList().getIter(); + //There should be one and only one CSR pref + ASSERT(iterCSR[0] != NULL && iterCSR[1] == NULL); + TConnCSRPref* csrprefs = iterCSR[0]; + prefs.SetSubSessionUniqueId(node.SubSessionUniqueId()); prefs.SetFlags(csrprefs->Flags()); prefs.SetScope(csrprefs->Scope()); @@ -172,7 +171,6 @@ node.ConnPrefList().AppendL(nextAP); CleanupStack::Pop(); /* END OF HACK */ - // Attach. 399 attach shouldn't be visible here. if ( prefs.Scope()&TSelectionPrefs::ESelectFromExisting ) @@ -185,6 +183,7 @@ else { S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Start",(TInt*)&iContext.Node()) + TCommDbConnPref ippprefs; ippprefs.SetIapId( node.PolicyPrefs().IapId() ); ippprefs.SetNetId( node.PolicyPrefs().NetId() ); @@ -195,10 +194,6 @@ newPrefs.SetPrefs( ippprefs ); TCFSelector::TSimpleSelect msg(newPrefs); iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg); - - //TODO Clarify, if the SelectionChoices is actually needed... - //if (ac.SelectionChoices().Count() == 0) - //ac.SelectionChoices().Append(node.iIAPList[0]); } } } @@ -296,11 +291,15 @@ } #endif //_DEBUG + TSelectionPrefs newPrefs; + newPrefs = node.SelectionPrefs(); + newPrefs.SetSubSessionUniqueId( node.SubSessionUniqueId() ); + // Attach. 399 attach shouldn't be visible here. if ( node.SelectionPrefs().Scope()&TSelectionPrefs::ESelectFromExisting ) { S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Attach ",(TInt*)&iContext.Node()) - TCFSelector::TSimpleSelect msg( node.SelectionPrefs() ); + TCFSelector::TSimpleSelect msg( newPrefs ); iContext.iNodeActivity->PostRequestTo( ac.iTierManager, msg ); } // Start @@ -312,15 +311,9 @@ ippprefs.SetNetId( node.PolicyPrefs().NetId() ); //node.MapPolicyPrefsToConnPrefL( node.PolicyPrefs(), tmppref ); // don't use reference we want to preserve the original TSelectionPrefs. - TSelectionPrefs newPrefs; - newPrefs = node.SelectionPrefs(); newPrefs.SetPrefs( ippprefs ); TCFSelector::TSimpleSelect msg(newPrefs); iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg); - - //TODO Clarify, if the SelectionChoices is actually needed... - //if (ac.SelectionChoices().Count() == 0) - //ac.SelectionChoices().Append(node.iIAPList[0]); } } @@ -349,16 +342,7 @@ CleanupStack::PushL( cb ); // Resolve application uid. - TSubSessionUniqueId subSessionUniqueId = node.SelectionPrefs().SubSessionUniqueId(); - - if ( !node.ConnPrefList().Count() ) - { - subSessionUniqueId = node.SelectionPrefs().SubSessionUniqueId(); - } - else - { - subSessionUniqueId = node.SubSessionUniqueId(); - } + TSubSessionUniqueId subSessionUniqueId = node.SubSessionUniqueId(); TSecureId secureId( 0 ); diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mcprstates.cpp --- a/bearermanagement/S60MCPR/src/s60mcprstates.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mcprstates.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -54,7 +54,6 @@ node.RequestPermissionToSendStarted() ) { S60MCPRLOGSTRING2("S60MCPR<%x>::THandleMPMStatusChange::DoL() calling IAPConnectionStartedL IAP %d",(TInt*)&iContext.Node(),iapid) - // TODO use progress notification KLinkLayerOpen once Symbian provides them. node.Policy()->IAPConnectionStartedL( iapid ); // codescanner::leave } else if ( msg.iValue == TCFControlProvider::TDataClientStatusChange::EStopped && @@ -114,28 +113,46 @@ RNodeInterface* stoppingSP = NULL; RNodeInterface* startingSP = NULL; - // The one that will be started is the one MPM selected. - // Both must be present in the MCPR -plane. + // Get the MCPR + CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node(); + + // At this point MCPR has selected two active IPProtoMCPRs. + // The one that will be started is the one MPM selected and + // the one which doesn't match the policy preferences is the + // old selection and needs to be disconnected. + // + TUint32 newAP = node.PolicyPrefs().IapId(); + ASSERT( newAP > 0 ); // Choose Service Providers to work on TClientIter iter = iContext.Node().GetClientIter(TClientType(TCFClientType::EServProvider)); - - RNodeInterface* itf = NULL; - for ( itf = iter++; ( itf != NULL && ( stoppingSP == NULL || startingSP == NULL ) ); itf = iter++ ) + + RMetaServiceProviderInterface* itf = NULL; + //RNodeInterface* itf = NULL; + + for ( itf = (RMetaServiceProviderInterface*)iter++; + ( itf != NULL && ( stoppingSP == NULL || startingSP == NULL ) ); + itf = (RMetaServiceProviderInterface*)iter++ ) { - // Only one of the selected MCPRs can be EStarted. - // - if ( itf->Flags() & TCFClientType::EStarted ) + if ( itf->Flags() & TCFClientType::EActive ) { - stoppingSP = itf; //Our current started Service Provider. - itf->ClearFlags( TCFClientType::EActive ); - } - // The other which is not EStarted must be EActive. - // - else if ( itf->Flags() & TCFClientType::EActive ) - { - startingSP = itf; //And the new one to try next + // Select one that shall be stopped. + // + if ( itf->ProviderInfo().APId() != newAP ) + { + stoppingSP = itf; + itf->ClearFlags( TCFClientType::EActive ); + } + // Select one that shall be started + // + else if ( itf->ProviderInfo().APId() == newAP ) + { + startingSP = itf; + itf->ClearFlags( TCFClientType::EActive ); + } + // no else. + // } } // One must be started since this is already a reconnection @@ -147,10 +164,6 @@ User::Leave( KErrCorrupt ); // codescanner::leave } - //Sanity check. - //The new provider must not be started, there can be only one started at a time. - ASSERT( startingSP == NULL || ( startingSP->Flags() & TCFClientType::EStarted ) == 0 ); - //If there is no other Service Provider to try, return KErrNotFound if ( startingSP == NULL ) { @@ -167,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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60mpmrequests.cpp --- a/bearermanagement/S60MCPR/src/s60mpmrequests.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60mpmrequests.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -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 77415202bfc8 -r fcbbe021d614 bearermanagement/S60MCPR/src/s60tiermanagerselector.cpp --- a/bearermanagement/S60MCPR/src/s60tiermanagerselector.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/S60MCPR/src/s60tiermanagerselector.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -97,6 +97,8 @@ //Legacy Attach -case handling is in NetMCPR and IPProtoTM // 399 Attach is not supported const TConnPref& prefs = iSelectionPrefs.Prefs(); + iSubSessionUniqueId = iSelectionPrefs.SubSessionUniqueId(); + switch ( prefs.ExtensionId() ) { case TConnPref::EConnPrefCommDbMulti: @@ -130,8 +132,8 @@ break; } } - // We do the default behavior. AP is only needed to get proper UIds for TM etc.. - // TODO: change to use AP. + // We use default AP always. If some variation is needed in APs, then + // this must be changed to use specific APs instead of the default one. aSelectionNotify.SelectComplete( this, FindOrCreateProviderL( iDefaultAp )); aSelectionNotify.SelectComplete( this, NULL ); } @@ -164,6 +166,7 @@ // Provision selection preferences to S60 NetMCPR. prov->SetSelectionPrefs( iSelectionPrefs ); + prov->SetSubSessionUniqueId( iSubSessionUniqueId ); // Change the provider info so that this provider is never found by other selections const TProviderInfo& pi = provider->ProviderInfo(); diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/group/mpmserver.mmp --- a/bearermanagement/mpm/group/mpmserver.mmp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/group/mpmserver.mmp Fri Apr 16 15:21:37 2010 +0300 @@ -54,7 +54,7 @@ SOURCE mpmiapselection.cpp SOURCE mpmcsidwatcher.cpp SOURCE mpmdialogbase.cpp -SOURCE mpmwlanavailability.cpp +SOURCE mpmdatausagewatcher.cpp USERINCLUDE ../inc diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmconnmonevents.h --- a/bearermanagement/mpm/inc/mpmconnmonevents.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmconnmonevents.h Fri Apr 16 15:21:37 2010 +0300 @@ -32,13 +32,11 @@ #include #include #endif -#include +#include #include "mpmserver.h" // FORWARD DECLARATIONS class CMPMConnMonReqs; -class CWlanAvailability; -class MWlanAvailability; // CONSTANTS @@ -298,31 +296,10 @@ /** * Creates preferred carrier available notification when needed. * @since 5.1 - */ - void IapAvailabilityChange(); - - /** - * Asks WLAN bearer availability info from Connection monitor. - * @since 5.2 - * @param aObserver pointer to the caller + * @param aCaller Identifies the calling context */ - void CheckWlanAvailabilityL( MWlanAvailability* aObserver ); - - /** - * Cancels WLAN bearer availability check for an observer. - * @since 5.2 - * @param aObserver pointer to the caller - */ - void CancelCheckWlanWlanAvailability( MWlanAvailability* aObserver ); - - /** - * Sets iWlanAvailability pointer to NULL because object has - * deleted itself. - * @since 5.2 - */ - void SetWlanAvailabilityPtrNull(); - - + void IapAvailabilityChange( const TPrefIAPNotifCaller aCaller ); + public: // Functions from base classes /** @@ -373,7 +350,6 @@ void FilterAvailableIAPEvents( const TBool aVal ) { iFilterEvents = aVal; } #endif //_DEBUG - CWlanAvailability* iWlanAvailability; }; // ----------------------------------------------------------------------------- diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmcsidwatcher.h --- a/bearermanagement/mpm/inc/mpmcsidwatcher.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmcsidwatcher.h Fri Apr 16 15:21:37 2010 +0300 @@ -18,6 +18,9 @@ #ifndef MPMCSIDWATCHER_H #define MPMCSIDWATCHER_H +// INCLUDES +#include + class CRepository; /** diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmdatausagewatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bearermanagement/mpm/inc/mpmdatausagewatcher.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listen cellular data usage key changes in central repository. +* +*/ + +#ifndef MPMDATAUSAGEWATCHER_H +#define MPMDATAUSAGEWATCHER_H + +// INCLUDES +#include + +class CRepository; +class CMPMServer; + +/** + * Class for accessing central repository. + * Follows KCurrentCellularDataUsage key in central repository. + * @since 5.2 + */ +class CMpmDataUsageWatcher : public CActive + { + +public: + + /** + * New for calling the two-phased constructor. + */ + static CMpmDataUsageWatcher* NewL( CMPMServer* aServer ); + + /** + * Destructor. + */ + virtual ~CMpmDataUsageWatcher(); + + /** + * Start to listen for events. + */ + void StartL(); + + /** + * Active object's RunL. + */ + void RunL(); + + /** + * Active object's RunError. + */ + TInt RunError( TInt aError ); + + /** + * Active object's DoCancel. + */ + void DoCancel(); + +private: + + /** + * C++ default constructor. + */ + CMpmDataUsageWatcher( CMPMServer* aServer ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + +private: // data + + /** + * Central repository handle. + * Own. + */ + CRepository* iRepository; + + /** + * Data usage value. + */ + TInt iCellularDataUsage; // type: TCmCellularDataUsage + + /** + * Pointer to the MPM Server object. + * Not own. + */ + CMPMServer* iServer; + + }; + +#endif // MPMDATAUSAGEWATCHER_H diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmiapselection.h --- a/bearermanagement/mpm/inc/mpmiapselection.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmiapselection.h Fri Apr 16 15:21:37 2010 +0300 @@ -22,12 +22,10 @@ #include "mpmserversession.h" #include "mpmcommsdataccess.h" -#include "mpmwlanavailability.h" class CMPMDialog; class CMPMWlanQueryDialog; class CMPMConfirmDlgStarting; -class MWlanAvailability; class TMpmConnPref; enum TOfflineNoteResponse @@ -45,8 +43,7 @@ * @lib mpmserver.exe * @since S60 v3.2 */ -class CMPMIapSelection : public CBase, - public MWlanAvailability +class CMPMIapSelection : public CBase { public: @@ -240,13 +237,6 @@ * @since 3.2 */ void ConnectionStarted(); - - /** - * Triggers an information note. Note disappears automatically. - * - * @since 5.2 - */ - void TriggerInformationNoteL(); /** * Get original MPM connection preferences @@ -307,18 +297,6 @@ */ void ImplicitConnectionWlanNoteL(); -private: // from MWlanAvailability - - /** - * WLAN availability check response - * @since 3.2 - * @param aError generic Symbian error response code - * @param aResult Result of WLAN availability check - * @return void - */ - void WlanAvailabilityResponse( const TInt aError, - const TBool aResult ); - private: /** diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmlauncher.h --- a/bearermanagement/mpm/inc/mpmlauncher.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmlauncher.h Fri Apr 16 15:21:37 2010 +0300 @@ -26,6 +26,9 @@ // INCLUDES #include +// CONSTANTS +_LIT( KMPMLauncherSemaphore, "MPMLauncherSemaphore" ); + // CLASS DECLARATION /** * Mobility Policy Manager server laucher for client. diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmroamingwatcher.h --- a/bearermanagement/mpm/inc/mpmroamingwatcher.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmroamingwatcher.h Fri Apr 16 15:21:37 2010 +0300 @@ -77,11 +77,6 @@ */ TMPMRoamingStatus RoamingStatus() const; - TBool AskCellularDataUsageAbroad() const; - - void SetAskCellularDataUsageAbroad(TBool aAskUsage); - - protected: // Constructors and destructor /** @@ -148,14 +143,6 @@ * Current country */ RMobilePhone::TMobilePhoneNetworkCountryCode iCurrentCountryCode; - - /** - * This variable indicates wheather cellular data usage abroad must be confirmed from the user - * This variable is set to TRUE when roaming to visitor network happens and it is set to FALSE when - * Confirm Dialog is presented first time in current foreign country. It is also set to FALSE every - * time when mobile comes back to home network or moves to other foreign country - */ - TBool iAskCellularDataUsageAbroad; }; #endif // MPMROAMINGWATCHER_H diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmserver.h --- a/bearermanagement/mpm/inc/mpmserver.h Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/inc/mpmserver.h Fri Apr 16 15:21:37 2010 +0300 @@ -37,6 +37,7 @@ class CMPMCommsDatAccess; class CMpmCsIdWatcher; +class CMpmDataUsageWatcher; // CONSTANTS _LIT( KMPMPanicCategory, "Mobility Policy Manager Server" ); @@ -124,7 +125,8 @@ // Which component initiated sending preferred IAP notifications enum TPrefIAPNotifCaller { - EConnMon = 0, + EConnMon = 0, + EConnMonEvent, EBearerMan, EConfirmDlgRoaming, EConfirmDlgStarting @@ -436,9 +438,11 @@ /** * Notify each session about IAP availability change. * @since 3.1 - * @param aIapInfo Info about available IAPs + * @param aIapInfo Info about available IAPs + * @param aCaller Identifies the calling context */ - void NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo ); + void NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo, + const TPrefIAPNotifCaller aCaller ); /** * Update Connection dialog of each session @@ -488,17 +492,6 @@ /** * Handling of unblacklisting all IAPs for certain category. * @since 3.2 - * @param aConnId Connection Id - * @param aCategory Either connection lifetime or temporary. - * @return KErrNone if successful, otherwise one of the - * system-wide error codes - */ - TInt HandleServerUnblackListIap( const TConnectionId aConnId, - TBlacklistCategory aCategory ); - - /** - * Handling of unblacklisting all IAPs for certain category. - * @since 3.2 * @param aCategory Either connection lifetime or temporary. */ void HandleServerUnblackListIap( TBlacklistCategory aCategory ); @@ -834,6 +827,12 @@ */ CMPMServerSession* GetServerSession( TConnectionId aConnId ) const; + /** + * Stops cellular connections, except MMS + * @since 5.2 + */ + void StopCellularConns(); + private: /** @@ -938,6 +937,11 @@ */ CMpmCsIdWatcher* iMpmCsIdWatcher; + /** + * Handle to another central repository watcher + */ + CMpmDataUsageWatcher* iMpmDataUsageWatcher; + // Iap id of the active connection TUint32 iActiveIapId; diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/inc/mpmwlanavailability.h --- a/bearermanagement/mpm/inc/mpmwlanavailability.h Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: WLAN availability check. -* -*/ - -/** -@file mpmwlanavailability.h -WLAN availability check definition. -*/ - -#ifndef MPMWLANAVAILABILITY_H -#define MPMWLANAVAILABILITY_H - -// INCLUDES -#include -#include -#include "mpmconnmonevents.h" - -// FORWARD DECLARATIONS -class CMPMConnMonEvents; - -// CLASS DECLARATION -/** -* WLAN availability check -* -* @lib MPMServer.exe -* @since 5.2 -*/ -class MWlanAvailability - { - public: - /** - * WLAN availability check response - * @since 5.2 - * @param aError generic Symbian error response code - * @param aResult Result of WLAN availability check - * @return void - */ - virtual void WlanAvailabilityResponse( const TInt aError, - const TBool aResult ) = 0; - }; - -// CLASS DECLARATION -/** -* WLAN availability check implementation -* -* @lib MPMServer.exe -* @since 5.2 -*/ -NONSHARABLE_CLASS( CWlanAvailability ) : public CActive - { - public: - - /** - * Two-phased constructor. - */ - static CWlanAvailability* NewL( CMPMConnMonEvents* aConnMonEvents, - RConnectionMonitor& aConnMon ); - - /** - * Destructor. - */ - virtual ~CWlanAvailability(); - - /** - * For starting the active object. - * @since 5.2 - */ - void Start( MWlanAvailability* aObserver ); - - /** - * For cancelling the request for an observer. - * @since 5.2 - */ - void CancelObserver( MWlanAvailability* aObserver ); - - private: - - /** - * C++ default constructor. - */ - CWlanAvailability( CMPMConnMonEvents* aConnMonEvents, - RConnectionMonitor& aConnMon ); - - /** - * 2nd phase constructor. - */ - void ConstructL(); - - private: // from CActive - - /** - * Active Object RunL. - */ - void RunL(); - - /** - * Active Object DoCancel. - */ - void DoCancel(); - - private: - - CMPMConnMonEvents* iConnMonEvents; - RConnectionMonitor& iConnMon; - RPointerArray< MWlanAvailability > iObserver; - TRequestStatus iRequestStatus; - TBool iResult; - }; - -#endif // MPMWLANAVAILABILITY_H diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp --- a/bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -266,13 +266,6 @@ TRAP_IGNORE(iServer.CommsDatAccess()->WriteGenConnSettingsL( genConnSettings )); } } - else - { - //In foreign country connect automatically is not stored in commsdat - //even user selected so. We just do not ask confirmation for the cellular - //connection again in this country: - iServer.RoamingWatcher()->SetAskCellularDataUsageAbroad( false ); - } TBool wlanNeeded( EFalse ); TRAPD( err, wlanNeeded = iIapSelection.StartWlanQueryIfNeededL( iIAP ) ) diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmconnmonevents.cpp --- a/bearermanagement/mpm/src/mpmconnmonevents.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmconnmonevents.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -26,7 +26,6 @@ #include "mpmserver.h" #include "mpmserversession.h" #include "mpmlogger.h" -#include "mpmwlanavailability.h" // ============================= LOCAL FUNCTIONS =============================== @@ -68,8 +67,6 @@ iConnMon.Close(); iReqPtrs.ResetAndDestroy(); iConnInfoArray.Close(); - delete iWlanAvailability; - iWlanAvailability = NULL; } @@ -464,7 +461,7 @@ // CMPMConnMonEvents::IapAvailabilityChange // ----------------------------------------------------------------------------- // -void CMPMConnMonEvents::IapAvailabilityChange() +void CMPMConnMonEvents::IapAvailabilityChange( const TPrefIAPNotifCaller aCaller ) { if ( ( iAvailableIAPs.Count() > 0 ) && !DiscardAvailabilityNotification() ) @@ -478,7 +475,7 @@ // or Connection Monitor CConnMonEventHandler::RunL() // will also leave, which will make mpmserver.exe CRASH. // - TRAP_IGNORE( iMyServer.NotifyBMPrefIapL( iAvailableIAPs ) ) + TRAP_IGNORE( iMyServer.NotifyBMPrefIapL( iAvailableIAPs, aCaller ) ) } else { @@ -537,7 +534,7 @@ iAvailableIAPs = eventIap->IapAvailability(); UpdateIAPRefreshTime(); - IapAvailabilityChange(); + IapAvailabilityChange( EConnMonEvent ); TRAPD( err, iMyServer.UpdateSessionConnectionDlgL() ) if( err != KErrNone ) @@ -697,52 +694,5 @@ { } -// ----------------------------------------------------------------------------- -// CMPMConnMonEvents::CheckWlanAvailabilityL -// ----------------------------------------------------------------------------- -// -void CMPMConnMonEvents::CheckWlanAvailabilityL( MWlanAvailability* aObserver ) - { - MPMLOGSTRING( "CMPMConnMonEvents::CheckWlanAvailabilityL" ) - // Sanity check null pointer - ASSERT( aObserver != NULL ); - - // Request for WLAN bearer availability info - // - if ( !iWlanAvailability ) - { - iWlanAvailability = CWlanAvailability::NewL( this, iConnMon ); - } - - iWlanAvailability->Start( aObserver ); - } - -// ----------------------------------------------------------------------------- -// CMPMConnMonEvents::CancelCheckWlanWlanAvailability -// ----------------------------------------------------------------------------- -// -void CMPMConnMonEvents::CancelCheckWlanWlanAvailability( MWlanAvailability* aObserver ) - { - MPMLOGSTRING( "CMPMConnMonEvents::CancelCheckWlanWlanAvailability" ) - // Sanity check null pointer - ASSERT( aObserver != NULL ); - - // Cancel WLAN bearer availability check for this observer - // - if ( iWlanAvailability ) - { - iWlanAvailability->CancelObserver( aObserver ); - } - } - -// ----------------------------------------------------------------------------- -// CMPMConnMonEvents::SetWlanAvailabilityPtrNull -// ----------------------------------------------------------------------------- -// -void CMPMConnMonEvents::SetWlanAvailabilityPtrNull() - { - iWlanAvailability = NULL; - } - // End of File diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmconnmonreqs.cpp --- a/bearermanagement/mpm/src/mpmconnmonreqs.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmconnmonreqs.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -342,7 +342,7 @@ MPMLOGSTRING( "CMPMConnMonReqs::RunL: iWlanScanCallback EWlanScanCallbackGenerateEvent" ) // Generate event only if not // - iParent.IapAvailabilityChange(); + iParent.IapAvailabilityChange( EConnMon ); } } // check which callback function to use diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmdatausagewatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bearermanagement/mpm/src/mpmdatausagewatcher.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Listen cellular data usage key changes in central repository. + * + */ + +#include +#include +#include +#include + +#include "mpmlogger.h" +#include "mpmserver.h" +#include "mpmdatausagewatcher.h" + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMpmDataUsageWatcher::CMpmDataUsageWatcher( CMPMServer* aServer ) : + CActive( EPriorityStandard ), iServer( aServer ) + { + MPMLOGSTRING( "CMpmDataUsageWatcher::CMpmDataUsageWatcher" ) + + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor. Creates a central repository object. +// --------------------------------------------------------------------------- +// +void CMpmDataUsageWatcher::ConstructL() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::ConstructL" ) + + iRepository = CRepository::NewL( KCRUidCmManager ); + } + +// --------------------------------------------------------------------------- +// Creates a new object by calling the two-phased constructor. +// --------------------------------------------------------------------------- +// +CMpmDataUsageWatcher* CMpmDataUsageWatcher::NewL( CMPMServer* aServer ) + { + MPMLOGSTRING( "CMpmDataUsageWatcher::NewL" ) + + CMpmDataUsageWatcher* self = new( ELeave ) CMpmDataUsageWatcher( aServer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMpmDataUsageWatcher::~CMpmDataUsageWatcher() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::~CMpmDataUsageWatcher" ) + + Cancel(); + delete iRepository; + } + +// --------------------------------------------------------------------------- +// Order notification from changes. +// --------------------------------------------------------------------------- +// +void CMpmDataUsageWatcher::StartL() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::StartL" ) + + // Request notification + User::LeaveIfError( iRepository->NotifyRequest( KCurrentCellularDataUsage, + iStatus ) ); + SetActive(); + + // Get value from central repository + User::LeaveIfError( iRepository->Get( KCurrentCellularDataUsage, + iCellularDataUsage ) ); + } + +// --------------------------------------------------------------------------- +// From class CActive. +// Event is received when there is a change in central repository key. +// --------------------------------------------------------------------------- +// +void CMpmDataUsageWatcher::RunL() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::RunL" ) + + User::LeaveIfError( iStatus.Int() ); + + // Request new notification + User::LeaveIfError( iRepository->NotifyRequest( KCurrentCellularDataUsage, + iStatus ) ); + SetActive(); + + TInt oldCellularDataUsage = iCellularDataUsage; + + // Get the new value from central repository + User::LeaveIfError( iRepository->Get( KCurrentCellularDataUsage, + iCellularDataUsage ) ); + + // Stop cellular connections if the setting changes into Disabled + if ( oldCellularDataUsage != ECmCellularDataUsageDisabled && + iCellularDataUsage == ECmCellularDataUsageDisabled && + iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown ) + { + iServer->StopCellularConns(); + } + } + +// --------------------------------------------------------------------------- +// From class CActive. +// Nothing to do over here. +// --------------------------------------------------------------------------- +// +TInt CMpmDataUsageWatcher::RunError( TInt /*aError*/ ) + { + MPMLOGSTRING( "CMpmDataUsageWatcher::RunError" ) + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// From class CActive. +// Cancel outstanding request. +// --------------------------------------------------------------------------- +// +void CMpmDataUsageWatcher::DoCancel() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::DoCancel" ) + + iRepository->NotifyCancel( KCurrentCellularDataUsage ); + } + diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmiapselection.cpp --- a/bearermanagement/mpm/src/mpmiapselection.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmiapselection.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -84,13 +84,6 @@ // StopDisplayingStartingDlg(); - // Cancel WLAN availability check in case it is active - // - if ( iSession ) - { - iSession->MyServer().Events()->CancelCheckWlanWlanAvailability( this ); - } - delete iConfirmDlgStarting; delete iDialog; delete iWlanDialog; @@ -117,12 +110,6 @@ iChooseIapPref = aChooseIapPref; - // Update iNewWlansAllowed information. - // No need to filter away cellular iaps here based on UI's Allow Cellular Usage - // setting, since ConnMon checks the setting and reports only correct IAPs - // available for MPM. - iSession->IsWlanOnlyL( iNewWlansAllowed ); - // Always use stored connection info. // If stored information doesn't exist, a normal sequence is used. TUint32 snap( 0 ); @@ -148,6 +135,9 @@ MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL: IapID: %i", iChooseIapPref.IapId() ) + // Update WLAN only information and whether new WLAN network usage is allowed. + TBool wlanOnly = iSession->IsWlanOnlyL( iNewWlansAllowed ); + // Check if direct IAP connection is tried to make if ( iChooseIapPref.IapId() != 0 ) { @@ -156,11 +146,22 @@ // Complete selection with error code if wlan only was set and cellular IAP other // than MMS IAP was tried to access - if ( ( iChooseIapPref.BearerSet() == - TExtendedConnPref::EExtendedConnBearerWLAN ) && + if ( wlanOnly && ( bearerType == EMPMBearerTypePacketData ) && ( iSession->IsMMSIap( iChooseIapPref.IapId() ) == EFalse ) ) - { + { + ChooseIapComplete( KErrPermissionDenied, NULL ); + 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; } @@ -367,8 +368,7 @@ { // Check if we are roaming and cellular data usage query has not yet been presented // to the user in this country - if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming - && iSession->MyServer().RoamingWatcher()->AskCellularDataUsageAbroad() == true ) + if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming ) { // Check whether queries are enabled if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) ) @@ -424,16 +424,7 @@ if ( ( iChooseIapPref.BearerSet() & TExtendedConnPref::EExtendedConnBearerWLAN ) || ( iChooseIapPref.BearerSet() == TExtendedConnPref::EExtendedConnBearerUnknown ) ) { - if ( iNewWlansAllowed && - ( iChooseIapPref.BearerSet() == - TExtendedConnPref::EExtendedConnBearerWLAN ) ) - { - // User allows only WLAN connections, check WLAN availability. - // A note will be shown if no WLANs are available. - // - iSession->MyServer().Events()->CheckWlanAvailabilityL( this ); - } - else if( iCommsDatAccess->SnapContainsWlanL( snap, iapPath, KMPMNrWlansOne ) ) + if( iCommsDatAccess->SnapContainsWlanL( snap, iapPath, KMPMNrWlansOne ) ) { // Scan wlan networks. After that execution continues // in CompleteExplicitSnapConnectionL() @@ -543,34 +534,17 @@ { if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming ) { - // Check if cellular data usage query has already been presented to the user in this country - if ( iSession->MyServer().RoamingWatcher()->AskCellularDataUsageAbroad() == true ) - { - // International roaming - iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( - *this, - connId, - snap, - validateIapId, - CMPMConfirmDlg::EConfirmDlgVisitorNetwork, - iChooseIapPref, - iSession->MyServer(), - *iSession, - EExplicitConnection ); - } - else - { - // If user has already been queried in this country just complete the IAP selection. - - iSession->MyServer().AppendBMConnection( connId, - snap, - validateIapId, - EStarting, - *iSession ); - - ChooseIapComplete( KErrNone, &iChooseIapPref ); - } - + // International roaming + iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( + *this, + connId, + snap, + validateIapId, + CMPMConfirmDlg::EConfirmDlgVisitorNetwork, + iChooseIapPref, + iSession->MyServer(), + *iSession, + EExplicitConnection ); } else { @@ -748,7 +722,8 @@ if ( ( aError == KErrNone ) && !( iChooseIapPref.NoteBehaviour() & - TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) + TExtendedConnPref::ENoteBehaviourConnDisableNotes ) && + ( iSession->IsMMSIap( aPolicyPref->IapId() ) == EFalse ) ) { TBool connectionAlreadyActive = iSession->MyServer().CheckIfStarted( aPolicyPref->IapId() ); @@ -874,28 +849,12 @@ TMpmConnPref userPref; iUserSelectionSnapId = iCommsDatAccess->MapNetIdtoSnapAPL( aId ); userPref.SetSnapId( iUserSelectionSnapId ); + userPref.SetIapId( 0 ); - -// Agreed that MPM will be migrated to SNAP TAG ID SNAPS. -// if ( iUserSelectionSnapId < 0x1000 ) // TODO: remove when connection dialog return valid SNAP TAG ID. -// { -// // legacy snaps ok -// userPref.SetNetId( aId ); -// iUserSelectionSnapId = aId; -// } -// else -// { -// // 5.2 snaps, MPM uses internally legacy snaps. Convert back. -jl- TODO: use CommsDat mapping in future. -// userPref.SetNetId( aId - 3000 ); -// iUserSelectionSnapId = aId - 3000; -// } - MPMLOGSTRING2( "CMPMIapSelection::HandleUserSelectionL: Snap = %i selected by the User", iUserSelectionSnapId ) -// userPref.SetNetId( aId ); - userPref.SetIapId( 0 ); ChooseBestIAPL( userPref, iStoredAvailableIaps ); iUserSelectionIapId = userPref.IapId(); @@ -951,8 +910,7 @@ { // Check if we are roaming and cellular data usage query has not yet been presented // to the user in this country - if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming - && iSession->MyServer().RoamingWatcher()->AskCellularDataUsageAbroad() == true ) + if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming ) { // Check whether queries are enabled if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) ) @@ -1343,62 +1301,6 @@ } // ----------------------------------------------------------------------------- -// CMPMIapSelection::TriggerInformationNote -// ----------------------------------------------------------------------------- -// -void CMPMIapSelection::TriggerInformationNoteL() - { - // ConnectioUiUtilities client side has a nonblocking active object - // implementation - // - if ( !( iChooseIapPref.NoteBehaviour() & - TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) - { - CConnectionUiUtilities* connUiUtils = CConnectionUiUtilities::NewL(); - - connUiUtils->NoWLANNetworksAvailableNote(); - - delete connUiUtils; - } - } - -// ----------------------------------------------------------------------------- -// CMPMIapSelection::WlanAvailabilityResponse -// ----------------------------------------------------------------------------- -// -void CMPMIapSelection::WlanAvailabilityResponse( const TInt aError, - const TBool aResult ) - { - if ( ( aError == KErrNone && aResult == EFalse ) - || ( aError == KErrNotSupported ) ) - { - // no WLANs are available and user allows only - // WLAN connections - TRAPD( err, TriggerInformationNoteL() ); - - if ( err ) - { - MPMLOGSTRING2( "TriggerInformationNoteL leaved %d", err ) - } - - ChooseIapComplete( KErrNotFound, NULL ); - } - else - { - // Some WLANs are available, - // or an error has occured while requesting available WLANs. - // - TRAPD( err, CompleteExplicitSnapConnectionL() ); - - if ( err ) - { - MPMLOGSTRING2( "CompleteExplicitSnapConnectionL leaved %d", err ) - ChooseIapComplete( KErrCancel, NULL ); - } - } - } - -// ----------------------------------------------------------------------------- // CMPMIapSelection::MpmConnPref // ----------------------------------------------------------------------------- // diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmlauncher.cpp --- a/bearermanagement/mpm/src/mpmlauncher.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmlauncher.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -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 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmroamingwatcher.cpp --- a/bearermanagement/mpm/src/mpmroamingwatcher.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmroamingwatcher.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -58,8 +58,7 @@ iMobilePhone( aMobilePhone ), iRegistrationStatus( RMobilePhone::ERegistrationUnknown ), iRoamingStatus( EMPMRoamingStatusUnknown ), - iCurrentCountryCode( 0 ), - iAskCellularDataUsageAbroad( true ) + iCurrentCountryCode( 0 ) { MPMLOGSTRING( "CMPMRoamingWatcher::CMPMRoamingWatcher" ) CActiveScheduler::Add( this ); @@ -188,7 +187,6 @@ case RMobilePhone::ERegisteredOnHomeNetwork: { roamingStatus = EMPMHomenetwork; - iAskCellularDataUsageAbroad = false; break; } @@ -221,11 +219,6 @@ else { roamingStatus = EMPMInternationalRoaming; - // - if ( iCurrentCountryCode != countryCode ) - { - iAskCellularDataUsageAbroad = ETrue; - } } iCurrentCountryCode = countryCode; } @@ -256,20 +249,6 @@ return iRoamingStatus; } - -TBool CMPMRoamingWatcher::AskCellularDataUsageAbroad() const - { - MPMLOGSTRING2( "CMPMRoamingWatcher::AskCellularDataUsageAbroad iAskCellularDataUsageAbroad: %d", iAskCellularDataUsageAbroad ) - return iAskCellularDataUsageAbroad; - } - -void CMPMRoamingWatcher::SetAskCellularDataUsageAbroad(TBool aAskUsage) - { - iAskCellularDataUsageAbroad = aAskUsage; - MPMLOGSTRING2( "CMPMRoamingWatcher::SetAskCellularDataUsageAbroad iAskCellularDataUsageAbroad: %d", iAskCellularDataUsageAbroad ) - } - - // ========================== OTHER EXPORTED FUNCTIONS ========================= // None. diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmserver.cpp --- a/bearermanagement/mpm/src/mpmserver.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmserver.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -25,6 +25,7 @@ #include // Voice call notification #include // KMmTsyModuleName #include +#include #include "mpmserver.h" #include "mpmserversession.h" @@ -41,6 +42,8 @@ #include "mpmdialog.h" #include "mpmprivatecrkeys.h" #include "mpmcsidwatcher.h" +#include "mpmdatausagewatcher.h" +#include "mpmpropertydef.h" // ============================= LOCAL FUNCTIONS =============================== @@ -170,6 +173,20 @@ iMpmCsIdWatcher = CMpmCsIdWatcher::NewL(); iMpmCsIdWatcher->StartL(); + // Create another central repository watcher and start it + // TODO: Trapped, because currently it may fatally leave in HW. + // (Possibly because of the capability updates of data usage watcher's CR-keys.) + TRAPD( duwErr, iMpmDataUsageWatcher = CMpmDataUsageWatcher::NewL( this ) ); + if (duwErr == KErrNone) + { + iMpmDataUsageWatcher->StartL(); + } + else + { + iMpmDataUsageWatcher = NULL; + MPMLOGSTRING( "CMPMServer::ConstructL: CMpmDataUsageWatcher::NewL() failed!" ) + } + // Define P&S keys (snap & iap) for the user connection TInt ret = RProperty::Define( KMPMUserConnectionCategory, KMPMPSKeyUserConnectionSnap, @@ -326,6 +343,8 @@ delete iMpmCsIdWatcher; + delete iMpmDataUsageWatcher; + iDedicatedClients.Close(); delete iCommsDatAccess; @@ -955,7 +974,8 @@ // CMPMServer::NotifyBMPrefIapL // ----------------------------------------------------------------------------- // -void CMPMServer::NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo ) +void CMPMServer::NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo, + const TPrefIAPNotifCaller aCaller ) { MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - IAPs count: %d", aIapInfo.iCount) @@ -984,7 +1004,7 @@ for ( TInt i = 0; i < iSessions.Count(); i++ ) { iapInfo = iSessions[i]->GetAvailableIAPs( ); - iSessions[i]->PrefIAPNotificationL( iapInfo, EConnMon ); + iSessions[i]->PrefIAPNotificationL( iapInfo, aCaller ); } // If a session is displaying connection selection dialog @@ -1134,57 +1154,6 @@ } } - -// ----------------------------------------------------------------------------- -// CMPMServer::HandleServerUnblackListIap -// ----------------------------------------------------------------------------- -// -TInt CMPMServer::HandleServerUnblackListIap( - const TConnectionId aConnId, - TBlacklistCategory aCategory ) - { - MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap -\ - aConnId = 0x%x, aCategory = %i", aConnId, aCategory ) - - TInt i; - TBool found = EFalse; - - found = FindBlacklistedConnIndex( aConnId, i ); - if ( found ) - { - // found blacklisted Connection Id - TMPMBlackListConnId connIdInfo = iBlackListIdList[i]; - iBlackListIdList.Remove( i ); // remove from the list - - found = EFalse; - for (TInt j = 0; j < connIdInfo.Count(); j++) - { - if ( connIdInfo.Category( j ) == aCategory ) - { - // found and remove blacklisted iap - connIdInfo.Remove( j ); - if ( connIdInfo.Count() == 0 ) - { - return KErrNone; - } - - // reinsert connIdInfo at the beginning to reflect activeness - iBlackListIdList.Insert( connIdInfo, 0 ); - return KErrNone; - } - } - // nothing found and reinsert at the beginning - // connIdInfo to reflect activeness - iBlackListIdList.Insert( connIdInfo, 0 ); - return KErrNotFound; - } - else - { - return KErrNotFound; - } - } - - // ----------------------------------------------------------------------------- // CMPMServer::HandleServerUnblackListIap // ----------------------------------------------------------------------------- @@ -1784,7 +1753,7 @@ RAvailableIAPList iapList; CleanupClosePushL( iapList ); - for ( TInt index = 0; index < aIapInfo.iCount; index++ ) + for ( TUint index = 0; index < aIapInfo.iCount; index++ ) { if ( CommsDatAccess()->CheckWlanL( aIapInfo.iIap[index].iIapId ) != ENotWlanIap ) { @@ -1847,7 +1816,7 @@ RArray packetDataIapIds; CleanupClosePushL( packetDataIapIds ); - for ( TInt index = 0; index < aIapInfo.iCount; index++ ) + for ( TUint index = 0; index < aIapInfo.iCount; index++ ) { if ( CommsDatAccess()->GetBearerTypeL( aIapInfo.iIap[index].iIapId ) == EMPMBearerTypePacketData ) @@ -1876,7 +1845,7 @@ { // Check if used WLAN is still available TBool currentWlanIapAvailable = EFalse; - for ( TInt iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ ) + for ( TUint iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ ) { if ( aIapInfo.iIap[iapIndex].iIapId == iActiveBMConns[index].iConnInfo.iIapId ) @@ -2005,7 +1974,7 @@ MPMLOGSTRING2( "CMPMServer::NotifyDisconnectL: \ Disconnected Connection Id = 0x%x", iSessions[sIndex]->ConnectionId() ) - iSessions[sIndex]->ClientErrorNotificationL( KErrDisconnected ); + iSessions[sIndex]->ClientErrorNotificationL( KErrForceDisconnected ); } } } @@ -2063,6 +2032,49 @@ return serverSession; } +// --------------------------------------------------------------------------- +// CMPMServer::StopCellularConns +// Stop all cellular connections except MMS +// --------------------------------------------------------------------------- +// +void CMPMServer::StopCellularConns() + { + MPMLOGSTRING( "CMPMServer::StopCellularConns" ) + + TUint32 iapId; + TMPMBearerType bearerType = EMPMBearerTypeNone; + + // No cleanup stack used cause this function doesn't leave. + RArray stoppedIaps; + + // Check through active connections + for (TInt i = 0; i < iActiveBMConns.Count(); i++) + { + iapId = iActiveBMConns[i].iConnInfo.iIapId; + + // Don't stop the same IAP twice. + if (stoppedIaps.Find( iapId ) == KErrNotFound) + { + TRAPD( err, bearerType = CommsDatAccess()->GetBearerTypeL( iapId ) ); + if (err == KErrNone && + iapId != 0 && + bearerType == EMPMBearerTypePacketData) + { + TInt mmsIap( 0 ); + err = RProperty::Get( KMPMCathegory, KMPMPropertyKeyMMS, mmsIap ); + // Check that it's not MMS IAP. + if (!(err == KErrNone && iapId == mmsIap)) + { + // Stop the conn / IAP. + StopConnections( iapId ); + stoppedIaps.Append( iapId ); + } + } + } + } + stoppedIaps.Close(); + } + // ----------------------------------------------------------------------------- // TMPMBlackListConnId::Append // ----------------------------------------------------------------------------- diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmserversession.cpp --- a/bearermanagement/mpm/src/mpmserversession.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/mpmserversession.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -138,6 +138,9 @@ User connection deactivated" ) } + // Clean up the blacklist table + iMyServer.HandleServerUnblackListIap( iConnId, 0 ); + // Make sure the connection is removed from server's information array. iMyServer.RemoveBMConnection( iConnId, *this ); } @@ -445,6 +448,9 @@ // iAppUid = aMessage.Int2(); + MPMLOGSTRING2( "CMPMServerSession::HandleServerChooseIapL: \ +Client UID = 0x%x", iAppUid ) + if ( !iIapSelection ) { iIapSelection = CMPMIapSelection::NewL( iMyServer.CommsDatAccess(), @@ -703,11 +709,6 @@ iMyServer.AppendBMIAPConnectionL( startedIap, startedId, *this ); - // Unblacklist all IAPs related to the connection error - // when connection has started. - // - iMyServer.HandleServerUnblackListIap( startedId, ETemporary ); - // Complete the message as soon as possible to avoid latency in BM // aMessage.Complete( KErrNone ); @@ -933,22 +934,13 @@ { if ( MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming ) { - //Check if cellular data usage query has already been presented to the user in this country - if ( MyServer().RoamingWatcher()->AskCellularDataUsageAbroad() == true ) - { - //International roaming - iConfirmDlgRoaming = CMPMConfirmDlgRoaming::NewL( - *this, - snapId, - iMigrateIap, - CMPMConfirmDlg::EConfirmDlgVisitorNetwork, - reconnect ); - } - else - { - //Handle like user would have answered "Connect this time" to dialog - RoamingConfirmationCompletedL( KErrNone, EMsgQueryThisTime, reconnect ); - } + //International roaming + iConfirmDlgRoaming = CMPMConfirmDlgRoaming::NewL( + *this, + snapId, + iMigrateIap, + CMPMConfirmDlg::EConfirmDlgVisitorNetwork, + reconnect ); } else { @@ -1105,13 +1097,6 @@ TRAP_IGNORE(MyServer().CommsDatAccess()->WriteGenConnSettingsL( genConnSettings )); } } - else - { - //In foreign country connect automatically is not stored in commsdat - //even user selected so. We just do not ask confirmation for the cellular - //connection again in this country: - MyServer().RoamingWatcher()->SetAskCellularDataUsageAbroad( false ); - } } //user selected connect this time @@ -2671,8 +2656,8 @@ // Required notifications must go through whenever MPM decides // to initiate them. // - if( ( iStoredIapInfo.HoldPrefIapNotif() && aCaller == EConnMon ) || - ( state == ERoaming && aCaller == EConnMon ) ) + if( ( aCaller == EConnMon || aCaller == EConnMonEvent ) && + ( iStoredIapInfo.HoldPrefIapNotif() || state == ERoaming) ) { MPMLOGSTRING( "CMPMServerSession::PrefIAPNotificationL - \ Mobility ongoing, notification will be handled later" ) @@ -2714,7 +2699,8 @@ tempMpmConnPref.SetSnapId( snap ); IapSelectionL()->ChooseBestIAPL( tempMpmConnPref, availableIAPList ); validateIapId = tempMpmConnPref.IapId(); - if ( ( validateIapId == 0 ) && ( aCaller == EConnMon ) ) + if ( ( validateIapId == 0 ) + && ( aCaller == EConnMon || aCaller == EConnMonEvent ) ) { // Since Connection Monitor is the only component which // is unaware of Connection Id and SNAP, it can't send @@ -2724,8 +2710,19 @@ // All the other components take responsibility of // sending the error notification. // - TRAP_IGNORE( ErrorNotificationL( KErrNotFound, - EMPMMobilityErrorNotification ) ) + // Do not send the error if this call came from ConnMon Event. + // This will prevent unnecessary mobility errors. + // For example if there is two WLAN networks in Internet destination + // and we get weak indication for the one to which we are connected. + // Then connmon signals us with IAPAvailabilityChange which results + // to no available IAPs. We should not report error in that case. + if ( aCaller == EConnMon ) + { + TRAP_IGNORE( ErrorNotificationL( KErrNotFound, + EMPMMobilityErrorNotification ) ); + } + CleanupStack::PopAndDestroy( &availableIAPList ); + return; } TUint32 retNetId = 0; diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/mpmwlanavailability.cpp --- a/bearermanagement/mpm/src/mpmwlanavailability.cpp Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: WLAN bearer availability check -* -*/ - -/** -@file mpmwlanavailability.cpp -WLAN bearer availability check -*/ - -// INCLUDE FILES -#include "mpmwlanavailability.h" -#include "mpmlogger.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CWlanAvailability::NewL -// ----------------------------------------------------------------------------- -// -CWlanAvailability* CWlanAvailability::NewL( CMPMConnMonEvents* aConnMonEvents, - RConnectionMonitor& aConnMon ) - { - CWlanAvailability* self = new ( ELeave ) CWlanAvailability( aConnMonEvents, - aConnMon ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::CWlanAvailability -// ----------------------------------------------------------------------------- -// -CWlanAvailability::CWlanAvailability( CMPMConnMonEvents* aConnMonEvents, - RConnectionMonitor& aConnMon ) - : CActive( CActive::EPriorityStandard ), - iConnMonEvents( aConnMonEvents ), - iConnMon( aConnMon ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::ConstructL -// ----------------------------------------------------------------------------- -// -void CWlanAvailability::ConstructL() - { - iObserver.Reset(); - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::Start -// ----------------------------------------------------------------------------- -// -void CWlanAvailability::Start( MWlanAvailability* aObserver ) - { - MPMLOGSTRING( "CWlanAvailability::Start" ) - - iObserver.Append( aObserver ); - - if ( !IsActive() ) - { - iConnMon.GetBoolAttribute( EBearerIdWLAN, - 0, - KBearerAvailability, - iResult, - iStatus ); - SetActive(); - } - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::CancelObserver -// ----------------------------------------------------------------------------- -// -void CWlanAvailability::CancelObserver( MWlanAvailability* aObserver ) - { - MPMLOGSTRING( "CWlanAvailability::CancelObserver" ) - - for ( TInt i=0; i < iObserver.Count(); i++ ) - { - if ( iObserver[ i ] == aObserver ) - { - iObserver.Remove( i ); - } - } - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::~CWlanAvailability -// ----------------------------------------------------------------------------- -// -CWlanAvailability::~CWlanAvailability() - { - MPMLOGSTRING( "CWlanAvailability::~CWlanAvailability" ) - - Cancel(); - - iObserver.Close(); - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::RunL -// ----------------------------------------------------------------------------- -// -void CWlanAvailability::RunL() - { - if ( iStatus.Int() != KErrNone ) - { - MPMLOGSTRING2( "CWlanAvailability::RunL status %d", iStatus.Int() ) - } - - for ( TInt i=0; i < iObserver.Count(); i++ ) - { - iObserver[ i ]->WlanAvailabilityResponse( iStatus.Int(), iResult ); - } - - iObserver.Reset(); - - // we are done - iConnMonEvents->SetWlanAvailabilityPtrNull(); - delete this; - } - -// ----------------------------------------------------------------------------- -// CWlanAvailability::DoCancel -// ----------------------------------------------------------------------------- -// -void CWlanAvailability::DoCancel() - { - MPMLOGSTRING( "CWlanAvailability::DoCancel" ) - - iConnMon.CancelAsyncRequest( KBearerAvailability ); - - for ( TInt i=0; i < iObserver.Count(); i++ ) - { - iObserver[ i ]->WlanAvailabilityResponse( KErrCancel, iResult ); - } - } - -// End of file diff -r 77415202bfc8 -r fcbbe021d614 bearermanagement/mpm/src/rmpm.cpp --- a/bearermanagement/mpm/src/rmpm.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/bearermanagement/mpm/src/rmpm.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -277,7 +277,7 @@ TRequestStatus& /*aStatus*/ ) { __ASSERT_ALWAYS( EFalse, Panic( KErrNotSupported ) ); - //-jl- TODO remove this function from the API. + // TODO remove this function from the API. } // ----------------------------------------------------------------------------- @@ -324,7 +324,7 @@ const TConnectionId /*aConnId*/ ) { __ASSERT_ALWAYS( EFalse, Panic( KErrNotSupported ) ); - //-jl- TODO remove this function from the API. + // TODO remove this function from the API. return NULL; } diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/Inc/cmdlg.h --- a/cmmanager/cmmgr/Framework/Inc/cmdlg.h Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Framework/Inc/cmdlg.h Fri Apr 16 15:21:37 2010 +0300 @@ -187,6 +187,11 @@ virtual void ConstructCMArrayL( RArray& aCmIds ); + /** + * Remove hidden Connection Methods from the Array + */ + virtual void ClearHiddenCMsFromArrayL( RArray& aCmIds ); + public: /** * From base class MCmdExec @@ -214,11 +219,7 @@ * Reorder connection methods according to underlying connection in case of vpn */ void ReOrderCMsL(); - - /** - * Remove hidden Connection Methods from the Array - */ - void ClearHiddenCMsFromArrayL( RArray& aCmIds ); + /** * Get a proper index in list for priority diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/Inc/uncatdlg.h --- a/cmmanager/cmmgr/Framework/Inc/uncatdlg.h Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Framework/Inc/uncatdlg.h Fri Apr 16 15:21:37 2010 +0300 @@ -69,6 +69,11 @@ */ void ConstructCMArrayL( RArray& aCmIds ); + /** + * Remove hidden Connection Methods from the Array + */ + void ClearHiddenCMsFromArrayL( RArray& aCmIds ); + public: // From MCmCommsDatWatcher /** @@ -122,4 +127,4 @@ #endif -// End of File \ No newline at end of file +// End of File diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -381,8 +381,8 @@ Cba()->DrawNow(); CleanupStack::PopAndDestroy( text ); } + CAknRadioButtonSettingPage::SelectCurrentItemL(); } - CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); } break; diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/Src/uncatdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/uncatdlg.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Framework/Src/uncatdlg.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -226,6 +226,7 @@ { TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_UNCAT_EMPTY, TCmCommonUi::ECmInfoNote ); + iCmManager->WatcherUnRegister(); TryExitL( KDialogUserBack ); } } @@ -295,6 +296,7 @@ { TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_UNCAT_EMPTY, TCmCommonUi::ECmInfoNote ); + iCmManager->WatcherUnRegister(); TryExitL( KDialogUserBack ); } } @@ -389,6 +391,36 @@ } // -------------------------------------------------------------------------- +// CCmDlg::ClearHiddenCMsFromArrayL +// -------------------------------------------------------------------------- +// +void CUncatDlg::ClearHiddenCMsFromArrayL( RArray& aCmIds ) + { + TBool hidden( EFalse ); + TInt err( KErrNone ); + for ( TInt index = 0; index < aCmIds.Count(); index++ ) + { + TUint recId = aCmIds[index]; + TRAP( err, hidden = iCmManager->GetConnectionMethodInfoBoolL( recId, ECmHidden ) ); + if ( err || hidden ) + { + aCmIds.Remove( index ); + index--; + // Remove the same item from iCmUncatItems array + for( TInt i = 0; i < iCmUncatItems.Count(); i++ ) + { + if( iCmUncatItems[i].iCmId == recId ) + { + iCmUncatItems.Remove( i ); + break; + } + } + } + } + } + + +// -------------------------------------------------------------------------- // CUncatDlg::CleanupUncatArray // -------------------------------------------------------------------------- // diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/SrcData/cmmanager.rss --- a/cmmanager/cmmgr/Framework/SrcData/cmmanager.rss Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Framework/SrcData/cmmanager.rss Fri Apr 16 15:21:37 2010 +0300 @@ -565,6 +565,7 @@ { type = KDestListboxType; id = KDestListboxId; + itemflags = EEikDlgItemTakesEnterKey; control= LISTBOX { flags = EAknListBoxSelectionList;}; } }; @@ -715,6 +716,7 @@ { type = KCmListboxType; id = KCmListboxId; + itemflags = EEikDlgItemTakesEnterKey; control= LISTBOX { flags = EAknListBoxSelectionList;}; } }; diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Framework/conf/cmmanager_10207376.crml Binary file cmmanager/cmmgr/Framework/conf/cmmanager_10207376.crml has changed diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginvpn.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginvpn.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginvpn.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -31,7 +31,7 @@ #include // #include #include -#include +#include #include #include #include diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlan.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlan.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlan.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -1922,6 +1922,12 @@ // Pre-shared - go to step 7 // EAP - go to step 8 case EWlanConnectionExtentedSecurityMode802d1x: + TCmCommonUi::ShowNoteL( *( StringLoader::LoadLC( + R_QTN_NETW_CONSET_INFO_EAP_SETTINGS_DEFAULT ) ), + TCmCommonUi::ECmInfoNote ); + CleanupStack::PopAndDestroy(); + break; + case EWlanConnectionExtentedSecurityModeWpa: case EWlanConnectionExtentedSecurityModeWpaPsk: case EWlanConnectionExtentedSecurityModeWpa2: diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/cmmgr/database/src/cmmanagertableformats.cpp --- a/cmmanager/cmmgr/database/src/cmmanagertableformats.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/cmmgr/database/src/cmmanagertableformats.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -133,7 +133,10 @@ | KCDTIdCellularDataUsageHome ), iCellularDataUsageVisitor( ( aElementId & KCDMaskShowRecordType ) | KCDTIdCellularDataUsageVisitor ) - {}; + { + iCellularDataUsageHome.SetAttributes(ECDProtectedWrite); + iCellularDataUsageVisitor.SetAttributes(ECDProtectedWrite); + }; EXPORT_C TMDBElementId CCDDefConnRecord::TableIdL( CMDBSession& aSession ) diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/data/gsconnsettingspluginrsc.rss --- a/cmmanager/gsconnsettingsplugin/data/gsconnsettingspluginrsc.rss Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/data/gsconnsettingspluginrsc.rss Fri Apr 16 15:21:37 2010 +0300 @@ -323,22 +323,6 @@ //---------------------------------------------------- // -// r_usage_of_new_wlan_setting_page -// Resource for "Join new WLAN networks" setting page. -// -//---------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_usage_of_wlan_setting_page - { - number = EAknSettingPageNoOrdinalDisplayed; - label = qtn_occ_sett_usage_of_wlan; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - type = EAknSetListBox; - editor_resource_id = r_setting_listbox; - } - -//---------------------------------------------------- -// // r_usage_of_new_wlan_setting_page_lbx // Resource for "Join new WLAN networks" listbox items // @@ -520,20 +504,4 @@ // RESOURCE TBUF r_gs_conn_settings_rsk_label_exit { buf = text_softkey_exit; } - -RESOURCE ARRAY r_usage_of_wlan_info_popup_texts - { - items = - { - LBUF - { - txt = qtn_occ_info_popup_wlan_usage_known; - }, - LBUF - { - txt = qtn_occ_info_popup_wlan_usage_manual; - } - }; - } - // End of file diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.h --- a/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.h Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,8 +20,8 @@ #define GSCONNSETTINGSPLUGIN_H // Includes -#include -#include +#include +#include #include "gsconnsettingsmskobserver.h" #include diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.hrh --- a/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.hrh Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugin.hrh Fri Apr 16 15:21:37 2010 +0300 @@ -50,7 +50,8 @@ enum { EDataUsageAbroadAutomatic = 0, EDataUsageAbroadConfirm = 1, - EDataUsageAbroadWlanOnly = 2 + EDataUsageAbroadWlanOnly = 2, + EDataUsageAbroadDisabled = 3 }; //Indexes for data usage in home NW values @@ -59,7 +60,8 @@ enum { EDataUsageHomeNwAutomatic = 0, EDataUsageHomeNwConfirm = 1, - EDataUsageHomeNwWlanOnly = 2 + EDataUsageHomeNwWlanOnly = 2, + EDataUsageHomeNwDisabled = 3 }; #endif // GSCONNECTIVITYSETTINGSPLUGIN_HRH diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugincontainer.h --- a/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugincontainer.h Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/inc/gsconnsettingsplugincontainer.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ // INCLUDES #include "gsconnsettingspluginmodel.h" -#include +#include // CONSTANTS diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp --- a/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -28,11 +28,11 @@ #include // Includes from GS framework: -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include // For HlpLauncher #include @@ -115,7 +115,7 @@ FeatureManager::InitializeLibL(); iIsWlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); // Unload FeatureManager - FeatureManager::UnInitializeLib(); + FeatureManager::UnInitializeLib(); OpenLocalizedResourceFileL( KGSConnSettingsPluginResourceFileName, iResourceLoader ); @@ -384,7 +384,7 @@ void CGSConnSettingsPlugin::GetHelpContext( TCoeHelpContext& aContext ) { aContext.iMajor = KUidGS; - aContext.iContext = KHLP_OCC_CONN_SETTINGS; + aContext.iContext = KCP_HLP_ADMINISTRATIVE_SETTINGS; } // --------------------------------------------------------------------------- @@ -456,35 +456,12 @@ // void CGSConnSettingsPlugin::ShowUsageOfWlanSettingPageL() { - - CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( - R_USAGE_OF_WLAN_SETTING_PAGE_LBX ); - CleanupStack::PushL( items ); - - TInt currentItem = iModel->UsageOfWlan(); - TInt oldItem = currentItem; - - CGSConnSettingsSelectionDlg* dlg = CGSConnSettingsSelectionDlg::NewL( - R_USAGE_OF_WLAN_SETTING_PAGE, - currentItem, - items, - R_USAGE_OF_WLAN_INFO_POPUP_TEXTS ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - - if( currentItem != oldItem ) - { - iModel->SetUsageOfWlan( currentItem ); - UpdateListBoxL( EGSSettIdUsageOfWlan ); - //Save current settings when the setting is changed - //If function leaves it is trapped and ignored as there is nothing that we can do about it - TRAP_IGNORE(iModel->SaveSettingsL()); - } - } - - CleanupStack::PopAndDestroy( items ); - + TBool currentItem = (TBool)iModel->UsageOfWlan(); + iModel->SetUsageOfWlan( !currentItem ); + UpdateListBoxL( EGSSettIdUsageOfWlan ); + //Save current settings when the setting is changed + //If function leaves it is trapped and ignored as there is nothing that we can do about it + TRAP_IGNORE(iModel->SaveSettingsL()); } // --------------------------------------------------------------------------- @@ -511,6 +488,14 @@ CleanupStack::PushL( items ); TInt currentItem = iModel->DataUsageAbroad(); + + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currentItem == EDataUsageAbroadDisabled ) + { + currentItem --; + } + TInt oldItem = currentItem; CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( @@ -555,6 +540,14 @@ CleanupStack::PushL( items ); TInt currentItem = iModel->DataUsageInHomeNw(); + + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currentItem == EDataUsageAbroadDisabled ) + { + currentItem --; + } + TInt oldItem = currentItem; CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugincontainer.cpp --- a/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugincontainer.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugincontainer.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -26,8 +26,8 @@ #include #include -#include // for KUidGS -#include +#include // for KUidGS +#include // EXTERNAL DATA STRUCTURES @@ -143,7 +143,9 @@ MGSConnSettingsMskObserver& aMskObserver ) : iMskObserver( aMskObserver ) { + FeatureManager::InitializeLibL(); iIsWlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); + FeatureManager::UnInitializeLib(); } void CGSConnSettingsPluginContainer::SetPluginArray ( @@ -311,6 +313,13 @@ { TInt currValue = iModel->DataUsageAbroad(); + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currValue == EDataUsageAbroadDisabled ) + { + currValue --; + } + AppendListItemL( Index( EGSSettIdDataUsageAbroad ), iListItems->operator[]( Index( EGSSettIdDataUsageAbroad ) ), ( *iDataUsageAbroadItems )[currValue] ); @@ -326,6 +335,13 @@ { TInt currValue = iModel->DataUsageInHomeNw(); + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currValue == EDataUsageAbroadDisabled ) + { + currValue --; + } + AppendListItemL( Index( EGSSettIdDataUsageHomeNw ), iListItems->operator[]( Index( EGSSettIdDataUsageHomeNw ) ), ( *iDataUsageHomeNwItems )[currValue] ); @@ -449,7 +465,7 @@ void CGSConnSettingsPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const { aContext.iMajor = KUidGS; - aContext.iContext = KHLP_OCC_CONN_SETTINGS; +// aContext.iContext = KCP_HLP_DISPLAY; } // --------------------------------------------------------------------------- diff -r 77415202bfc8 -r fcbbe021d614 cmmanager/gsconnsettingsplugin/traces/OstTraceDefinitions.h --- a/cmmanager/gsconnsettingsplugin/traces/OstTraceDefinitions.h Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/traces/OstTraceDefinitions.h Fri Apr 16 15:21:37 2010 +0300 @@ -1,3 +1,20 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + #ifndef __OSTTRACEDEFINITIONS_H__ #define __OSTTRACEDEFINITIONS_H__ #include diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/cellularindicatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/cellularindicatorplugin.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin +CONFIG += hb + +# Directories +DEPENDPATH += . +INCLUDEPATH += .\inc + +# Sources +HEADERS += inc\cellularindicatorplugin.h \ + traces\OstTraceDefinitions.h + +SOURCES += src\cellularindicatorplugin.cpp + +symbian*: { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.UID3 = 0x2002C3AB + SYMBIAN_PLATFORMS = WINSCW ARMV5 + BLD_INF_RULES.prj_exports += "rom/cellularindicatorplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cellularindicatorplugin.iby)" + BLD_INF_RULES.prj_exports += "rom/cellularindicatorplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cellularindicatorplugin_resources.iby)" + pluginstub.sources = cellularindicatorplugin.dll + pluginstub.path = /resource/plugins/indicators + DEPLOYMENT += pluginstub +} + +TRANSLATIONS = cellularindicatorplugin.ts + diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CELLULARINDICATORPLUGIN_H +#define CELLULARINDICATORPLUGIN_H + +#include +#include +#include +#include + + +/** + * This class describes cellular indicator plug-in + */ +class CellularIndicatorPlugin : public HbIndicatorInterface, + public HbIndicatorPluginInterface +{ + + Q_OBJECT + Q_INTERFACES(HbIndicatorPluginInterface) + +public: + + CellularIndicatorPlugin(); + ~CellularIndicatorPlugin(); + +public: + + //from HbIndicatorPluginInterface + + // Return indicator type of indicator + QStringList indicatorTypes() const; + + // Access is allowed allways + bool accessAllowed(const QString &indicatorType, + const HbSecurityInfo *securityInfo) const; + + // Create indicator. Currently installs translation. + HbIndicatorInterface* createIndicator(const QString &indicatorType); + + // Return error if any + int error() const; + +public: + + //from HbIndicatorInterface + + // Client requests are directed to here + bool handleClientRequest (RequestType type, const QVariant ¶meter); + + // This called when item is selected in indicator menu + bool handleInteraction(InteractionType type); + + // Used to get indicator data (icon or text) + QVariant indicatorData(int role) const; + +private slots: + // handler for error codes + void processError(QProcess::ProcessError err); + +private: // data + + // Disable copy constructor + Q_DISABLE_COPY(CellularIndicatorPlugin) + // Indicator type + QStringList mIndicatorTypes; + // Error stored to member variable + int mError; + // Used to store the connection info + QVariant mParameter; + // Process to start external programs + QProcess process; +}; + + + + +#endif // CELLULARINDICATORPLUGIN_H diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/rom/cellularindicatorplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/rom/cellularindicatorplugin.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +file=ABI_DIR\BUILD_DIR\cellularindicatorplugin.dll SHARED_LIB_DIR\cellularindicatorplugin.dll +data=\epoc32\data\z\resource\plugins\indicators\cellularindicatorplugin.qtplugin RESOURCE_FILES_DIR\plugins\indicators\cellularindicatorplugin.qtplugin diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/rom/cellularindicatorplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/rom/cellularindicatorplugin_resources.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CELLULARINDICATORPLUGIN_RESOURCES_IBY +#define CELLULARINDICATORPLUGIN_RESOURCES_IBY + +#include +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cellularindicatorplugin.qm QT_TRANSLATIONS_DIR/cellularindicatorplugin.qm + +#endif // CELLULARINDICATORPLUGIN_RESOURCES_IBY diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cellularindicatorplugin.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cellularindicatorpluginTraces.h" +#endif + +Q_EXPORT_PLUGIN(CellularIndicatorPlugin) + +const static char IndicatorType[] = + "com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0"; + +/*! + CellularIndicatorPlugin::CellularIndicatorPlugin + */ +CellularIndicatorPlugin::CellularIndicatorPlugin() : + HbIndicatorInterface(IndicatorType, GroupPriorityAverage, + InteractionActivated), + mError(0) +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_CELLULARINDICATORPLUGIN_ENTRY ); + mIndicatorTypes << + "com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0"; + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_CELLULARINDICATORPLUGIN_EXIT ); +} + +/*! + CellularIndicatorPlugin::~CellularIndicatorPlugin + */ +CellularIndicatorPlugin::~CellularIndicatorPlugin() +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_DCELLULARINDICATORPLUGIN_ENTRY ); + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_DCELLULARINDICATORPLUGIN_EXIT ); +} + +/*! + CellularIndicatorPlugin::indicatorTypes + */ +QStringList CellularIndicatorPlugin::indicatorTypes() const +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_INDICATORTYPES_ENTRY ); + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_INDICATORTYPES_EXIT ); + return mIndicatorTypes; +} + +/*! + CellularIndicatorPlugin::accessAllowed + */ +bool CellularIndicatorPlugin::accessAllowed(const QString &indicatorType, + const HbSecurityInfo *securityInfo) const +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_ACCESSALLOWED_ENTRY ); + Q_UNUSED(indicatorType) + Q_UNUSED(securityInfo) + + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_ACCESSALLOWED_EXIT ); + return true; +} + +/*! + CellularIndicatorPlugin::createIndicator + */ +HbIndicatorInterface* CellularIndicatorPlugin::createIndicator( + const QString &indicatorType) +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_ENTRY ); + + Q_UNUSED(indicatorType) + + // Install localization + QTranslator *translator = new QTranslator(this); + + QString lang = QLocale::system().name(); + QString path = "Z:/resource/qt/translations/"; + translator->load("cellularindicatorplugin_" + lang, path); + qApp->installTranslator(translator); + + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_EXIT ); + return this; +} + +/*! + CellularIndicatorPlugin::error + */ +int CellularIndicatorPlugin::error() const +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_ERROR_ENTRY ); + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_ERROR_EXIT ); + return mError; +} + +/*! + CellularIndicatorPlugin::handleClientRequest + */ +bool CellularIndicatorPlugin::handleClientRequest(RequestType type, + const QVariant ¶meter) +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_HANDLECLIENTREQUEST_ENTRY ); + + bool handled(false); + + switch (type) { + case RequestActivate: + if (mParameter != parameter) { + mParameter = parameter; + emit dataChanged(); + } + handled = true; + break; + + case RequestDeactivate: + mParameter.clear(); + break; + + default: + // Do nothing + break; + } + + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_HANDLECLIENTREQUEST_EXIT ); + return handled; +} + +/*! + CellularIndicatorPlugin::handleInteraction + */ +bool CellularIndicatorPlugin::handleInteraction(InteractionType type) +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_HANDLEINTERACTION_ENTRY ); + + Q_UNUSED(type) + bool handled = false; + + switch(type) { + case InteractionActivated: + //connect error() to slot processError() to get error, + QObject::connect( &process, SIGNAL(error(QProcess::ProcessError)), + this, SLOT(processError(QProcess::ProcessError))); + + // Show connection view + process.start("connview"); + handled = true; + break; + + default: + break; + } + + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_HANDLEINTERACTION_EXIT ); + return handled; +} + +/*! + CellularIndicatorPlugin::indicatorData +*/ +QVariant CellularIndicatorPlugin::indicatorData(int role) const +{ + OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_INDICATORDATA_ENTRY ); + QVariant ret = NULL; + + switch(role) { + case PrimaryTextRole: + ret = QString(hbTrId("txt_occ_dblist_cellular_data")); + break; + + case SecondaryTextRole: + if (mParameter.isValid() && (mParameter.type() == QVariant::List)) { + + QList indicatorInfo; + indicatorInfo = mParameter.toList(); + + if (!indicatorInfo.count()) { + // No entries on the list -> don't even try to use this + break; + } + + if ( (indicatorInfo[0].toInt() > 1) && indicatorInfo.count() ) { + + // More than one connection -> show number of connections + QString str = QString(hbTrId("txt_occ_dblist_cellular_data_val_l1_connections")); + ret = str.arg(indicatorInfo[0].toInt()); + } + else if ( indicatorInfo[0].toInt() && (indicatorInfo.count() >= 2)) { + + // Only one connection -> show name of the iap + QString iapName; + iapName = indicatorInfo[1].toString(); + QString str = QString(hbTrId("txt_occ_dblist_cellular_data_val_1_connected")); + ret = str.arg(iapName); + } + } + break; + + case IconNameRole: + case DecorationNameRole: + // Return the icon + ret = HbIcon("qtg_small_gprs"); + break; + + default: + // Do nothing + break; + } + + OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_INDICATORDATA_EXIT ); + return ret; +} + +/*! + The processError is a handler for error codes. +*/ +void CellularIndicatorPlugin::processError(QProcess::ProcessError err) + { + OstTraceFunctionEntry1(CELLULARINDICATORPLUGIN_PROCESSERROR_ENTRY, this); + + switch (err) { + case QProcess::FailedToStart: + case QProcess::Crashed: + case QProcess::Timedout: + case QProcess::ReadError: + case QProcess::WriteError: + case QProcess::UnknownError: + OstTrace1( CELLULARINDICATORPLUGIN_ERR,PROCESSERROR_KNOWN,"Process Error %u", err); + break; + default: + OstTrace1( CELLULARINDICATORPLUGIN_ERR,PROCESSERROR_UNKNOWN,"Unknown Process Error %u", err); + break; + } + OstTraceFunctionExit1(CELLULARINDICATORPLUGIN_PROCESSERROR_EXIT, this); + } + diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/cellularindicatorplugin/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/cellularindicatorplugin/traces/OstTraceDefinitions.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionmonitoring.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionmonitoring.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += \ + cellularindicatorplugin \ + indicatorobserver \ + connectionview + +CONFIG += ordered + +symbian*: { + SYMBIAN_PLATFORMS = WINSCW ARMV5 +} diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionmonitorplugin/inc/connectionmonitorplugin.h --- a/connectionmonitoring/connectionmonitorplugin/inc/connectionmonitorplugin.h Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connectionmonitorplugin/inc/connectionmonitorplugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ // User includes // System includes -#include +#include #include #include #include diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionmonitorplugin/src/connectionmonitorplugin.cpp --- a/connectionmonitoring/connectionmonitorplugin/src/connectionmonitorplugin.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connectionmonitorplugin/src/connectionmonitorplugin.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -18,12 +18,12 @@ // User includes #include "connectionmonitorplugin.h" -#include -#include +#include +#include #include // GUI Resource #include -#include -#include +#include +#include // System includes #include diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp --- a/connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -19,7 +19,7 @@ // INCLUDE FILES #include -#include +#include #include #include #include diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiAppUi.cpp --- a/connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiAppUi.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiAppUi.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "ConnectionMonitorUi.hrh" #include "ConnectionMonitorUiAppUi.h" @@ -354,8 +354,10 @@ break; } } - - if ( newConn ) + + index = iConnectionArray->GetArrayIndex( connectionId ); + + if ( newConn || ( index < 0 ) ) { if ( connectionId > 0) { diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/connectionview.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/connectionview.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Connection view build file +# +# +TEMPLATE = app +TARGET = connview +CONFIG += hb no_icon +DEPENDPATH += . inc src +INCLUDEPATH += . + +# Input +HEADERS += inc/connectionview.h \ + traces/OstTraceDefinitions.h \ + inc/scrollareawidget.h +SOURCES += src/connectionview.cpp \ + src/main.cpp \ + src/scrollareawidget.cpp + +TRANSLATIONS = connectionview.ts + +RESOURCES = res/connectionview.qrc + +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +LIBS += -lqtbearer + +symbian { + TARGET.CAPABILITY = NetworkServices NetworkControl + TARGET.UID3 = 0x2002C36A + BLD_INF_RULES.prj_exports += "rom/connectionview.iby CORE_MW_LAYER_IBY_EXPORT_PATH(connectionview.iby)" + BLD_INF_RULES.prj_exports += "rom/connectionview_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(connectionview_resources.iby)" +} \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/inc/connectionview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/inc/connectionview.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __CONNECTIONVIEW_H__ +#define __CONNECTIONVIEW_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QTM_USE_NAMESPACE + +class QSignalMapper; + +const QString bearer2G = "2G"; +const QString bearerWCDMA = "WCDMA"; +const QString bearerHSPA = "HSPA"; +const QString bearerCDMA2000 = "CDMA2000"; +const int timerValue = 3000; + +class ConnectionView: public HbMainWindow + { + Q_OBJECT + + public: + /* Constructor */ + ConnectionView(); + + /* Destructor */ + ~ConnectionView(); + + /** + * This is the re-implemented timerEvent function used to trigger + * closing of the application. It is received every time the set timer expires. + */ + void timerEvent(QTimerEvent * /*event*/); + + private slots: + /* Handles the changes in the cellular data connections */ + void handleConfigurationChanged(const QNetworkConfiguration& config); + + /* Disonnects the iap given as a parameter */ + void disconnectSelectedIap(int iapId); + + /* Disconnects all the cellular iaps */ + void disconnectAll(); + + /* + * Does the actual stopping of the sessions, once the session's + * opened-signal is received + */ + void stopSessions(); + + /* Deletes the sender when the session opening fails */ + void errorSessions(QNetworkSession::SessionError); + + private: + + /* Constructs the view */ + void createView(); + + /* + * Creates group boxes into the view for all the active cellular + * connections. + */ + void createGroupBoxesForConnections(); + + /* + * Updates the list of active cellular connections into the + * list received as a reference parameter. + */ + void getActiveCellularConnections(QList &activeConfigurations); + + /* + * Creates a single groupbox for the iap given as a paremeters. Attaches the + * group boxes disconnect button to the disconnectSelectedIap slot + */ + void addGroupBox(int iapId, QString iapName); + + /* Clears the groupboxes from the view */ + void clearGroupBoxView(); + + private: + /* Pointer to network configuration manager */ + QNetworkConfigurationManager* mNetConfigurationManager; + + /* Pointer to the main view of the window */ + HbView *mMainView; + + /* The main vertical layout which contains the group box container */ + QGraphicsLinearLayout* mMainLayout; + + /* The scroll area of the view */ + HbScrollArea *mScrollArea; + + /* The layout into which the groupboxes are inserted */ + QGraphicsLinearLayout *mBoxLayout; + + /* + * Pointer to the signalmapper used in mapping the disconnect buttons clicks + * to the disconnectSelectedIap function + */ + QSignalMapper *mSignalMapper; + + /* The amount of active cellular data connections */ + int mConnectionCount; + + /* The toolbar on the view */ + HbToolBar *mToolBar; + + /* The toolbar action which can be used to disconnect all the connections */ + HbAction *mDisconnectAction; + + /* The label used to inform if there are no active connections */ + HbLabel *mInfoLabel; + + /* The id of the timer used to close the application */ + int mClosingTimer; + + /* definition for unit test purposes */ + friend class TestConnectionView; + + }; + + +#endif // __CONNECTIONVIEW_H__ diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/inc/scrollareawidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/inc/scrollareawidget.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef SCROLLAREAWIDGET_H_ +#define SCROLLAREAWIDGET_H_ + +#include +#include +#include + +QTM_USE_NAMESPACE + +class ScrollAreaWidget: public QGraphicsWidget +{ + Q_OBJECT + +public: + /* Constructor */ + ScrollAreaWidget(QGraphicsItem *parent = 0); + + /* Destructor */ + ~ScrollAreaWidget(); + + /* + * Function to filter all the resizing events to get the widget to + * resize itself when switched to landscape and back + */ + bool eventFilter(QObject *object, QEvent *event); +}; + +#endif /* SCROLLAREAWIDGET_H_ */ diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/res/connectionview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/res/connectionview.css Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +HbLabel#mInfoLabel::text +{ + font-variant: secondary; + text-height: var(hb-param-text-height-secondary); + text-align: center; +} + +HbGroupBox#groupBox::headingWidget:portrait +{ + fixed-width: expr(var(hb-param-screen-width)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); +} + +HbGroupBox#groupBox::contentWidget:portrait +{ + fixed-width: expr(var(hb-param-screen-width)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); +} + +HbGroupBox#groupBox::headingWidget:landscape +{ + fixed-width: expr(var(hb-param-screen-height)-var(hb-param-margin-gene-top)-var(hb-param-margin-gene-bottom)-var(hb-param-widget-toolbar-height)); +} + +HbGroupBox#groupBox::contentWidget:landscape +{ + fixed-width: expr(var(hb-param-screen-height)-var(hb-param-margin-gene-top)-var(hb-param-margin-gene-bottom)-var(hb-param-widget-toolbar-height)); +} diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/res/connectionview.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/res/connectionview.qrc Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,6 @@ + + + + connectionview.css + + \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/rom/connectionview.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/rom/connectionview.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CONNECTIONVIEW_IBY +#define CONNECTIONVIEW_IBY + +#include + +file=ABI_DIR\BUILD_DIR\connview.exe PROGRAMS_DIR\connview.exe +data=\epoc32\data\z\private\10003a3f\import\Apps\connview_reg.rsc \private\10003a3f\import\apps\connview_reg.rsc +data=\epoc32\data\z\resource\apps\connview.rsc \resource\apps\connview.rsc + +#endif // CONNECTIONVIEW_IBY \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/rom/connectionview_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/rom/connectionview_resources.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CONNECTIONVIEW_RESOURCES_IBY +#define CONNECTIONVIEW_RESOURCES_IBY + +#include +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/connectionview.qm QT_TRANSLATIONS_DIR/connectionview.qm + +#endif // CONNECTIONVIEW_RESOURCES_IBY diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/src/connectionview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/src/connectionview.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,496 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "connectionview.h" +#include "scrollareawidget.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "connectionviewTraces.h" +#endif + + + +QTM_USE_NAMESPACE + + +ConnectionView::ConnectionView(): + mNetConfigurationManager(new QNetworkConfigurationManager(this)), + mSignalMapper(new QSignalMapper(this)), + mConnectionCount(0), + mClosingTimer(0) +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_CONNECTIONVIEW_ENTRY ); + // Install localization + QTranslator *translator = new QTranslator(this); + QString lang = QLocale::system().name(); + QString path = "Z:/resource/qt/translations/"; + translator->load("connectionview_" + lang, path); + qApp->installTranslator(translator); + + // Register custom layout location + bool registerStatus = HbStyleLoader::registerFilePath(":/layout/"); + Q_ASSERT(registerStatus); + + // Map the configurationChanged signal to a slot in order to get + // information about the changes in the connections + bool connectStatus = connect( + mNetConfigurationManager, + SIGNAL(configurationChanged(const QNetworkConfiguration&)), + this, + SLOT(handleConfigurationChanged(const QNetworkConfiguration&))); + + // Create the view and show it + createView(); + OstTraceFunctionExit0( CONNECTIONVIEW_CONNECTIONVIEW_EXIT ); +} + + +ConnectionView::~ConnectionView() +{ + OstTraceFunctionEntry0( DUP1_CONNECTIONVIEW_CONNECTIONVIEW_ENTRY ); + // other widgets are childs of this widget, so they will be + // deleted along with mMainView. Add infolabel and scrollarea + // again under mainlayout, since one of them is only there at the time + // this way all the ui components are deleted at once + mInfoLabel->setParentLayoutItem(mMainLayout); + mScrollArea->setParentLayoutItem(mMainLayout); + delete mMainView; + OstTraceFunctionExit0( DUP1_CONNECTIONVIEW_CONNECTIONVIEW_EXIT ); +} + +/* ! + Quit the application when the timer is triggered +*/ +void ConnectionView::timerEvent(QTimerEvent * /*event*/) +{ + killTimer(mClosingTimer); + mClosingTimer = 0; + qApp->quit(); +} + + +/*! + Builds the actual view for the main window +*/ +void ConnectionView::createView() +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_CREATEVIEW_ENTRY ); + + // Create the mainView and the layout for the window + mMainView = new HbView(); + addView(mMainView); + setCurrentView(mMainView); + + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mMainLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mScrollArea = new HbScrollArea(); + mScrollArea->setScrollDirections(Qt::Vertical); + mScrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mMainLayout->addItem(mScrollArea); + + // Create the widgets and layouts for the scroll area + ScrollAreaWidget *scrollContent = new ScrollAreaWidget(); + scrollContent->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mScrollArea->installEventFilter(scrollContent); + + mBoxLayout = new QGraphicsLinearLayout(Qt::Vertical); + mBoxLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + scrollContent->setLayout(mBoxLayout); + mMainView->setLayout(mMainLayout); + mScrollArea->setContentWidget(scrollContent); + + // Create the toolbar and the disconnection action + mToolBar = new HbToolBar(); + HbIcon icon("qtg_mono_disconnect"); + mDisconnectAction = mToolBar->addAction(icon, hbTrId("txt_occ_button_disconnect_all")); + mMainView->setToolBar(mToolBar); + bool connectStatus = connect( + mDisconnectAction, + SIGNAL(triggered(bool)), + this, + SLOT(disconnectAll())); + + // label for informing the user that there are no connections + mInfoLabel = new HbLabel; + mInfoLabel->setObjectName("mInfoLabel"); + mInfoLabel->setPlainText(hbTrId("txt_occ_info_no_active_connections")); + mInfoLabel->setAlignment(Qt::AlignCenter); + + // Create the actual groupboxes for all the active connections + createGroupBoxesForConnections(); + show(); + + OstTraceFunctionExit0( CONNECTIONVIEW_CREATEVIEW_EXIT ); +} + + +/*! + Loops all the active cellular connections and creates groupboxes for those +*/ +void ConnectionView::createGroupBoxesForConnections() +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_CREATEGROUPBOXESFORCONNECTIONS_ENTRY ); + + // disconnect all the old connections and then make the new connections + mSignalMapper->disconnect(); + + //Let's find active connections if any + QList activeConfigurations; + getActiveCellularConnections(activeConfigurations); + + // If there are no active connections, then the dialog is not shown to the user + mConnectionCount = activeConfigurations.count(); + + // Toolbar is shown only if there are more than one connections active + if (mConnectionCount > 1) { + mToolBar->show(); + } else { + mToolBar->hide(); + } + + // if there are connections, then the label should be removed + // and the connection boxes drawn + if (mConnectionCount > 0) { + mMainLayout->removeItem(mInfoLabel); + mInfoLabel->hide(); + mMainLayout->addItem(mScrollArea); + + for (int i=0; iremoveItem(mScrollArea); + mInfoLabel->show(); + mMainLayout->addItem(mInfoLabel); + mMainLayout->setAlignment(mInfoLabel, Qt::AlignCenter); + // start the timer to close the application after 3 seconds + if (mClosingTimer == 0) { + mClosingTimer = startTimer(timerValue); + } + } + + OstTraceFunctionExit0( CONNECTIONVIEW_CREATEGROUPBOXESFORCONNECTIONS_EXIT ); +} + + +/* + Returns a list of all the available active cellular connections +*/ +void ConnectionView::getActiveCellularConnections(QList &activeConfigurations) +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_GETACTIVECELLULARCONNECTIONS_ENTRY ); + //Let's find active connections if any + activeConfigurations.clear(); + + QList configurations = + mNetConfigurationManager->allConfigurations(QNetworkConfiguration::Active); + + // Connection are open if they are in active state + for (int i=0; isetObjectName("groupBox"); + groupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); + groupBox->setHeading(hbTrId("txt_occ_subhead_connection_details")); + groupBox->setCollapsable(true); + + // Create the disconnection button + HbPushButton* button = new HbPushButton( + hbTrId("txt_occ_button_disconnect"), mMainView); + button->setSizePolicy(QSizePolicy::Preferred, + QSizePolicy::Preferred, + QSizePolicy::PushButton); + + // Create the horizontal layout for the labels + QGraphicsLinearLayout *labelLayout = new QGraphicsLinearLayout(Qt::Horizontal); + labelLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + HbLabel *typeLabel = new HbLabel(hbTrId("txt_occ_list_name")); + HbLabel *nameLabel = new HbLabel(iapName); + nameLabel->setAlignment(Qt::AlignRight); + labelLayout->addItem(typeLabel); + labelLayout->addItem(nameLabel); + + HbWidget *labelWidget = new HbWidget(); + labelWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + labelWidget->setLayout(labelLayout); + + // a layout cannot be added directly to a layout, we need to use this container widget + HbWidget *boxWidget = new HbWidget(); + boxWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + QGraphicsLinearLayout *boxLayout = new QGraphicsLinearLayout(Qt::Vertical); + boxLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + boxWidget->setLayout(boxLayout); + + // Add the label layout and the button into the groupbox + boxLayout->addItem(labelWidget); + boxLayout->addItem(button); + boxLayout->setAlignment(button, Qt::AlignHCenter); + groupBox->setContentWidget(boxWidget); + groupBox->setCollapsed(true); + + // add the group box to the main layout + mBoxLayout->addItem(groupBox); + mBoxLayout->setAlignment(groupBox, Qt::AlignHCenter); + + // Expand the groupbox if connection count is 1 + if (mConnectionCount == 1) { + groupBox->setCollapsed(false); + } + + // Connect the button to the mapper + bool connectStatus = connect( + button, + SIGNAL(clicked()), + mSignalMapper, + SLOT(map())); + mSignalMapper->setMapping(button, iapId); + OstTraceFunctionExit0( CONNECTIONVIEW_ADDGROUPBOX_EXIT ); +} + + +/*! + Closes the connection to the given iap +*/ +void ConnectionView::disconnectSelectedIap(int iapId) +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_DISCONNECTSELECTEDIAP_ENTRY ); + + // Get all the active connections + QList activeConfigurations; + getActiveCellularConnections(activeConfigurations); + int count = activeConfigurations.count(); + + for (int i=0; i < count; i++) { + bool ok = true; + int loopedIapId = activeConfigurations[i].identifier().toInt(&ok); + + // if the looped iap matches the iap, stop the connection + if (loopedIapId == iapId) { + + QNetworkSession *networkSession = new QNetworkSession(activeConfigurations[i], mMainView); + + bool connectStatus = connect( + networkSession, + SIGNAL(opened()), + this, + SLOT(stopSessions())); + + // This connection is done basically for memory handling + // to be able to delete the session if one of the error signal is emitted + connect( + networkSession, + SIGNAL(error(QNetworkSession::SessionError)), + this, + SLOT(errorSessions(QNetworkSession::SessionError))); + + // open the session only if the connection succeeded, otherwise it's no use + if (connectStatus) { + // session needs to be opened in order to stop all the sessions of this configurations + networkSession->open(); + } else { + OstTrace1( CONNECTSTATUS, CONNECTIONVIEW_DISCONNECTSELECTEDIAP, "ConnectionView::disconnectSelectedIap failed;iapId=%d", iapId ); + } + + // the searched iap was found, stop looping + break; + } + } + OstTraceFunctionExit0( CONNECTIONVIEW_DISCONNECTSELECTEDIAP_EXIT ); +} + + +/*! + Closes all the connections to active iaps +*/ +void ConnectionView::disconnectAll() +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_DISCONNECTALL_ENTRY ); + + // Get all the active connections + QList activeConfigurations; + getActiveCellularConnections(activeConfigurations); + int count = activeConfigurations.count(); + + for (int i=0; i < count; i++) { + QNetworkSession *networkSession = new QNetworkSession(activeConfigurations[i], mMainView); + bool connectStatus = connect( + networkSession, + SIGNAL(opened()), + this, + SLOT(stopSessions())); + // This connection is done basically for memory handling + // to be able to delete the session if one of the error signal is emitted + connect( + networkSession, + SIGNAL(error(QNetworkSession::SessionError)), + this, + SLOT(errorSessions(QNetworkSession::SessionError))); + + // open the session only if the connection succeeded, otherwise it's no use + if (connectStatus) { + // session needs to be opened in order to stop all the sessions of this configurations + networkSession->open(); + } + } + OstTraceFunctionExit0( CONNECTIONVIEW_DISCONNECTALL_EXIT ); +} + + +void ConnectionView::stopSessions() +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_STOPSESSIONS_ENTRY ); + + // get the sender-session and stop the sessions + QObject *senderObject = QObject::sender(); + if (senderObject != NULL) { + QNetworkSession *session = qobject_cast(senderObject); + session->stop(); + session->deleteLater(); + } + OstTraceFunctionExit0( CONNECTIONVIEW_STOPSESSIONS_EXIT ); +} + +void ConnectionView::errorSessions(QNetworkSession::SessionError) +{ + OstTraceFunctionEntry0( DUP2_CONNECTIONVIEW_ERRORSESSIONS_ENTRY ); + + // something went wrong in session opening + // get the sender-session and delete the sender + QObject *senderObject = QObject::sender(); + if (senderObject != NULL) { + senderObject->deleteLater(); + } + OstTraceFunctionExit0( DUP1_CONNECTIONVIEW_ERRORSESSIONS_EXIT ); +} + +/*! + Removes the items from the boxlayout in order to be costructed again. +*/ +void ConnectionView::clearGroupBoxView() +{ + OstTraceFunctionEntry0( CONNECTIONVIEW_CLEARGROUPBOXVIEW_ENTRY ); + // Loop all the groupbox items through and remove them from the view + int count = mBoxLayout->count(); + for (int i = 0; i < count; i++ ) { + // store the pointer to the item to be able to delete it + QGraphicsLayoutItem *item = mBoxLayout->itemAt(0); + mBoxLayout->removeAt(0); + delete item; + } + OstTraceFunctionExit0( CONNECTIONVIEW_CLEARGROUPBOXVIEW_EXIT ); +} + + + + diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/src/main.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "connectionview.h" + +int main(int argc, char *argv[]) + { + QApplication app(argc, argv); + ConnectionView connDetails; + return app.exec(); + } diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/src/scrollareawidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/src/scrollareawidget.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include "scrollareawidget.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "scrollareawidgetTraces.h" +#endif + + +QTM_USE_NAMESPACE + + +ScrollAreaWidget::ScrollAreaWidget(QGraphicsItem *parent): + QGraphicsWidget(parent) +{ + OstTraceFunctionEntry0( SCROLLAREAWIDGET_SCROLLAREAWIDGET_ENTRY ); + OstTraceFunctionExit0( SCROLLAREAWIDGET_SCROLLAREAWIDGET_EXIT ); +} + +ScrollAreaWidget::~ScrollAreaWidget() +{ + OstTraceFunctionEntry0( DUP1_SCROLLAREAWIDGET_SCROLLAREAWIDGET_ENTRY ); + OstTraceFunctionExit0( DUP1_SCROLLAREAWIDGET_SCROLLAREAWIDGET_EXIT ); +} + +/*! + Filters the resizing events to get the widget resized when switching to + landscape and back +*/ +bool ScrollAreaWidget::eventFilter(QObject *object, QEvent *event) +{ + OstTraceFunctionEntry0( SCROLLAREAWIDGET_EVENTFILTER_ENTRY ); + + if(event->type() == QEvent::GraphicsSceneResize){ + resize(((QGraphicsSceneResizeEvent*)event)->newSize()); + OstTraceFunctionExit0( SCROLLAREAWIDGET_EVENTFILTER_EXIT ); + return true; + } else { + return QGraphicsWidget::eventFilter(object, event); + } +} diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connectionview/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/connectionview/traces/OstTraceDefinitions.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -1699,6 +1699,7 @@ ( aRssClass == EWlanRssClassNormal && previousRssClass == EConnMonWlanRssClassWeak ) ) { LOGIT("Rss class change caused call to HandleAvailabilityChange()") + iWlanSupport->EnableWlanScan(); iServer->AvailabilityManager()->HandleAvailabilityChange(); } diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -33,6 +33,7 @@ #include "connmontelnoti.h" #include "ConnMonBearerNotifier.h" #include "log.h" +#include "cellulardatausagekeyupdater.h" // ============================ MEMBER FUNCTIONS =============================== @@ -1180,6 +1181,7 @@ { LOGENTRFN("CConnMonIAP::GetBearerInfo()") TInt err( KErrNone ); + TBool getBearerCalled( EFalse ); // Find connection matching the given Id TInt index = Index( aConnectionId ); @@ -1198,6 +1200,7 @@ aConnectionId, iConnInfos[index].iBearer, iConnInfos[index].iBearerInfo ); + getBearerCalled = ETrue; } if ( KErrNone == err ) { @@ -1243,17 +1246,21 @@ iConnInfos[index].iBearerInfo.iBearer == EBearerInfoHSUPA || iConnInfos[index].iBearerInfo.iBearer == EBearerInfoHSxPA ) ) { - // CSD/HSCSD info could change after the first query also - // GPRS/EdgeGPRS/WCDMA info can change. - TInt bearer( EBearerUnknown ); - TBearerInfo bearerInfo; - - LOGIT("GetBearerInfo: GetBearer() 2nd query") - err = GetBearer( aConnectionId, bearer, bearerInfo ); - if ( ( KErrNone == err ) && ( bearerInfo.iBearer != EBearerInfoUnknown ) ) + // If GetBearer() was just called, no need to do it again. + if ( !getBearerCalled ) { - iConnInfos[index].iBearer = bearer; - iConnInfos[index].iBearerInfo = bearerInfo; + // CSD/HSCSD info could change after the first query also + // GPRS/EdgeGPRS/WCDMA info can change. + TInt bearer( EBearerUnknown ); + TBearerInfo bearerInfo; + + LOGIT("GetBearerInfo: GetBearer() 2nd query") + err = GetBearer( aConnectionId, bearer, bearerInfo ); + if ( ( KErrNone == err ) && ( bearerInfo.iBearer != EBearerInfoUnknown ) ) + { + iConnInfos[index].iBearer = bearer; + iConnInfos[index].iBearerInfo = bearerInfo; + } } } } @@ -2007,8 +2014,15 @@ iNetwRegistrationNotifier = CNetwRegistrationNotifier::NewL( iServer, iMobilePhone ); } if ( !iNetwRegistrationNotifier->IsActive() ) - { + { iNetwRegistrationNotifier->Receive(); // (re)start listening + + // We might have missed the network registration notification before + // we started listening for notifications here. Update the + // network registration information. + TInt registration( ENetworkRegistrationExtNotAvailable ); + User::LeaveIfError( GetNetworkRegistration_v2( registration ) ); + iServer->CellularDataUsageKeyUpdater()->UpdateKeyL( registration ); } // Bearer change (GPRS/Edge GPRS) status events diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -616,6 +616,20 @@ { LOGIT1("SERVER: FAILED to start bearer(new) notifier <%d>", ret) } + + // Update IAP availability if WLAN connection is fully started. + // When WLAN connection status is KLinkLayerOpen it is the only + // WLAN available. + // + TBearerInfo bearerInfo; + + ret = iServer->Iap()->GetBearerInfo( iConnectionId, bearerInfo ); + + if ( ret == KErrNone && bearerInfo.iBearer == EBearerInfoWLAN ) + { + LOGIT("CProgressNotifier::RunL triggered HandleAvailabilityChange()") + iServer->AvailabilityManager()->HandleAvailabilityChange(); + } } iFilter = KNoFiltering; diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/connectionmonitor/src/ConnMonServ.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonServ.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonServ.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -326,6 +326,14 @@ // Identify ourselves and open for service StartL( KConnectionMonitorServerName ); + //Start Indicator observer process + _LIT(KIndicatorObserverExeFile,"indicatorobserver.exe"); + _LIT(KIndicatorObserverExeFileCmd,""); + RProcess proc; + User::LeaveIfError(proc.Create(KIndicatorObserverExeFile,KIndicatorObserverExeFileCmd)); + proc.Resume(); + proc.Close(); // Closes the handle, not the process. + LOGIT("ConstructL: Server started successfully") LOGEXITFN("CConnMonServer::ConstructL()") } diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/connectionmonitor/src/cellulardatausagekeyupdater.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/cellulardatausagekeyupdater.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/connectionmonitor/src/cellulardatausagekeyupdater.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -29,7 +29,7 @@ #include "cellulardatausagekeyupdater.h" #include "ConnMonServ.h" #include "ConnMonAvailabilityManager.h" -#include "ConnMonIap.h" +#include "ConnMonIAP.h" #include "ConnMonDef.h" #include "log.h" @@ -86,12 +86,17 @@ TCmGenConnSettings occSettings = ReadGenConnSettingsL(); - TInt value( occSettings.iCellularDataUsageHome ); + TInt value( ECmCellularDataUsageDisabled ); if ( aRegistration == ENetworkRegistrationExtRoamingInternational ) { value = occSettings.iCellularDataUsageVisitor; } + else if ( aRegistration == ENetworkRegistrationExtHomeNetwork || + aRegistration == ENetworkRegistrationExtRoamingNational ) + { + value = occSettings.iCellularDataUsageHome; + } CRepository* cmRepository = NULL; @@ -106,10 +111,12 @@ { cmRepository->Set( KCurrentCellularDataUsage, value ); LOGIT1("KCurrentCellularDataUsage set to %d", value) - - LOGIT("CCellularDataUsageKeyUpdater triggered HandleAvailabilityChange()") - iServer->AvailabilityManager()->HandleAvailabilityChange(); - } + } + else + { + LOGIT1("KCurrentCellularDataUsage already up-to-date %d", previous) + } + delete cmRepository; } else @@ -219,6 +226,9 @@ iErrorCounter = 0; TRAPD( leaveCode, UpdateKeyL() ) + + LOGIT("CCellularDataUsageKeyUpdater triggered HandleAvailabilityChange()") + iServer->AvailabilityManager()->HandleAvailabilityChange(); if ( leaveCode ) { diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/connmon/dataconnectionlogger/src/saeobserver.cpp --- a/connectionmonitoring/connmon/dataconnectionlogger/src/saeobserver.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionmonitoring/connmon/dataconnectionlogger/src/saeobserver.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -15,7 +15,7 @@ * */ -#include +#include #include #include diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/inc/indicatorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/inc/indicatorobserver.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef INDICATOROBSERVER_H +#define INDICATOROBSERVER_H + +#include + +#include +#include +#include + +class XQSettingsManager; + +QTM_USE_NAMESPACE + +const int wlanNotConnected = 0; +const int wlanConnected = 1; + +const QString bearerWLAN = "WLAN"; +const QString bearer2G = "2G"; +const QString bearerWCDMA = "WCDMA"; +const QString bearerHSPA = "HSPA"; +const QString bearerCDMA2000 = "CDMA2000"; + +class IndicatorObserver : public QCoreApplication + { + Q_OBJECT + +public: + IndicatorObserver(int argc, char* argv[]); + + virtual ~IndicatorObserver(); + + void initializeIndicators(); + + void findActiveConfigurations(); + + void updateWlanIndicator(); + + void updateCellularIndicator(); + + void activateCellularIndicatorPlugin(QList list); + + void deactivateCellularIndicatorPlugin(); + + void activateWlanIndicatorPlugin(QList list); + + void deactivateWlanIndicatorPlugin(); + +private slots: + void updateWlanRadioStatus(const XQSettingsKey &key, const QVariant &value); + + void handleConfigurationChanged(const QNetworkConfiguration& config); + +private: + /*! + Pointer to network configuration manager + */ + QNetworkConfigurationManager* mNetConfigurationManager; + + /*! + Pointer to settings manager for reading PS keys + */ + XQSettingsManager *mSettingsManager; + + /*! + Pointer to a list of active cellular configurations + */ + QList* mActiveCellularConfigurations; + + /*! + Pointer to a list of active WLAN configurations + */ + QList* mActiveWlanConfigurations; + + /*! + Indicates whether WLAN radio is switched on + */ + bool mWlanEnabled; + + /*! + Indicates whether WLAN indicator plugin is activated + */ + bool mWlanIndicatorIsActivated; + + /*! + Indicates whether cellular indicator plugin is activated + */ + bool mCellularIndicatorIsActivated; + + friend class ObserverTester; + + }; + +#endif + +// End of File diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/indicatorobserver.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/indicatorobserver.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app +TARGET = indicatorobserver +CONFIG += hb \ + no_icon + +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + ./inc \ + ./traces + +LIBS += -lqtbearer -lxqsettingsmanager + +QT += core \ + network + +QT -= gui + +HEADERS += inc/indicatorobserver.h \ + traces/OstTraceDefinitions.h + +SOURCES += src/indicatorobserver.cpp \ + src/main.cpp + +symbian*: { + TARGET.UID3 = 0x2002C36C + TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData + SYMBIAN_PLATFORMS = WINSCW ARMV5 + BLD_INF_RULES.prj_exports += "rom/indicatorobserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(indicatorobserver.iby)" +} \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/rom/indicatorobserver.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/rom/indicatorobserver.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef INDICATOROBSERVER_IBY +#define INDICATOROBSERVER_IBY + +#include + +file=ABI_DIR\BUILD_DIR\indicatorobserver.exe PROGRAMS_DIR\indicatorobserver.exe + +#endif // INDICATOROBSERVER_IBY \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/src/indicatorobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/src/indicatorobserver.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,349 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "indicatorobserver.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "indicatorobserverTraces.h" +#endif + +QTM_USE_NAMESPACE + +/*! + IndicatorObserver::IndicatorObserver +*/ +IndicatorObserver::IndicatorObserver(int argc, char* argv[]) : + QCoreApplication(argc, argv), + mNetConfigurationManager(new QNetworkConfigurationManager(this)), + mSettingsManager(new XQSettingsManager(this)), + mActiveCellularConfigurations(new QList), + mActiveWlanConfigurations(new QList), + mWlanEnabled(0), + mWlanIndicatorIsActivated(false), + mCellularIndicatorIsActivated(false) + +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_ENTRY, "-->"); + + bool connectStatus = false; + + connectStatus = connect( + mNetConfigurationManager, + SIGNAL(configurationChanged(const QNetworkConfiguration&)), + this, + SLOT(handleConfigurationChanged(const QNetworkConfiguration&))); + + if (!connectStatus){ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONNECT_FAILED, "Connecting handleConfigurationChanged SLOT failed"); + } + + connectStatus = connect( + mSettingsManager, + SIGNAL(valueChanged(const XQSettingsKey, const QVariant)), + this, + SLOT(updateWlanRadioStatus(const XQSettingsKey, const QVariant))); + + if (!connectStatus){ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONNECT_FAILED_DUP1, "Connecting updateWlanRadioStatus SLOT failed"); + } + + // Subscribe for WLAN ON/OFF change indications + XQSettingsKey wlanKey( + XQSettingsKey::TargetCentralRepository, + KCRUidWlanDeviceSettingsRegistryId.iUid, + KWlanOnOff); + + //Read current status of WLAN radio + //mWlanEnabled = mSettingsManager->readItemValue(wlanKey).toInt() ? true : false; + mWlanEnabled = true; + //TODO: Replace above code with commented code when WlanOnOff implementation is in release. + //TODO: Remeber to add check for read failure(call error() method from settings manager). + + mSettingsManager->startMonitoring(wlanKey); + + initializeIndicators(); + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_EXIT, "<--"); +} + +/*! + IndicatorObserver::~IndicatorObserver +*/ +IndicatorObserver::~IndicatorObserver() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DESTRUCTOR_ENTRY, "-->"); + + if(mCellularIndicatorIsActivated) { + deactivateCellularIndicatorPlugin(); + } + + if (mActiveCellularConfigurations) { + mActiveCellularConfigurations->clear(); + delete mActiveCellularConfigurations; + } + + + if (mWlanIndicatorIsActivated) { + deactivateWlanIndicatorPlugin(); + } + + if (mActiveWlanConfigurations) { + mActiveWlanConfigurations->clear(); + delete mActiveWlanConfigurations; + } + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DESTRUCTOR_EXIT, "<--"); +} + +/*! + IndicatorObserver::initializeIndicators +*/ +void IndicatorObserver::initializeIndicators() +{ + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_INITIALIZEINDICATORS_ENTRY, "-->"); + + findActiveConfigurations(); + updateWlanIndicator(); + updateCellularIndicator(); + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_INITIALIZEINDICATORS_EXIT, "<--"); +} + +/*! + IndicatorObserver::updateWlanRadioStatus +*/ +void IndicatorObserver::updateWlanRadioStatus(const XQSettingsKey &key, const QVariant &value) +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_ENTRY, "-->"); + + // The key parameter is not used, since only WLAN ON/OFF setting is connected to this slot + Q_UNUSED(key); + + // Inform about WLAN ON/OFF status change + Q_UNUSED(value); //TODO: to be removed with final implementation. To keep compiler satisfied. + // mWlanEnabled = value.toInt() ? true : false; + + mWlanEnabled = true; //TODO: Replace with above code when WlanOnOff implementation is in release + + if (mWlanEnabled == false) { + deactivateWlanIndicatorPlugin(); + } else { + updateWlanIndicator(); + } + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_EXIT, "<--"); +} + +/*! + IndicatorObserver::findActiveConfigurations +*/ +void IndicatorObserver::findActiveConfigurations() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_FINDACTIVECONFIGURATIONS_ENTRY, "-->"); + + mActiveWlanConfigurations->clear(); + mActiveCellularConfigurations->clear(); + + //Let's find active connections if any + QList allConfigurations = mNetConfigurationManager->allConfigurations(QNetworkConfiguration::Active); + + for (int i=0; iappend(allConfigurations[i]); + } else if (bearerName == bearer2G || + bearerName == bearerWCDMA || + bearerName == bearerHSPA || + bearerName == bearerCDMA2000) { + mActiveCellularConfigurations->append(allConfigurations[i]); + } + } + } + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_FINDACTIVECONFIGURATIONS_EXIT, "<--"); +} + +/*! + IndicatorObserver::updateWlanIndicator +*/ +void IndicatorObserver::updateWlanIndicator() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANINDICATOR_ENTRY, "-->"); + QList list; + + int count = mActiveWlanConfigurations->count(); + + //We do not deactivate WlanIndicator plugin here as it is done in updateWlanRadioStatus method + //as WLAN radio status determines whether to show indicator or not + if ( mWlanEnabled ) { + if(count == 0) { + list.insert(0, wlanNotConnected); + activateWlanIndicatorPlugin(list); + } else { + list.insert(0, wlanConnected); + list.insert(1, mActiveWlanConfigurations->at(0).name()); + activateWlanIndicatorPlugin(list); + } + } + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANINDICATOR_EXIT, "<--"); +} + +/*! + IndicatorObserver::updateCellularIndicator +*/ +void IndicatorObserver::updateCellularIndicator() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATECELLULARINDICATOR_ENTRY, "-->"); + + QList list; + + int count = mActiveCellularConfigurations->count(); + + if ( count == 0 ) { + if ( mCellularIndicatorIsActivated ){ + deactivateCellularIndicatorPlugin(); + } + } else { + if (count == 1) { + list.insert(0, count); + list.insert(1, mActiveCellularConfigurations->at(0).name()); + list.insert(2, mActiveCellularConfigurations->at(0).identifier().toInt()); + } else { + list.insert(0, count); + + } + activateCellularIndicatorPlugin(list); + } + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATECELLULARINDICATOR_EXIT, "<--"); +} + +/*! + IndicatorObserver::handleConfigurationChanged +*/ +void IndicatorObserver::handleConfigurationChanged(const QNetworkConfiguration& config) +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_HANDLECONFIGURATIONCHANGED_ENTRY, "-->"); + + switch (config.state()) + { + case QNetworkConfiguration::Defined: //To handle situation where we have active connection and it is lost due to bad radio conditions + case QNetworkConfiguration::Discovered: + case QNetworkConfiguration::Active: + { + findActiveConfigurations(); + + QString bearerName = config.bearerName(); + + if (bearerName == bearerWLAN) { + updateWlanIndicator(); + } else if (bearerName == bearer2G || + bearerName == bearerWCDMA || + bearerName == bearerHSPA || + bearerName == bearerCDMA2000) { + updateCellularIndicator(); + } + } + break; + + default: + break; + } + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_HANDLECONFIGURATIONCHANGED_EXIT, "<--"); +} + +/*! + IndicatorObserver::activateCellularIndicatorPlugin +*/ +void IndicatorObserver::activateCellularIndicatorPlugin(QList list) +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_ACTIVATECELLULARINDICATORPLUGIN_ENTRY, "-->"); + + HbIndicator indicator; + bool success = indicator.activate("com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0", list); + + if (!success) { + mCellularIndicatorIsActivated = false; + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CELLULAR_INDICATOR_ACTIVATION_FAILED, "Cellular indicator activation failed"); + } else { + mCellularIndicatorIsActivated = true; + } + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_ACTIVATECELLULARINDICATORPLUGIN_EXIT, "<--"); +} + +/*! + IndicatorObserver::deactivateCellularIndicatorPlugin +*/ +void IndicatorObserver::deactivateCellularIndicatorPlugin() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DEACTIVATECELLULARINDICATORPLUGIN_ENTRY, "-->"); + + HbIndicator indicator; + indicator.deactivate("com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0"); + mCellularIndicatorIsActivated = false; + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DEACTIVATECELLULARINDICATORPLUGIN_EXIT, "<--"); +} + +/*! + IndicatorObserver::activateWlanIndicatorPlugin +*/ +void IndicatorObserver::activateWlanIndicatorPlugin(QList list) +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_ACTIVATEWLANINDICATORPLUGIN_ENTRY, "-->"); + + HbIndicator indicator; + bool success = indicator.activate("com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0", list); + + if (!success) { + mWlanIndicatorIsActivated = false; + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_WLAN_INDICATOR_ACTIVATION_FAILED, "WLAN indicator activation failed"); + } else { + mWlanIndicatorIsActivated = true; + } + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_ACTIVATEWLANINDICATORPLUGIN_EXIT, "<--"); +} + +/*! + IndicatorObserver::deactivateWlanIndicatorPlugin +*/ +void IndicatorObserver::deactivateWlanIndicatorPlugin() +{ + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DEACTIVATEWLANINDICATORPLUGIN_ENTRY, "-->"); + + HbIndicator indicator; + indicator.deactivate("com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0"); + mWlanIndicatorIsActivated = false; + + OstTrace0(TRACE_FLOW, INDICATOROBSERVER_DEACTIVATEWLANINDICATORPLUGIN_EXIT, "<--"); +} diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/src/main.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "indicatorobserver.h" + +int main(int argc, char *argv[]) +{ + IndicatorObserver app(argc, argv); + + return app.exec(); +} + +// End of File + + + diff -r 77415202bfc8 -r fcbbe021d614 connectionmonitoring/indicatorobserver/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionmonitoring/indicatorobserver/traces/OstTraceDefinitions.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConfirmationQuery.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConfirmationQuery.h Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CConfirmationQuery. -* -*/ - - -#ifndef __CONFIRMATION_QUERY_H__ -#define __CONFIRMATION_QUERY_H__ - -// INCLUDES -#include -#include -#include "ExpiryTimerCallback.h" -// FORWARD DECLARATIONS -class CConfirmationQueryNotif; -class CExpiryTimer; - -// CLASS DECLARATIONS - -/** - * Class implements a query dialog. - */ -NONSHARABLE_CLASS( CConfirmationQuery ) : public CAknListQueryDialog, public MExpiryTimerCallback - { - public: - /** - * Constructor the CConfirmationQuery class - * @param aNotif notifier pointer - * @param aNameOfConnMethod - * @param aUIId - * @return - - */ - CConfirmationQuery( CConfirmationQueryNotif* aNotif ); - - /** - * Exit function the CConfirmationQuery - * @param aButtonId - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - /** - * Destructor - */ - virtual ~CConfirmationQuery(); - - /** - * Tries to exit the dialog when the specified button is pressed, if this - * button should exit the dialog. - * - * See @c OkToExitL() to determine which buttons can exit the dialog. - * - * This will fail if user exit is prevented by the - * @c EEikDialogFlagNoUserExit flag. If the @c EEikDialogFlagNotifyEsc flag - * is not set and the dialog has been cancelled it immediately deletes - * itself. - * - * @param aButtonId The id of the pressed button. - */ - void TryExitL( TInt aButtonId ); - - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType); - - /** - * Sets the available choices for the query into the class variable - * @param aChoices RArray - */ - void SetChoices( RArray aChoices ); - - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - private: - CConfirmationQueryNotif* iNotif; // Pointer to the Notifier, not owned - TBool iButtonGroupPreviouslyChanged; // Was ButtonGroup modified? - - RArray iChoiceIds; - // For base class, unused. - TInt iDummy; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - - -#endif // __CONFIRMATION_QUERY_H__ - -// End of File diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConfirmationQueryNotif.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConfirmationQueryNotif.h Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CConfirmationQueryNotif -* -*/ - - - -#ifndef __CONFIRMATIONQUERYNOTIF_H__ -#define __CONFIRMATIONQUERYNOTIF_H__ - - -// INCLUDES -#include "ConnectionDialogsNotifBase.h" -#include "ConnectionUiUtilitiesCommon.h" -#include -#include -#include - -// FORWARD DECLARATIONS -class CConfirmationQuery; -class CRoamingInfo; - -/** - * OfflineWlanNoteNotif class - */ -NONSHARABLE_CLASS( CConfirmationQueryNotif ) - : public CConnectionDialogsNotifBase - { - public: - - /** - * Constructor. - */ - CConfirmationQueryNotif(); - - /** - * NewL function - * @param - - * return CConfirmationQueryNotif* - */ - static CConfirmationQueryNotif* NewL( - const TBool aResourceFileResponsible ); - - /** - * ~CConfirmationQueryNotif() destructor - * @param - - * return - - */ - virtual ~CConfirmationQueryNotif(); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which - * data can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - - - public: - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - - /** - * Sets the selected choise - * @param aChoice TInt - * return - - */ - void SetSelectedChoiceL ( TInt aChoice ); - - void SetVisitorNetwork(); - - private: - - /** - * Callback is called to launch dialog asynchronously - * @param aObject Pointer to notifier object. - * return Error code - */ - static TInt LaunchDialogL( TAny* aObject ); - - private: - TBool iTryNextBest; - TUint32 iConnMethod; - CConfirmationQuery* iDialog; // Pointer to the dialog - TBool iIsVisitorNetwork; - TMsgQueryLinkedResults iChoice; - TConnUiUiDestConnMethodNoteId iNoteInfo; - CAsyncCallBack *iLaunchDialogAsync; // One shot active object - }; - -#endif // __CONFIRMATIONQUERYNOTIF_H__ - -// End of File diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/cellulardataconfirmation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/cellulardataconfirmation.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog implementation +* +*/ + +#ifndef __CELLULARDATACONFIRMATION_H__ +#define __CELLULARDATACONFIRMATION_H__ + +#include +#include +#include +#include "ConnectionDialogsNotifBase.h" +#include "ConnectionUiUtilitiesCommon.h" + +class CDeviceDialogObserver; + + +NONSHARABLE_CLASS ( CCellularDataConfirmation ) : public CConnectionDialogsNotifBase + { + public: + /** + * Two-phased constructor. + */ + static CCellularDataConfirmation* NewL( + const TBool aResourceFileResponsible ); + + /** + * Destructor + */ + ~CCellularDataConfirmation(); + + /** + * Start the Notifier + * @param aBuffer Buffer + * @param aReplySlot Identifies which message argument to use for the + * reply. This message argument will refer to a + * modifiable descriptor, a TDes8 type, into which + * data can be returned. + * @param aMessage Message + * return - + */ + void StartL( const TDesC8& aBuffer, + TInt aReplySlot, + const RMessagePtr2& aMessage ); + + /** + * Cancel() the notifier + * @param - + * return - + */ + void Cancel(); + + /** + * RegisterL register the client notifier function + * @param - + * return TNotifierInfo + */ + TNotifierInfo RegisterL(); + + /** + * CompleteL the notifier is complete + * @param aStatus status + * return - + */ + void CompleteL( TInt aStatus ); + /** + * Sets the selected choice of the presented dialog + * @param aChoice TInt + * return - + */ + void SetSelectedChoice( TInt aChoice ); + + private: + /** + * Constructor + */ + CCellularDataConfirmation(); + + private: + /** Pointer to the device dialog interface for handling the dialog */ + CHbDeviceDialog* iDialog; + /** The observer to handle the data received from the orbit dialog */ + CDeviceDialogObserver* iObserver; + /* The choice selected by the user from the dialog */ + TMsgQueryLinkedResults iChoice; + /* Information if request was already completed, in case the + * observer receives the data signal and the signal about closing the + * dialog. + */ + TBool iCompleted; + + + }; + +#endif //__CELLULARDATACONFIRMATION_H__ diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/devicedialogobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/devicedialogobserver.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog implementation +* +*/ + +#ifndef __DEVICEDIALOGOBSERVER_H__ +#define __DEVICEDIALOGOBSERVER_H__ + +#include "cellulardataconfirmation.h" + +NONSHARABLE_CLASS ( CDeviceDialogObserver ) : public CBase, public MHbDeviceDialogObserver + { + public: + /** + * Two-phased constructor. + */ + static CDeviceDialogObserver* NewL( CCellularDataConfirmation* aNotifier ); + + /** + * Destructor + */ + ~CDeviceDialogObserver(); + + /** + * Handles the user input received from the dialog + * @param aData CHbSymbianVariantMap& + */ + void DataReceived(CHbSymbianVariantMap& aData); + + /** + * Handles the closing of the dialog + * @param aCompletionCode TInt + */ + void DeviceDialogClosed(TInt /*aCompletionCode*/); + /** + * Sets the available choices for the query into the class variable + * @param aChoices RArray + */ + void SetChoices( RArray& aChoices ); + private: + /** + * Constructor + */ + CDeviceDialogObserver( CCellularDataConfirmation* aNotifier ); + + private: + /* Pointer to the object that triggered the dialog opening, + * needed to update the information about the user input. + */ + CCellularDataConfirmation* iNotifier; + /* The order of the buttons in the dialog, in order to map the + * data received from the dialog into the actual selected choice. + */ + RArray iChoiceIds; + }; + +#endif /* __DEVICEDIALOGOBSERVER_H__ */ diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConfirmationQuery.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConfirmationQuery.cpp Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CConfirmationQuery. -* -*/ - - -// INCLUDE FILES -#include "ConfirmationQuery.h" -#include "ConfirmationQueryNotif.h" -#include "ConnectionUiUtilitiesCommon.h" -#include "ConnectionDialogsLogger.h" -#include "ExpiryTimer.h" - -#include -#include -#include - - - -// CONSTANTS -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CConfirmationQuery::CConfirmationQuery -// --------------------------------------------------------- -// -CConfirmationQuery::CConfirmationQuery( CConfirmationQueryNotif* aNotif ) -: CAknListQueryDialog( &iDummy ), - iNotif( aNotif ), - iButtonGroupPreviouslyChanged( EFalse ) - { - } - - -// --------------------------------------------------------- -// CConfirmationQuery::~CConfirmationQuery -// --------------------------------------------------------- -// -CConfirmationQuery::~CConfirmationQuery() - { - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - } - - - -// --------------------------------------------------------- -// CConfirmationQuery::OkToExitL -// --------------------------------------------------------- -// -TBool CConfirmationQuery::OkToExitL( TInt aButtonId ) - { - CLOG_ENTERFN( "CConfirmationQuery::OkToExitL" ); - TBool result( EFalse ); - TInt status = KErrCancel; - if ( aButtonId == EAknSoftkeySelect || - aButtonId == EAknSoftkeyDone || aButtonId == EAknSoftkeyOk ) - { - iNotif->SetSelectedChoiceL( iChoiceIds[ListBox()->CurrentItemIndex()] ); - result = ETrue; - status = KErrNone; - } - else if ( aButtonId == EAknSoftkeyCancel ) - { - status = KErrCancel; - result = ETrue; - } - - if ( result ) - { - CLOG_WRITEF( _L( "aButtonId = %d" ), aButtonId ); - __ASSERT_DEBUG( iNotif, User::Panic( KErrNullPointer, KErrNone ) ); - iNotif->CompleteL( status ); - } - - CLOG_LEAVEFN( "CConfirmationQuery::OkToExitL" ); - - return result; - } - - -// --------------------------------------------------------- -// CConfirmationQuery::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CConfirmationQuery::PreLayoutDynInitL() - { - CAknListQueryDialog::PreLayoutDynInitL(); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - } - - -// --------------------------------------------------------- -// CConfirmationQuery::TryExitL() -// --------------------------------------------------------- -// -void CConfirmationQuery::TryExitL( TInt aButtonId ) - { - CLOG_ENTERFN( "CConfirmationQuery::TryExitL" ); - CAknListQueryDialog::TryExitL( aButtonId ); - CLOG_LEAVEFN( "CConfirmationQuery::TryExitL" ); - } - -// --------------------------------------------------------- -// CConfirmationQuery::OfferKeyEventL -// --------------------------------------------------------- -// -TKeyResponse CConfirmationQuery::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType) - { - if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend ) - { - // Let's not obscure the Dialer in the background - if ( iExpiryTimer ) - { - iExpiryTimer->Cancel(); - iExpiryTimer->StartShort(); - } - } - - return CAknListQueryDialog::OfferKeyEventL( aKeyEvent,aType ); - } - -// --------------------------------------------------------- -// CConfirmationQuery::SetChoices -// --------------------------------------------------------- -// -void CConfirmationQuery::SetChoices( RArray aChoices ) - { - iChoiceIds = aChoices; - } - -void CConfirmationQuery::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - - -// End of File diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConfirmationQueryNotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConfirmationQueryNotif.cpp Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CConfirmationQueryNotif. -* -*/ - - -// INCLUDE FILES -#include "ConfirmationQueryNotif.h" -#include "ConfirmationQuery.h" -#include "ConnectionUiUtilitiesCommon.h" -#include "ConnUiUtilsNotif.h" -#include "ConnectionDialogsLogger.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - - -using namespace CMManager; - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConfirmationQueryNotif::CConfirmationQueryNotif() -// --------------------------------------------------------- -// -CConfirmationQueryNotif::CConfirmationQueryNotif() -: iConnMethod( 0 ), - iChoice( EMsgQueryCancelled ) - { - } - - -// --------------------------------------------------------- -// CConfirmationQueryNotif* CConfirmationQueryNotif::NewL() -// --------------------------------------------------------- -// -CConfirmationQueryNotif* CConfirmationQueryNotif::NewL( - const TBool aResourceFileResponsible ) - { - CConfirmationQueryNotif* self = new ( ELeave ) CConfirmationQueryNotif(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - - return self; - } - - -// --------------------------------------------------------- -// CConfirmationQueryNotif::~CConfirmationQueryNotif() -// --------------------------------------------------------- -// -CConfirmationQueryNotif::~CConfirmationQueryNotif() - { - if ( iLaunchDialogAsync ) - { - delete iLaunchDialogAsync; - iLaunchDialogAsync = NULL; - } - } - -// --------------------------------------------------------- -// CConfirmationQueryNotif::RegisterL() -// --------------------------------------------------------- -// -CConfirmationQueryNotif::TNotifierInfo CConfirmationQueryNotif::RegisterL() - { - iInfo.iUid = KUidConfirmationQuery; - iInfo.iPriority = ENotifierPriorityHigh; - iInfo.iChannel = KUidConfirmationQuery; - - return iInfo; - } - -// --------------------------------------------------------- -// void CConfirmationQueryNotif::StartL -// --------------------------------------------------------- -// -void CConfirmationQueryNotif::StartL( const TDesC8& aBuffer, - TInt aReplySlot, - const RMessagePtr2& aMessage ) - { - if ( iLaunchDialogAsync ) - { - if ( iLaunchDialogAsync->IsActive() ) - { - // Dialog is already active - aMessage.Complete( KErrServerBusy ); - return; - } - } - - iChoice = EMsgQueryCancelled; - TPckgBuf input; - input.Copy( aBuffer ); - iNoteInfo = input(); - - iReplySlot = aReplySlot; - iMessage = aMessage; - iCancelled = EFalse; - - TCallBack cb( LaunchDialogL, this ); - - if ( !iLaunchDialogAsync ) - { - iLaunchDialogAsync = new( ELeave ) CAsyncCallBack( cb, CActive::EPriorityHigh ); - } - - iLaunchDialogAsync->CallBack(); - } - - -// --------------------------------------------------------- -// void CConfirmationQueryNotif::Cancel() -// --------------------------------------------------------- -// -void CConfirmationQueryNotif::Cancel() - { - CLOG_ENTERFN( "CConfirmationQueryNotif::Cancel" ); - if ( !iCancelled ) - { - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { - iMessage.Complete( KErrCancel ); - } - - delete iDialog; - iDialog = NULL; - } - - CLOG_LEAVEFN( "CConfirmationQueryNotif::Cancel" ); - } - - -// --------------------------------------------------------- -// void CConfirmationQueryNotif::CompleteL( TInt aStatus ) -// --------------------------------------------------------- -// -void CConfirmationQueryNotif::CompleteL( TInt aStatus ) - { - CLOG_ENTERFN( "CConfirmationQueryNotif::CompleteL" ); - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { - if ( aStatus == KErrNone ) - { - iMessage.WriteL( iReplySlot, TPckg( iChoice ) ); - } - iMessage.Complete( aStatus ); - } - - Cancel(); - - CLOG_LEAVEFN( "CConfirmationQueryNotif::CompleteL" ); - } - -// --------------------------------------------------------------- -// void CConfirmationQueryNotif::SetSelectedChoiceL( TInt aChoice ) -// ---------------------------------------------------------------- -// -void CConfirmationQueryNotif::SetSelectedChoiceL ( TInt aChoice ) - { - CLOG_ENTERFN( "CConfirmationQueryNotif::SetSelectedChoiceL" ); - iChoice = (TMsgQueryLinkedResults)aChoice; - CLOG_LEAVEFN( "CConfirmationQueryNotif::SetSelectedChoiceL" ); - } - -// --------------------------------------------------------- -// TInt CConfirmationQueryNotif::LaunchDialogL() -// --------------------------------------------------------- -// -TInt CConfirmationQueryNotif::LaunchDialogL( TAny* aObject ) - { - CLOG_ENTERFN( "CCConfirmationQueryNotif::LaunchDialogL" ); - CConfirmationQueryNotif* myself = - static_cast( aObject ); - - myself->iDialog = new ( ELeave ) CConfirmationQuery( myself ); - myself->iDialog->PrepareLC( R_MESSAGE_QUERY ); - - // Create the list box items - RArray choices; - CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(2); - CleanupStack::PushL( array ); - HBufC* heading = NULL; - HBufC* messageBase = NULL; - HBufC* automatic = NULL; - HBufC* thisTime = NULL; - - automatic = StringLoader::LoadLC( R_QTN_OCC_LIST_CS_DATA_HOME_NW_AUTOMATIC ); - thisTime = StringLoader::LoadLC( R_QTN_OCC_LIST_CS_DATA_HOME_NW_THIS_TIME ); - - if ( myself->iNoteInfo.iNoteId == EConfirmMethodUsageQueryInHomeNetwork ) - { - heading = StringLoader::LoadLC( R_QTN_OCC_PRMPT_CS_DATA_HOME_NW ); - messageBase = StringLoader::LoadLC( R_QTN_OCC_DETAIL_CS_DATA_HOME_NW ); - // the order of the query options depends on the location - choices.Append(EMsgQueryAutomatically); - choices.Append(EMsgQueryThisTime); - array->AppendL( *automatic ); - array->AppendL( *thisTime ); - } - else - { - heading = StringLoader::LoadLC( R_QTN_OCC_PRMPT_CS_DATA_FOREIGN_NW ); - messageBase = StringLoader::LoadLC( R_QTN_OCC_DETAIL_CS_DATA_FOREIGN_NW ); - // the order of the query options depends on the location - choices.Append(EMsgQueryThisTime); - choices.Append(EMsgQueryAutomatically); - array->AppendL( *thisTime ); - array->AppendL( *automatic ); - } - - // Set the dialog heading and message text - myself->iDialog->Heading()->SetTextL(*heading); - myself->iDialog->MessageBox()->SetMessageTextL(messageBase); - CleanupStack::PopAndDestroy( messageBase ); - CleanupStack::PopAndDestroy( heading ); - - // Set the options to the listbox - myself->iDialog->SetChoices(choices); - - myself->iDialog->SetItemTextArray( array ); - myself->iDialog->SetOwnershipType(ELbmOwnsItemArray); // ownership transferred to listbox - myself->iDialog->ListBox()->HandleItemAdditionL(); - - CleanupStack::Pop( thisTime ); - CleanupStack::Pop( automatic ); - CleanupStack::Pop( array ); - myself->iDialog->RunLD(); - - CLOG_LEAVEFN( "CConfirmationQueryNotif::LaunchDialogL" ); - return 0; - } - -// End of File diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -26,13 +26,13 @@ #include "EasyWepDlgNotif.h" #include "EasyWpaDlgNotif.h" #include "WLANNetworkUnavailableNoteNotif.h" -#include "ConfirmationQueryNotif.h" #include "ConnectViaNoteNotif.h" #include "wlanpowersavetestnotif.h" #include "easywapidlgnotif.h" #include "nowlannetworksavailablenotif.h" #include "connectingviadiscreetpopupnotif.h" #include "connectionerrordiscreetpopupnotif.h" +#include "cellulardataconfirmation.h" // CONSTANTS @@ -114,7 +114,7 @@ aNotifiers->AppendL( serNotify ); CleanupStack::Pop( serNotify ); - serNotify = CConfirmationQueryNotif::NewL( resourceFileResponsible ); + serNotify = CCellularDataConfirmation::NewL( resourceFileResponsible ); CleanupStack::PushL( serNotify ); aNotifiers->AppendL( serNotify ); CleanupStack::Pop( serNotify ); diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/cellulardataconfirmation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/cellulardataconfirmation.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog implementation +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "ConnectionDialogsLogger.h" +#include "cellulardataconfirmation.h" +#include "ConnectionDialogsNotifBase.h" +#include "ConnectionDialogsUidDefs.h" +#include "ConnUiUtilsNotif.h" +#include "devicedialogobserver.h" + + +// CONSTANTS +const TInt KVariableLength = 30; +_LIT( KHomenetwork, "homenetwork"); +_LIT(KType, "com.nokia.ipconnmgmt.promptdialog/1.0"); + +// --------------------------------------------------------- +// CCellularDataConfirmation::CCellularDataConfirmation() +// --------------------------------------------------------- +// +CCellularDataConfirmation::CCellularDataConfirmation() + { + iCompleted = EFalse; + iChoice = EMsgQueryCancelled; + iObserver = NULL; + iDialog = NULL; + } + +// --------------------------------------------------------- +// CCellularDataConfirmation::~CCellularDataConfirmation() +// --------------------------------------------------------- +// +CCellularDataConfirmation::~CCellularDataConfirmation() + { + CLOG_ENTERFN( "CCellularDataConfirmation::~CCellularDataConfirmation" ); + delete iDialog; + delete iObserver; + CLOG_LEAVEFN( "CCellularDataConfirmation::~CCellularDataConfirmation" ); + } + +// --------------------------------------------------------- +// CCellularDataConfirmation* CCellularDataConfirmation::NewL +// --------------------------------------------------------- +// +CCellularDataConfirmation* CCellularDataConfirmation::NewL( + const TBool aResourceFileResponsible ) + { + CLOG_ENTERFN( "CCellularDataConfirmation::NewL" ); + CCellularDataConfirmation* self = new ( ELeave ) CCellularDataConfirmation(); + CleanupStack::PushL( self ); + self->ConstructL( KResourceFileName, aResourceFileResponsible ); + CleanupStack::Pop(); + CLOG_LEAVEFN( "CCellularDataConfirmation::NewL" ); + return self; + } + +// --------------------------------------------------------- +// void CCellularDataConfirmation::StartL +// --------------------------------------------------------- +// +void CCellularDataConfirmation::StartL( const TDesC8& aBuffer, + TInt aReplySlot, + const RMessagePtr2& aMessage ) + { + CLOG_ENTERFN( "CCellularDataConfirmation::StartL" ); + iChoice = EMsgQueryCancelled; + TPckgBuf input; + TConnUiUiDestConnMethodNoteId noteInfo; + input.Copy( aBuffer ); + noteInfo = input(); + iReplySlot = aReplySlot; + iMessage = aMessage; + + // Create the list box items + RArray choices; + + // Observer is needed in order to get the user inputs + iObserver = CDeviceDialogObserver::NewL( this ); + iDialog = CHbDeviceDialog::NewL(); + + // The variant map is needed to construct the dialog correctly, + // information whether we are in home network is needed + TBuf key(KHomenetwork); + TBool homeNetwork; + if ( noteInfo.iNoteId == EConfirmMethodUsageQueryInHomeNetwork ) + { + homeNetwork = ETrue; + choices.Append(EMsgQueryAutomatically); + choices.Append(EMsgQueryThisTime); + choices.Append(EMsgQueryCancelled); + } + else + { + homeNetwork = EFalse; + choices.Append(EMsgQueryThisTime); + choices.Append(EMsgQueryAutomatically); + choices.Append(EMsgQueryCancelled); + } + // Set the choice order for the observer so that it knows which button press + // means which choice + iObserver->SetChoices(choices); + + // Create the variant data information for the plugin + CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL( map ); + CHbSymbianVariant *variant = CHbSymbianVariant::NewL ( &homeNetwork, CHbSymbianVariant::EBool ); + CleanupStack::PushL( variant ); + TInt error = map->Add( key, variant); + User::LeaveIfError( error ); + CleanupStack::Pop( variant ); // map's cleanup sequence handles variant. + + // Show the dialog. + error = iDialog->Show( KType, *map, iObserver ); + User::LeaveIfError( error ); + CleanupStack::PopAndDestroy( map ); + CLOG_LEAVEFN( "CCellularDataConfirmation::StartL" ); + } + +// --------------------------------------------------------- +// void CConfirmationQueryNotif::CompleteL( TInt aStatus ) +// --------------------------------------------------------- +// +void CCellularDataConfirmation::CompleteL( TInt aStatus ) + { + CLOG_ENTERFN( "CCellularDataConfirmation::CompleteL" ); + if ( !iCompleted ) + { + if ( !iMessage.IsNull() ) + { + iMessage.WriteL( iReplySlot, TPckg( iChoice ) ); + iMessage.Complete( aStatus ); + iCompleted = ETrue; + } + } + CLOG_LEAVEFN( "CCellularDataConfirmation::CompleteL" ); + } + +// --------------------------------------------------------------- +// void CConfirmationQueryNotif::SetSelectedChoiceL( TInt aChoice ) +// ---------------------------------------------------------------- +// +void CCellularDataConfirmation::SetSelectedChoice ( TInt aChoice ) + { + CLOG_ENTERFN( "CCellularDataConfirmation::SetSelectedChoice" ); + iChoice = (TMsgQueryLinkedResults)aChoice; + CLOG_LEAVEFN( "CCellularDataConfirmation::SetSelectedChoice" ); + } + +// --------------------------------------------------------------- +// void CCellularDataConfirmation::Cancel() +// ---------------------------------------------------------------- +// +void CCellularDataConfirmation::Cancel() + { + CLOG_ENTERFN( "CCellularDataConfirmation::Cancel" ); + if ( !iCompleted ) + { + iDialog->Cancel(); + TRAP_IGNORE( iMessage.WriteL( iReplySlot, + TPckg( EMsgQueryCancelled ) )); + iMessage.Complete( KErrCancel ); + } + CLOG_LEAVEFN( "CCellularDataConfirmation::Cancel" ); + } + +// --------------------------------------------------------------- +// CCellularDataConfirmation::TNotifierInfo +// CCellularDataConfirmation::RegisterL() +// ---------------------------------------------------------------- +// +CCellularDataConfirmation::TNotifierInfo CCellularDataConfirmation::RegisterL() + { + CLOG_ENTERFN( "CCellularDataConfirmation::RegisterL" ); + iInfo.iUid = KUidConfirmationQuery; + iInfo.iPriority = ENotifierPriorityHigh; + iInfo.iChannel = KUidConfirmationQuery; + CLOG_LEAVEFN( "CCellularDataConfirmation::RegisterL" ); + return iInfo; + } diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopup.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopup.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopup.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -299,6 +299,8 @@ // Group 8 case KErrPermissionDenied: + icon = EIconNone; // Permission denied may come with any bearer. + // Fall through case KErrWlanPasswordExpired: case KErrWlanNoDialinPermissions: case KErrWlanAccountDisabled: diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/devicedialogobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/devicedialogobserver.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog implementation +* +*/ + +#include +#include "devicedialogobserver.h" + +_LIT(KButton, "button"); + +// --------------------------------------------------------- +// CDeviceDialogObserver* CDeviceDialogObserver::NewL +// --------------------------------------------------------- +// +CDeviceDialogObserver* CDeviceDialogObserver::NewL( CCellularDataConfirmation* aNotifier ) + { + CDeviceDialogObserver* self = new ( ELeave ) CDeviceDialogObserver( aNotifier ); + return self; + } + +// --------------------------------------------------------- +// CDeviceDialogObserver::CDeviceDialogObserver +// --------------------------------------------------------- +// +CDeviceDialogObserver::CDeviceDialogObserver( CCellularDataConfirmation* aNotifier ): + iNotifier( aNotifier ) + { + + } + +// --------------------------------------------------------- +// CDeviceDialogObserver::~CDeviceDialogObserver() +// --------------------------------------------------------- +// +CDeviceDialogObserver::~CDeviceDialogObserver() + { + + } + +// --------------------------------------------------------- +// void CConfirmationQuery::SetChoices +// --------------------------------------------------------- +// +void CDeviceDialogObserver::SetChoices( RArray& aChoices ) + { + iChoiceIds = aChoices; + } + +// --------------------------------------------------------- +// void CDeviceDialogObserver::DataReceived +// --------------------------------------------------------- +// +void CDeviceDialogObserver::DataReceived( CHbSymbianVariantMap& aData ) +{ + // The key that is returned by the promptdialog is "button", + // meaning the id of the pressed button. + TInt intData = *(TInt*)(aData.Get(KButton)->Data()); + + TInt status = KErrNone; + + iNotifier->SetSelectedChoice( iChoiceIds[intData-1] ); + TRAP_IGNORE( iNotifier->CompleteL( status )); + +} + +// --------------------------------------------------------- +// void CDeviceDialogObserver::DeviceDialogClosed +// --------------------------------------------------------- +// +void CDeviceDialogObserver::DeviceDialogClosed( TInt /*aCompletionCode*/ ) +{ + // Dialog was closed, let's complete with that error code + TInt status = KErrCancel; + iNotifier->SetSelectedChoice( EMsgQueryCancelled ); + TRAP_IGNORE( iNotifier->CompleteL( status )); +} + + diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp --- a/connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp Tue Feb 02 00:24:11 2010 +0200 +++ b/connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp Fri Apr 16 15:21:37 2010 +0300 @@ -65,8 +65,6 @@ SOURCE WLANNetworkUnavailableNoteNotif.cpp SOURCE ActiveWLANNetworkUnavailableNote.cpp -SOURCE ConfirmationQuery.cpp -SOURCE ConfirmationQueryNotif.cpp SOURCE ActiveConnectViaNote.cpp SOURCE ConnectViaNoteNotif.cpp SOURCE NoteDlgSuppressingSwitch.cpp @@ -79,6 +77,8 @@ SOURCE connectionerrordiscreetpopup.cpp SOURCE connectionerrordiscreetpopupnotif.cpp SOURCE nowlansdiscreetpopup.cpp +SOURCE cellulardataconfirmation.cpp +SOURCE devicedialogobserver.cpp SOURCEPATH ../src SOURCE ConnectionInfo.cpp @@ -100,10 +100,9 @@ SYSTEMINCLUDE /epoc32/include/libc SYSTEMINCLUDE /epoc32/include/uikon - LIBRARY euser.lib eikdlg.lib eiksrv.lib cone.lib eikcore.lib eikcoctl.lib LIBRARY bafl.lib avkon.lib AknSkins.lib Ecom.lib -LIBRARY eiksrvui.lib +LIBRARY eiksrvui.lib LIBRARY commonengine.lib LIBRARY AKNNOTIFY.LIB LIBRARY AknIcon.lib @@ -115,8 +114,10 @@ LIBRARY charconv.lib LIBRARY commdb.lib -LIBRARY cmmanager.lib +LIBRARY cmmanager.lib LIBRARY etel3rdparty.lib +LIBRARY HbCore.lib +LIBRARY HbWidgets.lib #if defined(ARMCC) DEFFILE ../ConnectionUiUtilities/EABI/ConnUiUtilsNotif.DEF diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/confirmqueries.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/confirmqueries.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,48 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Prompt Dialog build file +# +# + +TEMPLATE = lib +TARGET = cellularpromptdialogplugin +CONFIG += hb plugin + +# directories +INCLUDEPATH += . +DEPENDPATH += . +DESTDIR = $${HB_BUILD_DIR}/plugins/devicedialogs + + +HEADERS += inc/cellularpromptdialog.h \ + inc/cellularpromptdialogplugin.h \ + traces/OstTraceDefinitions.h + +SOURCES += src/cellularpromptdialog.cpp \ + src/cellularpromptdialogplugin.cpp + +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.UID3 = 0x2002C2F7 + BLD_INF_RULES.prj_exports += "rom/promptdialogplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(promptdialogplugin.iby)" + BLD_INF_RULES.prj_exports += "rom/promptdialogplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(promptdialogplugin_resources.iby)" + + pluginstub.sources = cellularpromptdialogplugin.dll + pluginstub.path = /resource/plugins/devicedialogs + DEPLOYMENT += pluginstub +} +TRANSLATIONS = cellularpromptdialog.ts + +RESOURCES += res/promptdialog.qrc \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/inc/cellularpromptdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/inc/cellularpromptdialog.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __CELLULARPROMPTDIALOG_H__ +#define __CELLULARPROMPTDIALOG_H__ + +#include +#include +#include + +class CellularPromptDialog: public HbDialog, public HbDeviceDialogInterface + { + Q_OBJECT + + public: + /* Constructor */ + CellularPromptDialog(const QVariantMap ¶meters); + /* Destructor */ + ~CellularPromptDialog(); + + /* Function creates the actual dialog widget */ + void createDialog(const QVariantMap ¶meters); + + /* Device dialog parameters to be set while dialog is displayed. + * Not supported. + */ + bool setDeviceDialogParameters(const QVariantMap ¶meters); + + /* Not supported */ + int deviceDialogError() const; + + /* Closes the device dialog */ + void closeDeviceDialog(bool byClient); + + /* Returns a pointer to this dialog widget */ + HbPopup *deviceDialogWidget() const; + + signals: + /* Signal is emitted when the dialog is closed */ + void deviceDialogClosed(); + + /* Data is emitted in QVariantMap when one of the buttons is selected */ + void deviceDialogData(QVariantMap data); + + private slots: + /* Slot that is mapped to the first button's Clicked signal */ + void firstButtonPressed(); + + /* Slot that is mapped to the second button's Clicked signal */ + void middleButtonPressed(); + + /* Slot that is mapped to the cancel button's Clicked signal */ + void cancelPressed(); + + /* Slot that is mapped to the signal that indicates to closing of the dialog */ + void closingDialog(); + + private: + Q_DISABLE_COPY(CellularPromptDialog) + + private: + /* Pointer to the confml dialog object */ + HbDialog *mDialog; + + /* Tells whether close has already been called for the dialog */ + bool mClose; + }; + + +#endif // __CELLULARPROMPTDIALOG_H__ diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/inc/cellularpromptdialogplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/inc/cellularpromptdialogplugin.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ____CELLULARPROMPTDIALOG_H__PLUGIN_H__ +#define ____CELLULARPROMPTDIALOG_H__PLUGIN_H__ + +#include +#include + +class CellularPromptDialog; + +class CellularPromptDialogPlugin : public HbDeviceDialogPlugin +{ + Q_OBJECT + +public: + + /* Constructor */ + CellularPromptDialogPlugin(); + /* Destructor */ + ~CellularPromptDialogPlugin(); + + /* Check whether access is allowed, true is always returned */ + bool accessAllowed(const QString &deviceDialogType, + const QVariantMap ¶meters, const QVariantMap &securityInfo) const; + + /* Creates the dialog widget */ + HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType, + const QVariantMap ¶meters); + + /* Returns the device dialog type */ + bool deviceDialogInfo(const QString &deviceDialogType, + const QVariantMap ¶meters, DeviceDialogInfo *info) const; + + /* Returns a list of dialog types that this plugin implements. + * Only one dialog type is supported. + */ + QStringList deviceDialogTypes() const; + + /* Returns the possible plugin flags, there are none */ + PluginFlags pluginFlags() const; + + /* Not supported */ + int error() const; + +private: + Q_DISABLE_COPY(CellularPromptDialogPlugin) + +}; + +#endif // ___CELLULARPROMPTDIALOG_H__ diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/res/promptdialog.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/res/promptdialog.qrc Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,6 @@ + + + prompt_home.docml + prompt_abroad.docml + + \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/rom/promptdialogplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/rom/promptdialogplugin.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef __PROMPTDIALOGPLUGIN_IBY__ +#define __PROMPTDIALOGPLUGIN_IBY__ + +#include + +#define HB_PLUGIN_STUB(NAME, SUBDIR) data=\epoc32\data\z\resource\plugins\##SUBDIR##\##NAME##.qtplugin RESOURCE_FILES_DIR\plugins\##SUBDIR##\##NAME##.qtplugin + +file=ABI_DIR\BUILD_DIR\CellularPromptDialogPlugin.dll SHARED_LIB_DIR\cellularpromptdialogplugin.dll +HB_PLUGIN_STUB(cellularpromptdialogplugin, devicedialogs) + +#endif \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/rom/promptdialogplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/rom/promptdialogplugin_resources.iby Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef PROMPTDIALOGPLUGIN_RESOURCES_IBY +#define PROMPTDIALOGPLUGIN_RESOURCES_IBY + +#include +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cellularpromptdialog.qm QT_TRANSLATIONS_DIR/cellularpromptdialog.qm + +#endif // PROMPTDIALOGPLUGIN_RESOURCES_IBY diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/src/cellularpromptdialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/src/cellularpromptdialog.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,300 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog implementation +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cellularpromptdialog.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cellularpromptdialogTraces.h" +#endif + + + +// The index numbers of the buttons of the dialog +const int firstButtonIndex = 1; +const int middleButtonIndex = 2; +const int cancelButtonIndex = 3; + +/** + * The constructor + */ +CellularPromptDialog::CellularPromptDialog(const QVariantMap ¶meters) +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CELLULARPROMPTDIALOG_ENTRY ); + + // Install localization + QTranslator *translator = new QTranslator(this); + QString lang = QLocale::system().name(); + QString path = "Z:/resource/qt/translations/"; + translator->load("cellularpromptdialog_" + lang, path); + qApp->installTranslator(translator); + + createDialog(parameters); + mClose = false; + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_CELLULARPROMPTDIALOG_EXIT ); +} + + +/** + * The construction of the dialog + */ +void CellularPromptDialog::createDialog(const QVariantMap ¶meters) +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CREATEDIALOG_ENTRY ); + + // Set the button and label texts according to the network (home or abroad) + QString labelText; + QString button1Text; + QString button2Text; + QString button3Text(hbTrId("txt_occ_button_cellular_cancel")); + + // There is only one value in the QVariantMap that we are interested in, + // whether we are in home network or not + QList list = parameters.values(); + bool homeNetwork = true; + + if (list.count() > 0) { + homeNetwork = list[0].toBool(); + } + + if (homeNetwork) { + labelText = QString(hbTrId("txt_occ_title_connect_to_internet_using_cellular_d")); + button1Text = QString(hbTrId("txt_occ_button_connect_automatically")); + button2Text = QString(hbTrId("txt_occ_button_connect_this_time")); + } else { + labelText = QString(hbTrId("txt_occ_title_connect_to_internet_in_this_country")); + button1Text = QString(hbTrId("txt_occ_button_connect_this_time")); + } + + HbDocumentLoader loader; + bool ok = true; + + if (homeNetwork) { + loader.load(":/xml/prompt_home.docml", &ok); + } else { + loader.load(":/xml/prompt_abroad.docml", &ok); + } + + if ( !ok ) { + // send information about cancelling to the observer, the xml loading failed + cancelPressed(); + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_CREATEDIALOG_EXIT ); + return; + } + + // store the pointer to the dialog in order to be able to delete + // it in the destructor + mDialog = qobject_cast( loader.findWidget ("dialog")); + Q_ASSERT(mDialog != NULL); + + // fetch the needed widgets, update their texts and connect the + // clicked signals of the buttons to correct slots. + HbWidget *container = qobject_cast( loader.findWidget ("container")); + this->setContentWidget(container); + + // Set the dialog to be on the screen for 30 seconds, unless + // the user reacts earlier + this->setModal(true); + this->setTimeout(30000); + this->setDismissPolicy(HbPopup::NoDismiss); + + HbLabel* label = qobject_cast( loader.findWidget("label") ); + Q_ASSERT(label != NULL); + label->setPlainText(labelText); + label->setTextWrapping(Hb::TextWordWrap); + + HbPushButton* firstButton = qobject_cast( loader.findWidget("topButton") ); + Q_ASSERT(firstButton != NULL); + firstButton->setText(button1Text); + + HbPushButton* middleButton = NULL; + if ( homeNetwork ) { + middleButton = qobject_cast( loader.findWidget("middleButton") ); + Q_ASSERT(middleButton != NULL); + middleButton->setText(button2Text); + } + + HbPushButton* cancelButton = qobject_cast( loader.findWidget("cancelButton") ); + Q_ASSERT(cancelButton != NULL); + cancelButton->setText(button3Text); + + // Connect the button clicks to slots, assert if connecting fails + bool connected = connect( firstButton, SIGNAL(clicked()), this, SLOT( firstButtonPressed() )); + Q_ASSERT(connected == true); + + if ( homeNetwork ) { + connected = connect( middleButton, SIGNAL(clicked()), this, SLOT( middleButtonPressed() )); + Q_ASSERT(connected == true); + } + + connected = connect( cancelButton, SIGNAL(clicked()), this, SLOT( cancelPressed() )); + Q_ASSERT(connected == true); + // Connect the about to close and hide signals, so that we are able to inform + // the caller that the dialog was closed, for example due to timeout + connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog())); + Q_ASSERT(connected == true); + connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog())); + Q_ASSERT(connected == true); + + OstTraceFunctionExit0( DUP1_CELLULARPROMPTDIALOG_CREATEDIALOG_EXIT ); +} + +/** + * Destructor + */ +CellularPromptDialog::~CellularPromptDialog() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_DCELLULARPROMPTDIALOG_ENTRY ); + + // The dialog widgets are deleted as the dialog is deleted + if (mDialog != NULL) { + delete mDialog; + } + mDialog = NULL; + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_DCELLULARPROMPTDIALOG_EXIT ); +} + +/** + * Function is called when the first button is pressed and the + * index of the button is emitted + */ +void CellularPromptDialog::firstButtonPressed() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_FIRSTBUTTONPRESSED_ENTRY ); + + QVariantMap data; + QVariant variant(firstButtonIndex); + data.insert("button", variant); + // emit the data of the selected button and close the dialog + emit deviceDialogData(data); + close(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_FIRSTBUTTONPRESSED_EXIT ); +} + +/** + * Function is called when the second button is pressed and the + * index of the button is emitted + */ +void CellularPromptDialog::middleButtonPressed() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_MIDDLEBUTTONPRESSED_ENTRY ); + + QVariantMap data; + QVariant variant(middleButtonIndex); + data.insert("button", variant); + // emit the data of the selected button and close the dialog + emit deviceDialogData(data); + close(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_MIDDLEBUTTONPRESSED_EXIT ); +} + +/** + * Function is called when the third button is pressed and the + * index of the button is emitted + */ +void CellularPromptDialog::cancelPressed() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CANCELPRESSED_ENTRY ); + + QVariantMap data; + QVariant variant(cancelButtonIndex); + data.insert("button", variant); + // emit the data of the selected button and close the dialog + emit deviceDialogData(data); + close(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_CANCELPRESSED_EXIT ); +} + +/** + * Function is called when the dialog is about to close + */ +void CellularPromptDialog::closingDialog() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CLOSINGDIALOG_ENTRY ); + + if (!mClose) { + mClose = true; + closeDeviceDialog(false); + } + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_CLOSINGDIALOG_EXIT ); +} + + +/** + * Updating the dialog during its showing is not allowed. + */ +bool CellularPromptDialog::setDeviceDialogParameters + (const QVariantMap ¶meters) +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY ); + + Q_UNUSED(parameters) + // changing the dialog after presenting it is not supported. + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT ); + return true; +} + +/** + * Not supported, 0 always returned + */ +int CellularPromptDialog::deviceDialogError() const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_DEVICEDIALOGERROR_ENTRY ); + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_DEVICEDIALOGERROR_EXIT); + return 0; +} + +/** + * Dialog is closed and the signal about closing is emitted + */ +void CellularPromptDialog::closeDeviceDialog(bool byClient) +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CLOSEDEVICEDIALOG_ENTRY ); + + Q_UNUSED(byClient) + close(); + // If the user closes the dialog, then the deviceDialogClosed is emitted + emit deviceDialogClosed(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_CLOSEDEVICEDIALOG_EXIT ); +} + +/** + * This dialog widget is returned to the caller + */ +HbPopup *CellularPromptDialog::deviceDialogWidget() const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_DEVICEDIALOGWIDGET_ENTRY ); + OstTraceFunctionExit0( CELLULARPROMPTDIALOG_DEVICEDIALOGWIDGET_EXIT ); + + return const_cast(this); +} + diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/src/cellularpromptdialogplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/src/cellularpromptdialogplugin.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Prompt Dialog plugin implementation +* +*/ + + +#include +#include +#include "cellularpromptdialogplugin.h" +#include "cellularpromptdialog.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cellularpromptdialogpluginTraces.h" +#endif + + +/* Initializes the resource file */ +inline void initMyResource() { Q_INIT_RESOURCE(promptdialog); } +/* removes the resource file */ +inline void cleanupMyResource() { Q_CLEANUP_RESOURCE(promptdialog); } + + +Q_EXPORT_PLUGIN2(cellularpromptdialogplugin, CellularPromptDialogPlugin) + + +// This plugin implements one device dialog type +static const struct { + const char *mTypeString; +} dialogInfos[] = { + {"com.nokia.ipconnmgmt.promptdialog/1.0"} +}; + +/** + * Constructor + */ +CellularPromptDialogPlugin::CellularPromptDialogPlugin() +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_CELLULARPROMPTDIALOGPLUGIN_ENTRY ); + + // Initializes the resource file which contains the + // docml building up the dialog + initMyResource(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_CELLULARPROMPTDIALOGPLUGIN_EXIT ); +} + +/** + * Destructor + */ +CellularPromptDialogPlugin::~CellularPromptDialogPlugin() +{ + OstTraceFunctionEntry0( DUP1_CELLULARPROMPTDIALOGPLUGIN_DCELLULARPROMPTDIALOGPLUGIN_ENTRY ); + + // Remove the loaded resources + cleanupMyResource(); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_DCELLULARPROMPTDIALOGPLUGIN_EXIT ); +} + +/** + * Create device dialog widget + */ +HbDeviceDialogInterface *CellularPromptDialogPlugin::createDeviceDialog( + const QString &deviceDialogType, + const QVariantMap ¶meters) +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_CREATEDEVICEDIALOG_ENTRY ); + + Q_UNUSED(deviceDialogType) + CellularPromptDialog* dialog = new CellularPromptDialog(parameters); + + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_CREATEDEVICEDIALOG_EXIT ); + return dialog; +} + +/** + * Check if client is allowed to use device dialog widget + */ +bool CellularPromptDialogPlugin::accessAllowed(const QString &deviceDialogType, + const QVariantMap ¶meters, const QVariantMap &securityInfo) const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_ACCESSALLOWED_ENTRY ); + + Q_UNUSED(deviceDialogType) + Q_UNUSED(parameters) + Q_UNUSED(securityInfo) + + // This plugin doesn't perform operations that may compromise security. + // All clients are allowed to use. + return true; +} + +/** + * Return information of device dialog the plugin creates + */ +bool CellularPromptDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, + const QVariantMap ¶meters, DeviceDialogInfo *info) const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_DEVICEDIALOGINFO_ENTRY ); + + Q_UNUSED(parameters) + Q_UNUSED(deviceDialogType) + + info->group = GenericDeviceDialogGroup; + info->flags = NoDeviceDialogFlags; + info->priority = DefaultPriority; + + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_DEVICEDIALOGINFO_EXIT ); + return true; +} + +/** + * Return device dialog types this plugin implements + */ +QStringList CellularPromptDialogPlugin::deviceDialogTypes() const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_DEVICEDIALOGTYPES_ENTRY ); + + QStringList types; + const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]); + for(int i = 0; i < numTypes; i++) { + types.append(dialogInfos[i].mTypeString); + } + + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_DEVICEDIALOGTYPES_EXIT ); + return types; +} + +/** + * Return plugin flags + */ +CellularPromptDialogPlugin::PluginFlags CellularPromptDialogPlugin::pluginFlags() const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_PLUGINFLAGS_ENTRY ); + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_PLUGINFLAGS_EXIT ); + return NoPluginFlags; +} + +/** + * The last error is not stored, not supported + */ +int CellularPromptDialogPlugin::error() const +{ + OstTraceFunctionEntry0( CELLULARPROMPTDIALOGPLUGIN_ERROR_ENTRY ); + OstTraceFunctionExit0( CELLULARPROMPTDIALOGPLUGIN_ERROR_EXIT ); + return 0; +} + diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/confirmqueries/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/confirmqueries/traces/OstTraceDefinitions.h Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r 77415202bfc8 -r fcbbe021d614 connectionutilities/connectionutilities.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/connectionutilities.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,22 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += confirmqueries + +CONFIG += ordered + \ No newline at end of file diff -r 77415202bfc8 -r fcbbe021d614 data/cccccc00_emulator.cre Binary file data/cccccc00_emulator.cre has changed diff -r 77415202bfc8 -r fcbbe021d614 dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp --- a/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -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 77415202bfc8 -r fcbbe021d614 dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp --- a/dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/dbcreator/commsdatcreator/Src/cdcwlandevicesettings.cpp Fri Apr 16 15:21:37 2010 +0300 @@ -32,8 +32,8 @@ // CONSTANTS // WLAN Device Settings table - default settings -const TUint32 KDefaultBGScanInterval = 0; // No background scan -const TBool KDefaultUseDefSettings = ETrue; +const TUint32 KDefaultBGScanInterval = 0xFFFFFFFF; // Automatic scan +const TBool KDefaultUseDefSettings = ETrue; const TUint32 KDefaultLongRetry = 4; const TUint32 KDefaultShortRetry = 7; const TUint32 KDefaultRTS = 2347; diff -r 77415202bfc8 -r fcbbe021d614 dbcreator/commsdatcreator/bwins/commsdatcreatoru.def --- a/dbcreator/commsdatcreator/bwins/commsdatcreatoru.def Tue Feb 02 00:24:11 2010 +0200 +++ b/dbcreator/commsdatcreator/bwins/commsdatcreatoru.def Fri Apr 16 15:21:37 2010 +0300 @@ -1,8 +1,7 @@ EXPORTS - ??1CCdcCommsDatCreator@@UAE@XZ @ 1 NONAME ; CCdcCommsDatCreator::~CCdcCommsDatCreator(void) + ?NewL@CCdcCommsDatCreator@@SAPAV1@XZ @ 1 NONAME ; class CCdcCommsDatCreator * CCdcCommsDatCreator::NewL(void) ?CreateCommsDatL@CCdcCommsDatCreator@@QAEXABV?$TBuf@$0BAA@@@@Z @ 2 NONAME ; void CCdcCommsDatCreator::CreateCommsDatL(class TBuf<256> const &) - ?CreateTablesL@CCdcCommsDatCreator@@QAEXXZ @ 3 NONAME ; void CCdcCommsDatCreator::CreateTablesL(void) - ?DumpCommsDatL@CCdcCommsDatCreator@@QAEXABV?$TBuf@$0BAA@@@@Z @ 4 NONAME ; void CCdcCommsDatCreator::DumpCommsDatL(class TBuf<256> const &) - ?NewL@CCdcCommsDatCreator@@SAPAV1@XZ @ 5 NONAME ; class CCdcCommsDatCreator * CCdcCommsDatCreator::NewL(void) - ?NewLC@CCdcCommsDatCreator@@SAPAV1@XZ @ 6 NONAME ; class CCdcCommsDatCreator * CCdcCommsDatCreator::NewLC(void) + ?DumpCommsDatL@CCdcCommsDatCreator@@QAEXABV?$TBuf@$0BAA@@@@Z @ 3 NONAME ; void CCdcCommsDatCreator::DumpCommsDatL(class TBuf<256> const &) + ?NewLC@CCdcCommsDatCreator@@SAPAV1@XZ @ 4 NONAME ; class CCdcCommsDatCreator * CCdcCommsDatCreator::NewLC(void) + ?CreateTablesL@CCdcCommsDatCreator@@QAEXXZ @ 5 NONAME ; void CCdcCommsDatCreator::CreateTablesL(void) diff -r 77415202bfc8 -r fcbbe021d614 dbcreator/conf/commsdatcreator.confml Binary file dbcreator/conf/commsdatcreator.confml has changed diff -r 77415202bfc8 -r fcbbe021d614 dbcreator/inc/cdccommsdatcreator.h --- a/dbcreator/inc/cdccommsdatcreator.h Tue Feb 02 00:24:11 2010 +0200 +++ b/dbcreator/inc/cdccommsdatcreator.h Fri Apr 16 15:21:37 2010 +0300 @@ -67,7 +67,7 @@ /** Destructor */ - IMPORT_C virtual ~CCdcCommsDatCreator(); + virtual ~CCdcCommsDatCreator(); private: diff -r 77415202bfc8 -r fcbbe021d614 ipcm_plat/access_point_engine_misc_api/inc/ApProtHandler.h --- a/ipcm_plat/access_point_engine_misc_api/inc/ApProtHandler.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_plat/access_point_engine_misc_api/inc/ApProtHandler.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define CAPPROTHANDLER_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_plat/access_point_engine_misc_api/inc/VpnAPEngine.h --- a/ipcm_plat/access_point_engine_misc_api/inc/VpnAPEngine.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_plat/access_point_engine_misc_api/inc/VpnAPEngine.h Fri Apr 16 15:21:37 2010 +0300 @@ -22,7 +22,7 @@ #define VPN_AP_ENGINE_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_plat/access_point_engine_misc_api/inc/VpnAPItem.h --- a/ipcm_plat/access_point_engine_misc_api/inc/VpnAPItem.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_plat/access_point_engine_misc_api/inc/VpnAPItem.h Fri Apr 16 15:21:37 2010 +0300 @@ -22,7 +22,7 @@ #define VPN_AP_ITEM_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/APAccessPointItem.h --- a/ipcm_pub/access_point_engine_api/inc/APAccessPointItem.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APAccessPointItem.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define ACCESSPOINTITEM_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/APDataHandler.h --- a/ipcm_pub/access_point_engine_api/inc/APDataHandler.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APDataHandler.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define APDATAHANDLER_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/APNetworks.h --- a/ipcm_pub/access_point_engine_api/inc/APNetworks.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APNetworks.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define CAPNETWORKS_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/APSelect.h --- a/ipcm_pub/access_point_engine_api/inc/APSelect.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APSelect.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define CAPSELECT_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES @@ -65,6 +65,7 @@ { TUint32 iVpnIapId; TUint32 iHomeIapId; + TUint32 iHomeSnapId; HBufC * iName; }TVpnData; diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/APUtils.h --- a/ipcm_pub/access_point_engine_api/inc/APUtils.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/APUtils.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ #define APUTILS_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ActiveApDb.h --- a/ipcm_pub/access_point_engine_api/inc/ActiveApDb.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ActiveApDb.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,8 +21,7 @@ #define ACTIVE_APDB_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. - +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES #include diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ApEngineConsts.h --- a/ipcm_pub/access_point_engine_api/inc/ApEngineConsts.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ApEngineConsts.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define APENGINE_CONSTS_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. #include diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ApEngineVer.h --- a/ipcm_pub/access_point_engine_api/inc/ApEngineVer.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ApEngineVer.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,8 +20,7 @@ #define APENGINE_VER_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. - +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // #define __PROXY_SETTINGS diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ApListItem.h --- a/ipcm_pub/access_point_engine_api/inc/ApListItem.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ApListItem.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ #define CAPLISTITEM_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ApNetworkItem.h --- a/ipcm_pub/access_point_engine_api/inc/ApNetworkItem.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ApNetworkItem.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ #define CAPNETWORKITEM_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/ApNetworkItemlist.h --- a/ipcm_pub/access_point_engine_api/inc/ApNetworkItemlist.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/ApNetworkItemlist.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define CAPNETWORKITEMLIST_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_engine_api/inc/Aplistitemlist.h --- a/ipcm_pub/access_point_engine_api/inc/Aplistitemlist.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_engine_api/inc/Aplistitemlist.h Fri Apr 16 15:21:37 2010 +0300 @@ -20,7 +20,7 @@ #define CAPLISTITEMLIST_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_settings_handler_api/inc/ApSettingsHandlerCommons.h --- a/ipcm_pub/access_point_settings_handler_api/inc/ApSettingsHandlerCommons.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_settings_handler_api/inc/ApSettingsHandlerCommons.h Fri Apr 16 15:21:37 2010 +0300 @@ -21,7 +21,7 @@ #define APSETTINGS_HANDLER_COMMONS_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/access_point_settings_handler_api/inc/Apsettingshandlerui.h --- a/ipcm_pub/access_point_settings_handler_api/inc/Apsettingshandlerui.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/access_point_settings_handler_api/inc/Apsettingshandlerui.h Fri Apr 16 15:21:37 2010 +0300 @@ -22,7 +22,7 @@ #define APSETTINGS_HANDLER_H // Deprecation warning -#warning This header file has been deprecated. Will be removed in one of the next SDK releases. +#warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. // INCLUDES diff -r 77415202bfc8 -r fcbbe021d614 ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h --- a/ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h Tue Feb 02 00:24:11 2010 +0200 +++ b/ipcm_pub/connection_settings_api/inc/cmgenconnsettings.h Fri Apr 16 15:21:37 2010 +0300 @@ -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 - diff -r 77415202bfc8 -r fcbbe021d614 ipconnmgmt.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipconnmgmt.pro Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += \ + connectionutilities \ + connectionmonitoring + +CONFIG += ordered + +symbian*: { + SYMBIAN_PLATFORMS = WINSCW ARMV5 +} diff -r 77415202bfc8 -r fcbbe021d614 layers.sysdef.xml --- a/layers.sysdef.xml Tue Feb 02 00:24:11 2010 +0200 +++ b/layers.sysdef.xml Fri Apr 16 15:21:37 2010 +0300 @@ -1,5 +1,5 @@ - ]> @@ -8,6 +8,7 @@ + diff -r 77415202bfc8 -r fcbbe021d614 package_definition.xml --- a/package_definition.xml Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 77415202bfc8 -r fcbbe021d614 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Tue Feb 02 00:24:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 77415202bfc8 -r fcbbe021d614 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Fri Apr 16 15:21:37 2010 +0300 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +