phoneapp/phoneuistates/src/cphoneemergency.cpp
changeset 56 5bcb308bd24d
parent 46 bc5a64e5bc3c
child 65 2a5d4ab426d3
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
   171         case MEngineMonitor::EPEMessageSentDTMF:         // fall through
   171         case MEngineMonitor::EPEMessageSentDTMF:         // fall through
   172         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   172         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   173             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   173             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   174             if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
   174             if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
   175                 {
   175                 {
   176                 TPhoneCmdParamBoolean isProgressNoteVisible;
   176                 UpdateSetupCbaL();
   177                 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible,
   177                 }
   178                       &isProgressNoteVisible );
       
   179 
       
   180                 if ( !isProgressNoteVisible.Boolean() )
       
   181                     {
       
   182                     UpdateSetupCbaL();
       
   183                     }
       
   184                  }
       
   185             break;
   178             break;
   186             
   179             
   187         case MEngineMonitor::EPEMessageColpNumberAvailable:
   180         case MEngineMonitor::EPEMessageColpNumberAvailable:
   188             //Don't show COLP note during emergency call.
   181             //Don't show COLP note during emergency call.
   189             break; 
   182             break; 
   208     TPhoneCmdParamBoolean globalNotifierParam;
   201     TPhoneCmdParamBoolean globalNotifierParam;
   209     globalNotifierParam.SetBoolean( EFalse );
   202     globalNotifierParam.SetBoolean( EFalse );
   210     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   203     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   211         &globalNotifierParam );
   204         &globalNotifierParam );
   212 
   205 
   213     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   214         {
       
   215         CloseDTMFEditorL();
       
   216         }
       
   217 
       
   218     if ( aCallId == KEmergencyCallId )
   206     if ( aCallId == KEmergencyCallId )
   219         {
   207         {
   220         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   208         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   221         // Remove emergency connecting note if still there
   209         // Remove emergency connecting note if still there
   222         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
   210         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
   223         // Close menu bar, if it is displayed
       
   224         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   225         
   211         
   226         TPhoneCmdParamKeyCapture captureParam;
   212         TPhoneCmdParamKeyCapture captureParam;
   227         captureParam.SetKeyCode( EKeyNo );
   213         captureParam.SetKeyCode( EKeyNo );
   228         iViewCommandHandle->ExecuteCommand( 
   214         iViewCommandHandle->ExecuteCommand( 
   229                 EPhoneViewStopCapturingKey, &captureParam );
   215                 EPhoneViewStopCapturingKey, &captureParam );
   240             if ( !TopAppIsDisplayedL() || iDeviceLockOn  )
   226             if ( !TopAppIsDisplayedL() || iDeviceLockOn  )
   241                 {
   227                 {
   242                 // Continue displaying current app but set up the
   228                 // Continue displaying current app but set up the
   243                 // idle screen in the background
   229                 // idle screen in the background
   244                 SetupIdleScreenInBackgroundL();
   230                 SetupIdleScreenInBackgroundL();
   245 
       
   246                 // Update toolbar
       
   247                 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
       
   248                 }
   231                 }
   249 
   232 
   250             else if ( iOnScreenDialer && IsNumberEntryContentStored() )
   233             else if ( iOnScreenDialer && IsNumberEntryContentStored() )
   251                 {
   234                 {
   252                 if ( !IsNumberEntryUsedL() )
       
   253                     {
       
   254                     CreateNumberEntryL();
       
   255                     }
       
   256                 // Restore the number entry content from cache
       
   257                 RestoreNumberEntryContentL();
       
   258                 SetNumberEntryVisibilityL(ETrue);
   235                 SetNumberEntryVisibilityL(ETrue);
   259                 }
   236                 }
   260 
   237 
   261             else if ( IsNumberEntryUsedL() )
   238             else if ( IsNumberEntryUsedL() )
   262                 {
   239                 {
   263                 // Show the number entry if it exists
   240                 // Show the number entry if it exists
   264                 SetNumberEntryVisibilityL(ETrue);
   241                 SetNumberEntryVisibilityL(ETrue);
   265                 // Update toolbar
       
   266                 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
       
   267                 }
   242                 }
   268 
   243 
   269             else
   244             else
   270                 {
   245                 {
   271                  // Display idle screen
   246                  // Display idle screen
   334     // because PE messages are processed asynchronously.
   309     // because PE messages are processed asynchronously.
   335     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() ");
   310     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() ");
   336 
   311 
   337     if ( aCallId == KPEEmergencyCallId )
   312     if ( aCallId == KPEEmergencyCallId )
   338         {
   313         {
   339         if ( !IsSimOk() )
       
   340             {
       
   341             TPhoneCmdParamBoolean visibleMode;
       
   342             visibleMode.SetBoolean( ETrue );
       
   343             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode );
       
   344             }
       
   345 
   314 
   346         iDeviceLockOn = IsAutoLockOn();
   315         iDeviceLockOn = IsAutoLockOn();
   347 
       
   348         // Close menu bar, if it is displayed
       
   349         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   350 
   316 
   351         // Disable global notes when the phone is dialling
   317         // Disable global notes when the phone is dialling
   352         TPhoneCmdParamBoolean globalNotifierParam;
   318         TPhoneCmdParamBoolean globalNotifierParam;
   353         globalNotifierParam.SetBoolean( ETrue );
   319         globalNotifierParam.SetBoolean( ETrue );
   354         iViewCommandHandle->ExecuteCommandL(
   320         iViewCommandHandle->ExecuteCommandL(
   387             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   353             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   388             }
   354             }
   389 
   355 
   390         // Remove exit emergency mode query, if it exists
   356         // Remove exit emergency mode query, if it exists
   391         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
   357         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
   392 
       
   393         // Enable the volume display
       
   394         iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
       
   395         
   358         
   396         BeginUiUpdateLC();
   359         BeginUiUpdateLC();
   397         
   360         
   398         TPhoneCmdParamEmergencyCallHeaderData emergencyHeaderParam;
   361         TPhoneCmdParamEmergencyCallHeaderData emergencyHeaderParam;
   399         // Set call header
   362         // Set call header
   514         &emergencyHeaderParam );
   477         &emergencyHeaderParam );
   515 
   478 
   516     SetBackButtonActive(ETrue);
   479     SetBackButtonActive(ETrue);
   517 
   480 
   518     EndUiUpdate();
   481     EndUiUpdate();
   519     SetToolbarDimming( ETrue );
       
   520     UpdateInCallCbaL();
   482     UpdateInCallCbaL();
   521     }
   483     }
   522 
       
   523 // -----------------------------------------------------------
       
   524 // CPhoneEmergency::OpenMenuBarL
       
   525 // -----------------------------------------------------------
       
   526 //
       
   527 void CPhoneEmergency::OpenMenuBarL()
       
   528     {
       
   529     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::OpenMenuBarL() ");
       
   530     TInt resourceId;
       
   531 
       
   532     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   533         {
       
   534         resourceId = EPhoneDtmfDialerMenubar;
       
   535         }
       
   536     else if ( IsNumberEntryVisibleL() )
       
   537         {
       
   538         resourceId = EPhoneCallHandlingEmergencyMenubarWithNumberEntry;
       
   539         }
       
   540     else
       
   541         {
       
   542         resourceId = EPhoneCallHandlingEmergencyMenubar;
       
   543         }
       
   544 
       
   545     TPhoneCmdParamInteger integerParam;
       
   546     integerParam.SetInteger(
       
   547         CPhoneMainResourceResolver::Instance()->
       
   548         ResolveResourceID( resourceId ) );
       
   549     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
       
   550         &integerParam );
       
   551     }
       
   552 
       
   553 
   484 
   554 // -----------------------------------------------------------
   485 // -----------------------------------------------------------
   555 // CPhoneEmergency::UpdateInCallCbaL
   486 // CPhoneEmergency::UpdateInCallCbaL
   556 // -----------------------------------------------------------
   487 // -----------------------------------------------------------
   557 //
   488 //
   575     switch ( aCode )
   506     switch ( aCode )
   576         {
   507         {
   577         // end-key
   508         // end-key
   578         case EKeyNo:
   509         case EKeyNo:
   579             // handle end key
   510             // handle end key
   580             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   581                 {
       
   582                 CloseDTMFEditorL();
       
   583                 }
       
   584             DisconnectEmergencyCallL();
   511             DisconnectEmergencyCallL();
   585             break;
   512             break;
   586 
   513 
   587         // send-key
   514         // send-key
   588         case EKeyYes:
   515         case EKeyYes:
   649         case EPhoneDtmfDialerExit:      // fall through
   576         case EPhoneDtmfDialerExit:      // fall through
   650         case EPhoneDtmfDialerCancel:
   577         case EPhoneDtmfDialerCancel:
   651              {
   578              {
   652              if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
   579              if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
   653                  {
   580                  {
   654                  CloseDTMFEditorL();
   581 
   655 
   582                  UpdateSetupCbaL();
   656                  TPhoneCmdParamBoolean isProgressNoteVisible;
       
   657                  iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible,
       
   658                         &isProgressNoteVisible );
       
   659 
       
   660                  if ( !isProgressNoteVisible.Boolean() )
       
   661                      {
       
   662                      UpdateSetupCbaL();
       
   663                      }
       
   664                  }
   583                  }
   665              else
   584              else
   666                  {
   585                  {
   667                  commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
   586                  commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
   668                  }
   587                  }
   854     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() ");
   773     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() ");
   855    TInt resourceId = EPhoneCallHandlingEmergencyCBA;        
   774    TInt resourceId = EPhoneCallHandlingEmergencyCBA;        
   856    iCbaManager->SetCbaL( resourceId );
   775    iCbaManager->SetCbaL( resourceId );
   857     }
   776     }
   858 
   777 
   859 // ---------------------------------------------------------
       
   860 // CPhoneEmergency::HandleCreateNumberEntryL
       
   861 //
       
   862 // ---------------------------------------------------------
       
   863 //
       
   864 void CPhoneEmergency::HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
       
   865         TEventCode aEventCode )
       
   866     {
       
   867     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneEmergency::HandleCreateNumberEntryL() ");
       
   868     if ( !iCallSetup && !iStartupInterrupted )
       
   869         {
       
   870         CPhoneGsmInCall::HandleCreateNumberEntryL( aKeyEvent, aEventCode );
       
   871         }
       
   872 
       
   873     }
       
   874 
   778 
   875 // -----------------------------------------------------------------------------
   779 // -----------------------------------------------------------------------------
   876 // CPhoneEmergency::HandleRemConCommandL
   780 // CPhoneEmergency::HandleRemConCommandL
   877 // -----------------------------------------------------------------------------
   781 // -----------------------------------------------------------------------------
   878 //
   782 //