bearermanagement/mpm/src/mpmserversession.cpp
changeset 66 ed07dcc72692
parent 60 a9c709db68db
equal deleted inserted replaced
64:84c6623982f6 66:ed07dcc72692
   883                                   snapId, 
   883                                   snapId, 
   884                                   iMigrateIap, 
   884                                   iMigrateIap, 
   885                                   ERoaming,
   885                                   ERoaming,
   886                                   *this );
   886                                   *this );
   887 
   887 
       
   888     TWlanIapType iapType = MyServer().CommsDatAccess()->CheckWlanL( iMigrateIap );
       
   889 
       
   890     // If this is a cellular IAP, we must check the current cellular data usage setting in case it
       
   891     // has changed to disabled mode while MPM was waiting for a migrate confirmation. If cellular
       
   892     // data usage has been disabled, terminate the connection attempt with KErrPermissionDenied.
       
   893     if ( iapType == ENotWlanIap )
       
   894         {
       
   895         TInt cellularUsage = MyServer().DataUsageWatcher()->CellularDataUsage();
       
   896         if ( cellularUsage == ECmCellularDataUsageDisabled )
       
   897             {
       
   898             MPMLOGSTRING( "Trying to migrate to cellular IAP, but cellular data usage is disabled, stopping" )
       
   899             iMigrateState = EMigrateNone;
       
   900             RoamingConfirmationCompletedL( KErrPermissionDenied, EMsgQueryThisTime, EFalse );
       
   901             return;
       
   902             }
       
   903         }
       
   904 
   888     iMigrateState = EMigrateUserConfirmation;
   905     iMigrateState = EMigrateUserConfirmation;
   889 
   906 
   890     // Confirm only if this IAP is not already in use
   907     // Confirm only if this IAP is not already in use
   891     //
   908     //
   892     if ( ( currentIap != iMigrateIap ) && 
   909     if ( ( currentIap != iMigrateIap ) && 
   908         if ( !IsUpgrade( currentIap, iMigrateIap, availableIAPList ) )
   925         if ( !IsUpgrade( currentIap, iMigrateIap, availableIAPList ) )
   909                     {
   926                     {
   910                     reconnect = ETrue;
   927                     reconnect = ETrue;
   911                     }
   928                     }
   912 
   929 
   913         //Display confirm dialog only if we are moving to cellular IAP
   930         // Display confirm dialog only if we are moving to cellular IAP
   914         if ( MyServer().CommsDatAccess()->CheckWlanL( iMigrateIap ) == ENotWlanIap )
   931         if ( iapType == ENotWlanIap )
   915             {
   932             {
   916             // Check that connection preferences don't deny queries, and
   933             // Check that connection preferences don't deny queries, and
   917             // enough time has elapsed from the last query cancelled by the user.
   934             // enough time has elapsed from the last query cancelled by the user.
   918             if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
   935             if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
   919                  !MyServer().IsConnPermQueryTimerOn() )
   936                     !MyServer().IsConnPermQueryTimerOn() )
   920                 {
   937                 {
   921                 if ( MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   938                 if ( MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   922                     {
   939                     {
   923                     //International roaming
   940                     //International roaming
   924                     iConfirmDlgRoaming = CMPMConfirmDlgRoaming::NewL( 
   941                     iConfirmDlgRoaming = CMPMConfirmDlgRoaming::NewL( 
  1717 
  1734 
  1718     TConnMonIapInfo availableIAPs;
  1735     TConnMonIapInfo availableIAPs;
  1719     availableIAPs = GetAvailableIAPs();
  1736     availableIAPs = GetAvailableIAPs();
  1720 
  1737 
  1721     MPMLOGSTRING2( "CMPMServerSession::HandleServerRegisterPrefIAPNotifL \
  1738     MPMLOGSTRING2( "CMPMServerSession::HandleServerRegisterPrefIAPNotifL \
  1722 - IAPs count: %d", availableIAPs.iCount)
  1739 - available IAPs count: %d", availableIAPs.iCount)
  1723 
  1740 
  1724 #ifdef _DEBUG
  1741 #ifdef _DEBUG
  1725     for (TUint i = 0; i < availableIAPs.Count(); i++)
  1742     for (TUint i = 0; i < availableIAPs.Count(); i++)
  1726         {
  1743         {
  1727         MPMLOGSTRING2(
  1744         MPMLOGSTRING2(
  1737     if ( availableIAPs.iCount > 0 && regNetId )
  1754     if ( availableIAPs.iCount > 0 && regNetId )
  1738         {
  1755         {
  1739         PrefIAPNotificationL( availableIAPs, EBearerMan );
  1756         PrefIAPNotificationL( availableIAPs, EBearerMan );
  1740         }
  1757         }
  1741 
  1758 
  1742     // In case the mobility application register to preferred IAP notification
       
  1743     // we have to make sure we get availability every once in a while.
       
  1744     // 
       
  1745     RArray<TUint> iapPath;
       
  1746     CleanupClosePushL( iapPath );
       
  1747     CleanupStack::PopAndDestroy( &iapPath );
       
  1748     aMessage.Complete( KErrNone );
  1759     aMessage.Complete( KErrNone );
  1749     }
  1760     }
  1750 
  1761 
  1751 
  1762 
  1752 // -----------------------------------------------------------------------------
  1763 // -----------------------------------------------------------------------------