bearermanagement/mpm/src/mpmiapselection.cpp
branchRCL_3
changeset 65 14754bf06654
parent 62 bb1f80fb7db2
child 69 cf1b3ddbe9a1
equal deleted inserted replaced
62:bb1f80fb7db2 65:14754bf06654
    79 //
    79 //
    80 CMPMIapSelection::~CMPMIapSelection()
    80 CMPMIapSelection::~CMPMIapSelection()
    81     {
    81     {
    82     // stop confirm dialog in case one exists
    82     // stop confirm dialog in case one exists
    83     //
    83     //
       
    84     MPMLOGSTRING( "CMPMIapSelection::~CMPMIapSelection" )
    84     StopDisplayingStartingDlg();
    85     StopDisplayingStartingDlg();
    85     
    86     
    86     delete iConfirmDlgStarting;
       
    87     delete iDialog;
    87     delete iDialog;
    88     delete iWlanDialog;
    88     delete iWlanDialog;
    89     }
    89     }
    90 
    90 
    91 // -----------------------------------------------------------------------------
    91 // -----------------------------------------------------------------------------
   492 
   492 
   493     TBool   iapTypeLanOrWlan = EFalse;
   493     TBool   iapTypeLanOrWlan = EFalse;
   494     TConnectionId connId = iSession->ConnectionId();
   494     TConnectionId connId = iSession->ConnectionId();
   495 
   495 
   496     ChooseBestIAPL( iChooseIapPref, availableIAPList, iNextBestExists );
   496     ChooseBestIAPL( iChooseIapPref, availableIAPList, iNextBestExists );
       
   497     CleanupStack::PopAndDestroy( &availableIAPList );
   497     TUint32 validateIapId = iChooseIapPref.IapId();
   498     TUint32 validateIapId = iChooseIapPref.IapId();
   498     // Check if any suitable IAP's were found, if not then complete selection with error code
   499     // Check if any suitable IAP's were found, if not then complete selection with error code
   499     if ( validateIapId == 0 )
   500     if ( validateIapId == 0 )
   500         {
   501         {
   501         ChooseIapComplete( KErrNotFound, NULL );
   502         ChooseIapComplete( KErrNotFound, NULL );
   502         CleanupStack::PopAndDestroy( &availableIAPList );
       
   503         return;
   503         return;
   504         }
   504         }
   505     
   505     
   506     TUint32 retNetId( 0 );
   506     TUint32 retNetId( 0 );
   507     iCommsDatAccess->ValidateIapL( connId, 
   507     iCommsDatAccess->ValidateIapL( connId, 
   588                         snap, 
   588                         snap, 
   589                         validateIapId, 
   589                         validateIapId, 
   590                         EStarting,
   590                         EStarting,
   591                         *iSession );
   591                         *iSession );
   592                 ChooseIapComplete( KErrNone, &iChooseIapPref );
   592                 ChooseIapComplete( KErrNone, &iChooseIapPref );
   593 
   593                 }
   594                 }
   594             }
   595 
   595         }
   596             }
       
   597         }
       
   598 
       
   599     CleanupStack::PopAndDestroy( &availableIAPList );    
       
   600     }
   596     }
   601 
   597 
   602 // -----------------------------------------------------------------------------
   598 // -----------------------------------------------------------------------------
   603 // CMPMIapSelection::CheckGprsServicesAllowedL
   599 // CMPMIapSelection::CheckGprsServicesAllowedL
   604 // -----------------------------------------------------------------------------
   600 // -----------------------------------------------------------------------------
   728     TInt                aError,
   724     TInt                aError,
   729     const TMpmConnPref* aPolicyPref )
   725     const TMpmConnPref* aPolicyPref )
   730     {
   726     {
   731     MPMLOGSTRING2( "CMPMIapSelection::ChooseIapComplete aError = %d", aError )
   727     MPMLOGSTRING2( "CMPMIapSelection::ChooseIapComplete aError = %d", aError )
   732     
   728     
   733     if ( ( aError == KErrNone ) &&
       
   734         !( iChooseIapPref.NoteBehaviour() &
       
   735            TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
       
   736         {
       
   737         TConnectionState state =
       
   738             iSession->MyServer().CheckUsageOfIap( aPolicyPref->IapId(), 
       
   739                                                   iSession->ConnectionId() );
       
   740         TBool connectionAlreadyActive = (state == EStarted || state == EStarting || state == ERoaming);
       
   741         if ( !connectionAlreadyActive &&
       
   742                 ( iSession->IsMMSIap( aPolicyPref->IapId() ) == EFalse ) )
       
   743             {
       
   744             CConnectionUiUtilities* connUiUtils( NULL );
       
   745             TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
       
   746             if ( popupError == KErrNone )
       
   747         	    {
       
   748             	connUiUtils->ConnectingViaDiscreetPopup( aPolicyPref->IapId() );
       
   749                	delete connUiUtils;
       
   750         	    }
       
   751             }
       
   752         }
       
   753     
       
   754     if( iWlanDialog )
   729     if( iWlanDialog )
   755         {
   730         {
   756         delete iWlanDialog;
   731         delete iWlanDialog;
   757         iWlanDialog = NULL;
   732         iWlanDialog = NULL;
   758         }
   733         }
   759 
   734 
   760     iSession->ChooseIapComplete( aError, aPolicyPref );
       
   761     // Set choose iap state to none
   735     // Set choose iap state to none
   762     iChooseIapState = ENoConnection;
   736     iChooseIapState = ENoConnection;
   763     iNextBestExists = EFalse;
   737     iNextBestExists = EFalse;
   764     iUserSelectionSnapId = 0;
   738     iUserSelectionSnapId = 0;
   765     iUserSelectionIapId = 0;
   739     iUserSelectionIapId = 0;
   766     iImplicitState = EImplicitStart;
   740     iImplicitState = EImplicitStart;
       
   741 
       
   742 	iSession->ChooseIapComplete( aError, aPolicyPref );
   767     }
   743     }
   768 
   744 
   769 
   745 
   770 // -----------------------------------------------------------------------------
   746 // -----------------------------------------------------------------------------
   771 // CMPMIapSelection::UserWlanSelectionDoneL
   747 // CMPMIapSelection::UserWlanSelectionDoneL
  1053 //
  1029 //
  1054 void CMPMIapSelection::ImplicitConnectionL()
  1030 void CMPMIapSelection::ImplicitConnectionL()
  1055     {
  1031     {
  1056     if( iImplicitState  == EImplicitStart )
  1032     if( iImplicitState  == EImplicitStart )
  1057         {
  1033         {
  1058         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitStart" )
  1034         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitStart" )
  1059         iImplicitState = EImplicitWlanScan;
  1035         iImplicitState = EImplicitWlanScan;
  1060         ImplicitConnectionCheckWlanScanNeededL();
  1036         ImplicitConnectionCheckWlanScanNeededL();
  1061         }
  1037         }
  1062     else if( iImplicitState  == EImplicitWlanScan )
  1038     else if( iImplicitState  == EImplicitWlanScan )
  1063         {
  1039         {
  1064         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitWlanScan" )
  1040         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitWlanScan" )
  1065         iImplicitState = EImplicitUserSelection;
  1041         iImplicitState = EImplicitUserSelection;
  1066         ImplicitConnectionIapSelectionL();
  1042         ImplicitConnectionIapSelectionL();
  1067         }
  1043         }
  1068     else if( iImplicitState  == EImplicitUserSelection )
  1044     else if( iImplicitState  == EImplicitUserSelection )
  1069         {
  1045         {
  1070         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitUserSelection" )
  1046         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitUserSelection" )
  1071         iImplicitState = EImplicitWlanQuery;
  1047         iImplicitState = EImplicitWlanQuery;
  1072         ImplicitConnectionWlanNoteL();
  1048         ImplicitConnectionWlanNoteL();
  1073         }
  1049         }
  1074     else //EImplicitWlanQuery
  1050     else //EImplicitWlanQuery
  1075         {
  1051         {
  1076         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitWlanQuery" )
  1052         MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitWlanQuery" )
  1077         CompleteImplicitConnectionL();
  1053         CompleteImplicitConnectionL();
  1078         }
  1054         }
  1079     }
  1055     }
  1080 
  1056 
  1081 // -----------------------------------------------------------------------------
  1057 // -----------------------------------------------------------------------------