bearermanagement/mpm/src/mpmwlanquerydialog.cpp
branchRCL_3
changeset 17 c14618f9de99
parent 15 4dc3bb0099b0
child 45 4c83dcfb6f1a
equal deleted inserted replaced
15:4dc3bb0099b0 17:c14618f9de99
   133     CMPMWlanQueryDialog* dlg = iIapSelection.Session()->MyServer().FirstInWlanQueryQueue();
   133     CMPMWlanQueryDialog* dlg = iIapSelection.Session()->MyServer().FirstInWlanQueryQueue();
   134     if ( dlg )
   134     if ( dlg )
   135         {
   135         {
   136         MPMLOGSTRING( "CMPMWlanQueryDialog::~CMPMWlanQueryDialog starts new dialog" )
   136         MPMLOGSTRING( "CMPMWlanQueryDialog::~CMPMWlanQueryDialog starts new dialog" )
   137         dlg->OfferInformation( iWlanIapId, 
   137         dlg->OfferInformation( iWlanIapId, 
   138                                iIapSelection.OfflineNoteResponse(),
       
   139                                iStatus.Int() );
   138                                iStatus.Int() );
   140         // In destructor we cannot let the query leave
   139         // In destructor we cannot let the query leave
   141         TRAPD( err, dlg->StartWlanQueryL(); )
   140         TRAPD( err, dlg->StartWlanQueryL(); )
   142         if ( err != KErrNone )
   141         if ( err != KErrNone )
   143             {
   142             {
   193                    iWlanQueryState )
   192                    iWlanQueryState )
   194     if( iWlanQueryState == EOffline )
   193     if( iWlanQueryState == EOffline )
   195         {
   194         {
   196         if( iStatus.Int() == KErrNone )
   195         if( iStatus.Int() == KErrNone )
   197             {
   196             {
   198             iIapSelection.SetOfflineNoteResponse( EOfflineResponseYes );
   197             iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse(
       
   198                     EOfflineResponseYes );
   199             if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) )
   199             if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) )
   200                 {
   200                 {
   201                 MPMLOGSTRING( "CMPMWlanQueryDialog::RunL starting wlan network query" )
   201                 MPMLOGSTRING( "CMPMWlanQueryDialog::RunL starting wlan network query" )
   202                 GetNetworkPrefs();
   202                 GetNetworkPrefs();
   203                 return;
   203                 return;
   204                 }
   204                 }
   205             }
   205             }
   206         else if ( iStatus.Int() == KErrCancel )
   206         else if ( iStatus.Int() == KErrCancel )
   207             {
   207             {
   208             iIapSelection.SetOfflineNoteResponse( EOfflineResponseNo );
   208             iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse(
       
   209                     EOfflineResponseNo );
   209             MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL offline query returned %d", 
   210             MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL offline query returned %d", 
   210                            iStatus.Int() )
   211                            iStatus.Int() )
   211             }
   212             }
   212         else
   213         else
   213             {
   214             {
   460     TUint32 noteBehaviour( 0 );
   461     TUint32 noteBehaviour( 0 );
   461     noteBehaviour = iIapSelection.MpmConnPref().NoteBehaviour();
   462     noteBehaviour = iIapSelection.MpmConnPref().NoteBehaviour();
   462     MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery noteBehaviour = %d", noteBehaviour )
   463     MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery noteBehaviour = %d", noteBehaviour )
   463     
   464     
   464     if( !emergencyCallEstablished && 
   465     if( !emergencyCallEstablished && 
   465         iIapSelection.Session()->IsPhoneOfflineL() && 
   466         iIapSelection.Session()->MyServer().IsPhoneOffline() && 
   466         !activeWlanIap && 
   467         !activeWlanIap && 
   467         iIapSelection.OfflineNoteResponse() != EOfflineResponseYes &&
   468         iIapSelection.Session()->MyServer().OfflineWlanQueryResponse() != EOfflineResponseYes &&
   468         iOverrideStatus == KErrNone )
   469         iOverrideStatus == KErrNone )
   469         {
   470         {
   470         // if user has already refused offline note complete immediately
   471         if ( noteBehaviour & TExtendedConnPref::ENoteBehaviourConnDisableQueries )
   471         //
       
   472         if ( iIapSelection.OfflineNoteResponse() == EOfflineResponseNo )
       
   473             {
       
   474             MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery user has already refused offline" )
       
   475             iIapSelection.UserWlanSelectionDoneL( KErrCancel, iWlanIapId );
       
   476             }
       
   477         else if ( noteBehaviour & TExtendedConnPref::ENoteBehaviourConnDisableQueries )
       
   478             {
   472             {
   479             MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery offline note query not shown due to disabled queries" )
   473             MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery offline note query not shown due to disabled queries" )
   480             iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
   474             iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
   481             }
   475             }
   482         else
   476         else
   527 // -----------------------------------------------------------------------------
   521 // -----------------------------------------------------------------------------
   528 // CMPMWlanQueryDialog::OfferInformation
   522 // CMPMWlanQueryDialog::OfferInformation
   529 // -----------------------------------------------------------------------------
   523 // -----------------------------------------------------------------------------
   530 //
   524 //
   531 void CMPMWlanQueryDialog::OfferInformation(
   525 void CMPMWlanQueryDialog::OfferInformation(
   532                 TUint32 aWlanIapId, 
   526                 TUint32 aWlanIapId,
   533                 TOfflineNoteResponse aOfflineStatus,
       
   534                 TInt aDialogStatus )
   527                 TInt aDialogStatus )
   535     {
   528     {
   536     TBool isEasyWlan( EFalse );
   529     TBool isEasyWlan( EFalse );
   537     // Take information from earlier note into use
   530     // Take information from earlier note into use
   538     // if the selected IAP is EasyWLAN or Offline note response was No.
   531     // if the selected IAP is EasyWLAN or Offline note response was No.
   549                        aWlanIapId ) 
   542                        aWlanIapId ) 
   550 
   543 
   551         iWlanIapId      = aWlanIapId;
   544         iWlanIapId      = aWlanIapId;
   552         iOverrideStatus = aDialogStatus;
   545         iOverrideStatus = aDialogStatus;
   553         }
   546         }
   554     if ( aOfflineStatus != EOfflineResponseUndefined )
   547     TOfflineWlanQueryResponse offlineResponse =
       
   548             iIapSelection.Session()->MyServer().OfflineWlanQueryResponse();
       
   549     if ( offlineResponse != EOfflineResponseUndefined )
   555         {
   550         {
   556         MPMLOGSTRING3( "CMPMWlanQueryDialog<0x%x>::OfferInformation: offline response %d",
   551         MPMLOGSTRING3( "CMPMWlanQueryDialog<0x%x>::OfferInformation: offline response %d",
   557                        iIapSelection.Session()->ConnectionId(),
   552                        iIapSelection.Session()->ConnectionId(),
   558                        aOfflineStatus ) 
   553                        offlineResponse )
   559         iIapSelection.SetOfflineNoteResponse( aOfflineStatus );        
       
   560         iOverrideStatus = aDialogStatus;
   554         iOverrideStatus = aDialogStatus;
   561         }
   555         }
   562 
   556 
   563 #ifdef _LOG
   557 #ifdef _LOG
   564     else
   558     else