fmradio/fmradio/src/fmradioappui.cpp
branchRCL_3
changeset 60 37cf54fb509f
parent 52 5a31ddd3bfd9
equal deleted inserted replaced
52:5a31ddd3bfd9 60:37cf54fb509f
  1355     
  1355     
  1356     //compare bitmask to see if feature supported
  1356     //compare bitmask to see if feature supported
  1357     if ( !(iFMRadioVariationFlags & KFMRadioInternalAntennaSupported) &&
  1357     if ( !(iFMRadioVariationFlags & KFMRadioInternalAntennaSupported) &&
  1358             iCurrentRadioState != EFMRadioStateOffForPhoneCall && 
  1358             iCurrentRadioState != EFMRadioStateOffForPhoneCall && 
  1359             iCurrentRadioState != EFMRadioStateOffBeforePhoneCall )
  1359             iCurrentRadioState != EFMRadioStateOffBeforePhoneCall )
  1360         {        
  1360         {
  1361         if ( !iRadioEngine->IsRadioOn() && !iRadioEngine->IsInCall() )
       
  1362             {
       
  1363             FTRACE( FPrint( _L("CFMRadioAppUi::HandleHeadsetReconnectedCallback() - Turn radio on") ) );
       
  1364             TurnRadioOn();
       
  1365             } 
       
  1366         // active offline query controls radio on/off
  1361         // active offline query controls radio on/off
  1367         else if ( iAudioLost )
  1362         if ( iAudioLost )
  1368             {
  1363             {
  1369             FTRACE( FPrint( _L("CFMRadioAppUi::HandleHeadsetReconnectedCallback() - Try to resume") ) );
       
  1370             TRAP_IGNORE( TryToResumeAudioL() );	
  1364             TRAP_IGNORE( TryToResumeAudioL() );	
  1371             }
  1365             }
  1372         else if ( ( iGlobalOfflineQuery && !iGlobalOfflineQuery->IsActive() ) ||
  1366         else if ( ( iGlobalOfflineQuery && !iGlobalOfflineQuery->IsActive() ) ||
  1373               !iGlobalOfflineQuery )
  1367               !iGlobalOfflineQuery )
  1374             {
  1368             {
  1375             FTRACE( FPrint( _L("CFMRadioAppUi::HandleHeadsetReconnectedCallback() - Offline query") ) );
       
  1376             iRadioEngine->InitializeRadio();
  1369             iRadioEngine->InitializeRadio();
  1377             }
  1370             }
  1378         HandleVolumeChangedCallback();
  1371         HandleVolumeChangedCallback();
  1379         }
  1372         }
  1380     }
  1373     }
  2579                         {
  2572                         {
  2580                         SetDefaultViewL( *view );
  2573                         SetDefaultViewL( *view );
  2581                         }
  2574                         }
  2582                     else
  2575                     else
  2583                         {
  2576                         {
  2584                         TFMRadioRegionSetting region = iRadioEngine->GetRegionL();
  2577                         TFMRadioRegionSetting region = iRadioEngine->GetRegionL();  
  2585                         TBool mute = EFalse;
       
  2586                         
  2578                         
  2587                         if ( iOfflineQueryDialogActivated || 
  2579                         if ( iOfflineQueryDialogActivated || 
  2588                              iConnectHeadsetQuery || 
  2580                              iConnectHeadsetQuery || 
  2589                              region == EFMRadioRegionNone )
  2581                              region == EFMRadioRegionNone )
  2590                             {
  2582                             {
  2591                             iPendingViewId = view->Id(); 
  2583                             iPendingViewId = view->Id(); 
  2592                             }
  2584                             }
  2593                         else
  2585                         else
  2594                             {
  2586                             {
  2595                             iChannelListView->CancelMoveL();
  2587                             iChannelListView->CancelMoveL();
  2596                             if ( iCurrentRadioState == EFMRadioStateBusyScanLocalStations )
       
  2597                                 {
       
  2598                                 mute = ETrue;
       
  2599                                 }
       
  2600                             ActivateLocalViewL( view->Id() );
  2588                             ActivateLocalViewL( view->Id() );
  2601                             }
  2589                             }
  2602                         TApaTask task( iCoeEnv->WsSession() );
  2590                         TApaTask task( iCoeEnv->WsSession() );
  2603                         task.SetWgId( iCoeEnv->RootWin().Identifier() );
  2591                         task.SetWgId( iCoeEnv->RootWin().Identifier() );
  2604                         task.BringToForeground();
  2592                         task.BringToForeground();
  2605                         if ( mute )
       
  2606                             {
       
  2607                             // unmute if the scanning was ongoing
       
  2608                             iRadioEngine->SetMuteOn( EFalse );
       
  2609                             // just to make sure the mute status is up to date
       
  2610                             HandleVolumeChangedCallback();
       
  2611                             }
       
  2612                         }
  2593                         }
  2613                     }
  2594                     }
  2614                 }
  2595                 }
  2615             }
  2596             }
  2616         else
  2597         else