bearermanagement/mpm/src/mpmserver.cpp
changeset 56 dd6aaa97e7b1
parent 44 a0c4ceac30d0
child 59 2709c04a4af5
equal deleted inserted replaced
52:bbe4544dfd31 56:dd6aaa97e7b1
    40 #include "mpmprivatecrkeys.h"
    40 #include "mpmprivatecrkeys.h"
    41 #include "mpmcsidwatcher.h"
    41 #include "mpmcsidwatcher.h"
    42 #include "mpmvpntogglewatcher.h"
    42 #include "mpmvpntogglewatcher.h"
    43 #include "mpmdatausagewatcher.h"
    43 #include "mpmdatausagewatcher.h"
    44 #include "mpmpropertydef.h"
    44 #include "mpmpropertydef.h"
       
    45 #include "mpmconnpermquerytimer.h"
    45 
    46 
    46 static const TUint32 KUidKmdServer = 0x1000088A;
    47 static const TUint32 KUidKmdServer = 0x1000088A;
    47     
    48     
    48 // ============================= LOCAL FUNCTIONS ===============================
    49 // ============================= LOCAL FUNCTIONS ===============================
    49 
    50 
    97       iMpmDataUsageWatcher( NULL ),
    98       iMpmDataUsageWatcher( NULL ),
    98       iCommsDatAccess( NULL ),
    99       iCommsDatAccess( NULL ),
    99       iConnUiUtils( NULL ),
   100       iConnUiUtils( NULL ),
   100       iOfflineMode( ECoreAppUIsNetworkConnectionAllowed ),
   101       iOfflineMode( ECoreAppUIsNetworkConnectionAllowed ),
   101       iOfflineWlanQueryResponse( EOfflineResponseUndefined ),      
   102       iOfflineWlanQueryResponse( EOfflineResponseUndefined ),      
   102       iRoamingToWlanPeriodic( NULL )
   103       iRoamingToWlanPeriodic( NULL ),
       
   104       iConnPermQueryTimer( NULL )
   103     {
   105     {
   104     }
   106     }
   105 
   107 
   106 
   108 
   107 // -----------------------------------------------------------------------------
   109 // -----------------------------------------------------------------------------
   268     iDedicatedClients.Close();
   270     iDedicatedClients.Close();
   269 
   271 
   270     delete iCommsDatAccess;
   272     delete iCommsDatAccess;
   271     
   273     
   272     delete iConnUiUtils;
   274     delete iConnUiUtils;
       
   275     
       
   276     delete iConnPermQueryTimer;
   273     }
   277     }
   274 
   278 
   275 // -----------------------------------------------------------------------------
   279 // -----------------------------------------------------------------------------
   276 // CMPMServer::SetVpnToggleValuesL
   280 // CMPMServer::SetVpnToggleValuesL
   277 // -----------------------------------------------------------------------------
   281 // -----------------------------------------------------------------------------
   381     {
   385     {
   382     MPMLOGSTRING3(
   386     MPMLOGSTRING3(
   383         "CMPMServer::AppendBMConnection - aConnId = 0x%x, aSnap = %i",
   387         "CMPMServer::AppendBMConnection - aConnId = 0x%x, aSnap = %i",
   384         aConnId, aSnap )
   388         aConnId, aSnap )
   385 
   389 
   386     // Set the Connection Id, SNAP, Iap Id and connection state
   390     // Set the Connection Id, SNAP, Iap Id and connection state, into TActiveBMConn
   387     // 
       
   388     TConnectionInfo connInfo;
       
   389     connInfo.iConnId = aConnId;
       
   390     connInfo.iSnap   = aSnap;
       
   391     connInfo.iIapId  = aIapId;
       
   392     connInfo.iState  = aState;
       
   393     connInfo.iAppUid = aSession.AppUid();
       
   394 
       
   395     // Package into TActiveBMConn //TODO Redundant.. remove the other one.
       
   396     // 
       
   397     TActiveBMConn conn;
   391     TActiveBMConn conn;
   398     conn.iConnInfo          = connInfo;
   392     conn.iConnInfo.iConnId = aConnId;
       
   393     conn.iConnInfo.iSnap   = aSnap;
       
   394     conn.iConnInfo.iIapId  = aIapId;
       
   395     conn.iConnInfo.iState  = aState;
       
   396     conn.iConnInfo.iAppUid = aSession.AppUid();
   399 
   397 
   400     TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
   398     TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
   401 
   399 
   402     if ( index1 == KErrNotFound )
   400     if ( index1 == KErrNotFound )
   403         {
   401         {
  1480 void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
  1478 void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
  1481     {
  1479     {
  1482     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
  1480     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
  1483     
  1481     
  1484     // cancel the periodic object
  1482     // cancel the periodic object
  1485     if ( iRoamingToWlanPeriodic != NULL )
  1483     if ( iRoamingToWlanPeriodic )
  1486         {
  1484         {
  1487         iRoamingToWlanPeriodic->Cancel();
  1485         iRoamingToWlanPeriodic->Cancel();
  1488         }
  1486         }
  1489 
  1487 
  1490     // Copy all available wlan iap ids to own array
  1488     // Copy all available wlan iap ids to own array
  1551 //    
  1549 //    
  1552 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1550 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1553     {
  1551     {
  1554     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1552     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1555     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
  1553     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
       
  1554             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
       
  1555     // Added also execution of policy based roaming logic because
       
  1556     // connections that are in EStarting state, when WLAN signal
       
  1557     // gets weak, would remain in WLAN as long as signal is weak. 
       
  1558     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingFromWlanL(
  1556             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
  1559             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
  1557     return 0;
  1560     return 0;
  1558     }
  1561     }
  1559 
  1562 
  1560 
  1563 
  2016     MPMLOGSTRING( "CMPMServer::SetOfflineWlanQueryResponse" )
  2019     MPMLOGSTRING( "CMPMServer::SetOfflineWlanQueryResponse" )
  2017 
  2020 
  2018     iOfflineWlanQueryResponse = aResponse;
  2021     iOfflineWlanQueryResponse = aResponse;
  2019     }
  2022     }
  2020 
  2023 
       
  2024 // ---------------------------------------------------------------------------
       
  2025 // CMPMServer::StartConnPermQueryTimer
       
  2026 // Starts the connection permission query timer.
       
  2027 // ---------------------------------------------------------------------------
       
  2028 //
       
  2029 void CMPMServer::StartConnPermQueryTimer()
       
  2030     {
       
  2031     MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer" )
       
  2032 
       
  2033     if ( !iConnPermQueryTimer )
       
  2034         {
       
  2035         TRAPD( err, iConnPermQueryTimer = CMPMConnPermQueryTimer::NewL( this ) );
       
  2036         if ( err == KErrNone )
       
  2037             {
       
  2038             iConnPermQueryTimer->StartTimer();
       
  2039             MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer: Ok." )
       
  2040             }
       
  2041         }
       
  2042     }
       
  2043 
       
  2044 // ---------------------------------------------------------------------------
       
  2045 // CMPMServer::ResetConnPermQueryTimer
       
  2046 // Resets the connection permission query timer.
       
  2047 // ---------------------------------------------------------------------------
       
  2048 //
       
  2049 void CMPMServer::ResetConnPermQueryTimer()
       
  2050     {
       
  2051     MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer" )
       
  2052 
       
  2053     if ( iConnPermQueryTimer )
       
  2054         {
       
  2055         delete iConnPermQueryTimer;
       
  2056         iConnPermQueryTimer = NULL;
       
  2057         MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer: Ok." )
       
  2058         }
       
  2059     }
       
  2060 
       
  2061 // ---------------------------------------------------------------------------
       
  2062 // CMPMServer::IsConnPermQueryTimerOn
       
  2063 // Tells if the connection permission query timer is on.
       
  2064 // ---------------------------------------------------------------------------
       
  2065 //
       
  2066 TBool CMPMServer::IsConnPermQueryTimerOn()
       
  2067     {
       
  2068     MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn" )
       
  2069 
       
  2070     TBool retval = EFalse;
       
  2071     if ( iConnPermQueryTimer )
       
  2072         {
       
  2073         retval = ETrue;
       
  2074         MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn: Yes." )
       
  2075         }
       
  2076     return retval;
       
  2077     }
       
  2078 
  2021 // -----------------------------------------------------------------------------
  2079 // -----------------------------------------------------------------------------
  2022 // TMPMBlackListConnId::Append
  2080 // TMPMBlackListConnId::Append
  2023 // -----------------------------------------------------------------------------
  2081 // -----------------------------------------------------------------------------
  2024 //
  2082 //
  2025 void TMPMBlackListConnId::Append( TUint32 aIap, TBlacklistCategory aCategory )
  2083 void TMPMBlackListConnId::Append( TUint32 aIap, TBlacklistCategory aCategory )