phoneapp/phoneuicontrol/src/cphonestateidle.cpp
branchRCL_3
changeset 44 3c221667e687
parent 39 b8d67d6176f5
child 57 94dc1107e8b2
equal deleted inserted replaced
39:b8d67d6176f5 44:3c221667e687
    48 #include "phonestatedefinitions.h"
    48 #include "phonestatedefinitions.h"
    49 #include "tphonecmdparamappinfo.h"
    49 #include "tphonecmdparamappinfo.h"
    50 #include "cphonekeys.h"
    50 #include "cphonekeys.h"
    51 
    51 
    52 #include "tphonecmdparamcallstatedata.h"
    52 #include "tphonecmdparamcallstatedata.h"
       
    53 #include "tphonecmdparamcallheaderdata.h"
    53 #include "phoneviewcommanddefinitions.h"
    54 #include "phoneviewcommanddefinitions.h"
    54 #include "phoneui.hrh"
    55 #include "phoneui.hrh"
    55 #include "phonerssbase.h"
    56 #include "phonerssbase.h"
    56 #include "cphonemainresourceresolver.h"
    57 #include "cphonemainresourceresolver.h"
    57 #include "cphonecenrepproxy.h"
    58 #include "cphonecenrepproxy.h"
   136         {
   137         {
   137         // Handle numeric keys when key events are received in idle state
   138         // Handle numeric keys when key events are received in idle state
   138         HandleNumericKeyEventL( aKeyEvent, aEventCode );  
   139         HandleNumericKeyEventL( aKeyEvent, aEventCode );  
   139         }
   140         }
   140     else if ( iStateMachine->SecurityMode()->IsSecurityMode()
   141     else if ( iStateMachine->SecurityMode()->IsSecurityMode()
   141     	&& CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
   142         && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
   142         {
   143         {
   143         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
   144         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
   144         // Handle numeric keys when key events are received in single state
   145         // Handle numeric keys when key events are received in single state
   145         HandleNumericKeyEventL( aKeyEvent, aEventCode );  
   146         HandleNumericKeyEventL( aKeyEvent, aEventCode );  
   146         }
   147         }
   186     TKeyCode aCode )
   187     TKeyCode aCode )
   187     {
   188     {
   188     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
   189     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
   189 
   190 
   190     if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) )
   191     if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) )
   191     	{
   192         {
   192         return;
   193         return;
   193     	}
   194         }
   194 
   195 
   195     switch ( aCode )
   196     switch ( aCode )
   196         {
   197         {
   197         case EKeyEnd:
   198         case EKeyEnd:
   198             // This key even occur only in idle state, behaviour for this should
   199             // This key even occur only in idle state, behaviour for this should
   200             HandleEndKeyPressL( EPhoneKeyLongPress );
   201             HandleEndKeyPressL( EPhoneKeyLongPress );
   201             break;
   202             break;
   202             
   203             
   203         // end-key
   204         // end-key
   204         case EKeyNo:
   205         case EKeyNo:
   205             HandleEndKeyPressL( aMessage );            
   206             HandleEndKeyPressL( aMessage );
   206             break;
   207             break;
   207 
   208 
   208         // send-key
   209         // send-key
   209         case EKeyYes:
   210         case EKeyYes:
   210             
   211             
   242                 // send-key event we have to check if security mode is true and if it
   243                 // send-key event we have to check if security mode is true and if it
   243                 // is then open emergency dialer.
   244                 // is then open emergency dialer.
   244                 else if ( !IsNumberEntryUsedL() ) 
   245                 else if ( !IsNumberEntryUsedL() ) 
   245                     {
   246                     {
   246                    if ( iStateMachine->SecurityMode()->IsSecurityMode() )
   247                    if ( iStateMachine->SecurityMode()->IsSecurityMode() )
   247 						{
   248                         {
   248 						iViewCommandHandle->HandleCommandL( EPhoneViewOpenNumberEntry );
   249                         iViewCommandHandle->HandleCommandL( EPhoneViewOpenNumberEntry );
   249 						}
   250                         }
   250                     }           
   251                     }           
   251                 }
   252                 }
   252             else // iOnScreenDialer false, non-touch.
   253             else // iOnScreenDialer false, non-touch.
   253                 {
   254                 {
   254                 HandleSendCommandL();
   255                 HandleSendCommandL();
   330     TInt aCallId )
   331     TInt aCallId )
   331     {
   332     {
   332     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) ");
   333     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) ");
   333     switch ( aMessage )
   334     switch ( aMessage )
   334         {
   335         {
       
   336         case MEngineMonitor::EPEMessageInitiatedMoCall:
       
   337            if( !IsBubbleInitialized() &&
       
   338               ( EPECallTypeCSVoice == 
       
   339                 iStateMachine->PhoneEngineInfo()->CallType(aCallId) ) )
       
   340                 {
       
   341                 // Display call setup ASAP.
       
   342                 DisplayInitializingCallL( aCallId );
       
   343                 }
       
   344             break;
       
   345                     
   335         case MEngineMonitor::EPEMessageIncoming:
   346         case MEngineMonitor::EPEMessageIncoming:
   336             HandleIncomingL( aCallId );
   347             HandleIncomingL( aCallId );
   337             break;
   348             break;
   338             
   349             
   339         case MEngineMonitor::EPEMessageDialing:
   350         case MEngineMonitor::EPEMessageDialing:
   350             if ( !iOnScreenDialer )  
   361             if ( !iOnScreenDialer )  
   351                 {
   362                 {
   352                 if ( IsNumberEntryUsedL() )
   363                 if ( IsNumberEntryUsedL() )
   353                     {
   364                     {
   354                     // Show the number entry if it exists
   365                     // Show the number entry if it exists
   355                     SetNumberEntryVisibilityL(ETrue);    
   366                     SetNumberEntryVisibilityL(ETrue);
   356                     }    
   367                     }    
   357                 else if ( NeedToReturnToForegroundAppL() )
   368                 else if ( NeedToReturnToForegroundAppL() )
   358                     {
   369                     {
   359                     // Continue displaying current app but set up the 
   370                     // Continue displaying current app but set up the 
   360                     // idle screen in the background
   371                     // idle screen in the background
   370             
   381             
   371         case MEngineMonitor::EPEMessageIdle:
   382         case MEngineMonitor::EPEMessageIdle:
   372             HandleIdleL( aCallId );
   383             HandleIdleL( aCallId );
   373             break;
   384             break;
   374             
   385             
   375         case MEngineMonitor::EPEMessageInValidEmergencyNumber:                
   386         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   376             SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );                           
   387             // if sim is ok then there is no need show this note.
       
   388             if ( !IsSimOk() )
       
   389                 {
       
   390                 SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );
       
   391                 }
   377             break;
   392             break;
   378             
   393             
   379         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   394         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   380             DialVoiceCallL();
   395             /* DisplayInitializingCallL calls EPEMessageCheckEmergencyNumber which
       
   396             means that engine will send EPEMessageInValidEmergencyNumber or
       
   397             EPEMessageValidEmergencyNumber response to phoneapp. If phoneengine
       
   398             sends EPEMessageValidEmergencyNumber then iBubbleInitialized should be
       
   399             set to EFalse this way we dont initializing call bubble behind attempting emergency 
       
   400             call dialog.*/
       
   401             if ( IsBubbleInitialized() )
       
   402                 {
       
   403                 SetBubbleInitialized( EFalse );
       
   404                 }
       
   405             else
       
   406                 {
       
   407                 DialVoiceCallL();
       
   408                 }
   381             break; 
   409             break; 
   382                         
   410         
   383         default:
   411         default:
   384             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   412             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   385             break;
   413             break;
   386         }
   414         }
   387     }
   415     }
   419     CEikonEnv::Static()->DismissTaskList();
   447     CEikonEnv::Static()->DismissTaskList();
   420 
   448 
   421     // Show incoming call buttons
   449     // Show incoming call buttons
   422     SetTouchPaneButtons( EPhoneIncomingCallButtons );
   450     SetTouchPaneButtons( EPhoneIncomingCallButtons );
   423     SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
   451     SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
       
   452     SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
   424     
   453     
   425     // Display incoming call
   454     // Display incoming call
   426     DisplayIncomingCallL( aCallId );
   455     DisplayIncomingCallL( aCallId );
   427 
   456 
   428     EndUiUpdate();
   457     EndUiUpdate();
   433     UpdateIncomingContextMenuL( aCallId );
   462     UpdateIncomingContextMenuL( aCallId );
   434     //Dim toolbar items
   463     //Dim toolbar items
   435     SetToolbarDimming( ETrue );
   464     SetToolbarDimming( ETrue );
   436     //request that dimmed toolbar is visible.
   465     //request that dimmed toolbar is visible.
   437     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   466     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   438     iStateMachine->ChangeState( EPhoneStateIncoming );
   467     
       
   468     ChangeTo( EPhoneStateIncoming );
   439          
   469          
   440     // Reset divert indication
   470     // Reset divert indication
   441     SetDivertIndication( EFalse );
   471     SetDivertIndication( EFalse );
   442     }
   472     }
   443 
   473 
   455     
   485     
   456     SetNumberEntryVisibilityL(EFalse);
   486     SetNumberEntryVisibilityL(EFalse);
   457 
   487 
   458     // Show call setup buttons
   488     // Show call setup buttons
   459     SetTouchPaneButtons( EPhoneCallSetupButtons );
   489     SetTouchPaneButtons( EPhoneCallSetupButtons );
       
   490     SetTouchPaneButtonDisabled( EPhoneInCallCmdHold );    
   460 
   491 
   461     // Display call setup 
   492     // Display call setup 
   462     DisplayCallSetupL( aCallId );            
   493     DisplayCallSetupL( aCallId );            
   463     
   494     
   464     EndUiUpdate();
   495     EndUiUpdate();
   468             
   499             
   469     // Go to call setup state
   500     // Go to call setup state
   470     iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   501     iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   471 
   502 
   472     SetToolbarDimming( ETrue );
   503     SetToolbarDimming( ETrue );
   473     
   504 
   474     iStateMachine->ChangeState( EPhoneStateCallSetup );
   505     SetToolbarButtonLoudspeakerEnabled();
       
   506     SetToolbarButtonHandsetEnabled();
       
   507     
       
   508     ChangeTo( EPhoneStateCallSetup );
   475     }
   509     }
   476 
   510 
   477 // -----------------------------------------------------------
   511 // -----------------------------------------------------------
   478 // CPhoneStateIdle::HandleConnectedL
   512 // CPhoneStateIdle::HandleConnectedL
   479 // Message Handling function for message EPEMessageConnected
   513 // Message Handling function for message EPEMessageConnected
   513     
   547     
   514     EndUiUpdate();
   548     EndUiUpdate();
   515   
   549   
   516     // Go to single state
   550     // Go to single state
   517     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   551     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   518     iStateMachine->ChangeState( EPhoneStateSingle );
   552     ChangeTo( EPhoneStateSingle );
   519     }
   553     }
   520 
   554 
   521 // -----------------------------------------------------------
   555 // -----------------------------------------------------------
   522 // CPhoneStateIdle::HandleCommandL
   556 // CPhoneStateIdle::HandleCommandL
   523 // -----------------------------------------------------------
   557 // -----------------------------------------------------------
   638         {
   672         {
   639         iCustomization->HandleDialL( aNumber );
   673         iCustomization->HandleDialL( aNumber );
   640         }
   674         }
   641     else
   675     else
   642         {
   676         {
   643         DialVoiceCallL();                
   677         DialVoiceCallL();
   644         }
   678         }
   645     }
   679     }
   646     
   680     
   647 // -----------------------------------------------------------
   681 // -----------------------------------------------------------
   648 // CPhoneStateIdle::HandleBackCommandL
   682 // CPhoneStateIdle::HandleBackCommandL
   796 
   830 
   797     // Set Phone as the top application
   831     // Set Phone as the top application
   798     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   832     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   799         &uidParam ); 
   833         &uidParam ); 
   800     
   834     
   801     // Display call setup header
   835     if ( !UpdateCallBubbleL( aCallId ) )
   802     DisplayHeaderForOutgoingCallL( aCallId );
   836         {
       
   837         // Create and Display call setup header if update was not done.
       
   838         DisplayHeaderForOutgoingCallL( aCallId );
       
   839         }
       
   840     }
       
   841 
       
   842 // -----------------------------------------------------------
       
   843 // CPhoneStateIdle::UpdateCallBubbleL
       
   844 // -----------------------------------------------------------
       
   845 //
       
   846 TBool CPhoneStateIdle::UpdateCallBubbleL( TInt aCallId )
       
   847     {
       
   848     __LOGMETHODSTARTEND(EPhoneControl, 
       
   849                 "CPhoneStateIdle::UpdateCallBubbleL( )");
       
   850     TBool retValue(EFalse);
       
   851     if( IsBubbleInitialized() )
       
   852         {
       
   853         // Call bubble is already initialized so it is 
       
   854         // enough just to update existing header with 
       
   855         // contacts,number...etc info.
       
   856         TPhoneCmdParamCallHeaderData callHeaderParam = 
       
   857                 UpdateCallHeaderInfoL( aCallId );
       
   858         iViewCommandHandle->ExecuteCommandL( 
       
   859                 EPhoneViewUpdateCallHeaderRemoteInfoData, 
       
   860                 aCallId, 
       
   861                 &callHeaderParam );
       
   862         // reset flag.
       
   863         SetBubbleInitialized( EFalse );
       
   864         retValue = ETrue;
       
   865         }
       
   866     __PHONELOG1( EBasic, EPhoneControl, 
       
   867             "PhoneUIControl: CPhoneStateIdle::UpdateCallBubbleL - retValue =%d ",
       
   868             retValue );
       
   869     return retValue;
       
   870     }
       
   871 
       
   872 // -----------------------------------------------------------
       
   873 // CPhoneStateIdle::DisplayInitializingCallL
       
   874 // -----------------------------------------------------------
       
   875 //
       
   876 void CPhoneStateIdle::DisplayInitializingCallL( TInt aCallId )
       
   877     {
       
   878     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayInitializingCallL( )");
       
   879     /*Set flag value to true before SendPhoneEngineMessage because if phone number
       
   880     is emergency number then EPEMessageValidEmergencyNumber message handling sets 
       
   881     iBubbleInitialized to false value and if value is false then initializing call 
       
   882     bubble shouldnt be shown.*/
       
   883     SetBubbleInitialized( ETrue );
       
   884     iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageCheckEmergencyNumber );
       
   885     if ( IsBubbleInitialized() )
       
   886         {
       
   887         BeginUiUpdateLC();
       
   888         
       
   889         SetNumberEntryVisibilityL(EFalse);
       
   890         
       
   891         // Show call setup buttons
       
   892         SetTouchPaneButtons( EPhoneCallSetupButtons );
       
   893         
       
   894         // Close menu bar, if it is displayed
       
   895         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   896 
       
   897         // Capture keys when the phone is dialling
       
   898         CaptureKeysDuringCallNotificationL( ETrue );
       
   899         
       
   900         // Bring Phone app in the foreground
       
   901         TPhoneCmdParamInteger uidParam;
       
   902         uidParam.SetInteger( KUidPhoneApplication.iUid );
       
   903         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
       
   904             &uidParam );
       
   905 
       
   906         // Set Phone as the top application
       
   907         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
       
   908             &uidParam ); 
       
   909         
       
   910         DisplayHeaderForInitializingCallL( aCallId );
       
   911             
       
   912         EndUiUpdate();
       
   913         
       
   914         // Remove any phone dialogs if they are displayed
       
   915         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
   916                 
       
   917         // Go to call setup state
       
   918         iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
       
   919 
       
   920         SetToolbarDimming( ETrue );
       
   921         }
   803     }
   922     }
   804 
   923 
   805 // -----------------------------------------------------------
   924 // -----------------------------------------------------------
   806 // CPhoneStateIdle::HandleIdleForegroundEventL
   925 // CPhoneStateIdle::HandleIdleForegroundEventL
   807 // -----------------------------------------------------------
   926 // -----------------------------------------------------------
   824             }
   943             }
   825         }
   944         }
   826     else if ( !IsAnyQueryActiveL() )
   945     else if ( !IsAnyQueryActiveL() )
   827         {
   946         {
   828         // Set idle as top application
   947         // Set idle as top application
   829         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );            
   948         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
   830         }
   949         }
   831     }
   950     }
   832 
   951 
   833 // -----------------------------------------------------------
   952 // -----------------------------------------------------------
   834 // CPhoneStateIdle::HandlePhoneForegroundEventL
   953 // CPhoneStateIdle::HandlePhoneForegroundEventL
   863             }
   982             }
   864         
   983         
   865         // If dialer is open add icon to FSW list.
   984         // If dialer is open add icon to FSW list.
   866         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
   985         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
   867         }
   986         }
   868     else if ( !IsNumberEntryUsedL() && !iStateMachine->SecurityMode()->IsSecurityMode() )
   987     /*iBubbleInitialized has to be checked because if it true then phoneapp 
       
   988     is already showing call bubble and we cant bring idle to screen. */
       
   989     else if ( !IsNumberEntryUsedL() && 
       
   990               !iStateMachine->SecurityMode()->IsSecurityMode() &&
       
   991               !IsBubbleInitialized() )
   869         {
   992         {
   870         // Bring Idle app to the foreground
   993         // Bring Idle app to the foreground
   871         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
   994         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
   872 		}
   995         }
   873     }
   996     }
   874 
   997 
   875 // -----------------------------------------------------------
   998 // -----------------------------------------------------------
   876 // CPhoneStateIdle::HandlePhoneFocusLostEventL
   999 // CPhoneStateIdle::HandlePhoneFocusLostEventL
   877 // -----------------------------------------------------------
  1000 // -----------------------------------------------------------
   890 // CPhoneStateIdle::HandleIdleL
  1013 // CPhoneStateIdle::HandleIdleL
   891 // -----------------------------------------------------------
  1014 // -----------------------------------------------------------
   892 //
  1015 //
   893 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
  1016 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
   894     {
  1017     {
   895     __LOGMETHODSTARTEND(EPhoneControl,  
  1018     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" );
   896         "CPhoneStateIdle::HandleIdleL()" );
       
   897         
  1019         
   898     // Remove all call headers
  1020     // Remove all call headers
   899     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
  1021     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
   900     
  1022     
   901     // Close number entry
  1023     // Close number entry
   902     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );    
  1024     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   903 
  1025 
   904     // Remove all notes and dialogs
  1026     // Remove all notes and dialogs
   905     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );    
  1027     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
  1028     // Reset flag.
       
  1029     SetBubbleInitialized( EFalse );
   906     }
  1030     }
   907  
  1031  
   908 // -----------------------------------------------------------
  1032 // -----------------------------------------------------------
   909 // CPhoneStateIdle::SpeedDialL
  1033 // CPhoneStateIdle::SpeedDialL
   910 // -----------------------------------------------------------
  1034 // -----------------------------------------------------------
  1285 // -----------------------------------------------------------
  1409 // -----------------------------------------------------------
  1286 //
  1410 //
  1287 EXPORT_C void CPhoneStateIdle::DialVoiceCallL()
  1411 EXPORT_C void CPhoneStateIdle::DialVoiceCallL()
  1288     {
  1412     {
  1289     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() ");
  1413     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() ");
  1290     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
  1414     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
  1291         Panic( EPhoneCtrlInvariant ) );
       
  1292         
       
  1293     // Disable global notes
       
  1294     TPhoneCmdParamBoolean globalNotifierParam;
       
  1295     globalNotifierParam.SetBoolean( ETrue );
       
  1296     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
       
  1297         &globalNotifierParam );
       
  1298     
       
  1299     CPhoneState::DialVoiceCallL();
  1415     CPhoneState::DialVoiceCallL();
  1300  
       
  1301     }
  1416     }
  1302 
  1417 
  1303 // -----------------------------------------------------------------------------
  1418 // -----------------------------------------------------------------------------
  1304 // CPhoneStateIdle::RestoreOngoing
  1419 // CPhoneStateIdle::RestoreOngoing
  1305 // -----------------------------------------------------------------------------
  1420 // -----------------------------------------------------------------------------
  1479             }
  1594             }
  1480         }
  1595         }
  1481     return menuId;
  1596     return menuId;
  1482     }
  1597     }
  1483 
  1598 
       
  1599 // -----------------------------------------------------------
       
  1600 // CPhoneStateIdle::HandleErrorL
       
  1601 // -----------------------------------------------------------
       
  1602 //
       
  1603 EXPORT_C void CPhoneStateIdle::HandleErrorL( const TPEErrorInfo& aErrorInfo )
       
  1604     {
       
  1605     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateIdle::HandleErrorL() ");
       
  1606     __PHONELOG1( EBasic, EPhoneControl, 
       
  1607             "PhoneUIControl: CPhoneStateIdle::HandleErrorL - aErrorInfo.iErrorCode =%d ",
       
  1608             aErrorInfo.iErrorCode );
       
  1609     __PHONELOG1( EBasic, EPhoneControl,
       
  1610             "PhoneUIControl: CPhoneStateIdle::HandleErrorL - aErrorInfo.iCallId =%d ",
       
  1611             aErrorInfo.iCallId );
       
  1612     if( ( ECCPErrorNone != aErrorInfo.iErrorCode ) &&
       
  1613             IsBubbleInitialized() )
       
  1614         {
       
  1615         HandleInitializingCallErrorL( aErrorInfo.iCallId );
       
  1616         SetBubbleInitialized( EFalse );
       
  1617         }
       
  1618     CPhoneState::HandleErrorL( aErrorInfo );
       
  1619     }
       
  1620 
       
  1621 // -----------------------------------------------------------
       
  1622 // CPhoneStateIdle::HandleInitializingCallErrorL
       
  1623 // -----------------------------------------------------------
       
  1624 //
       
  1625 void CPhoneStateIdle::HandleInitializingCallErrorL( TInt aCallId )
       
  1626     {
       
  1627     __LOGMETHODSTARTEND(
       
  1628             EPhoneControl, 
       
  1629             "CPhoneStateIdle::HandleInitializingCallErrorL()" );
       
  1630     // Remove call 
       
  1631     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
       
  1632     BeginUiUpdateLC();
       
  1633     SetDefaultFlagsL();
       
  1634     if ( IsNumberEntryUsedL() )
       
  1635         {
       
  1636         if ( NeedToReturnToForegroundAppL() )
       
  1637             {
       
  1638             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
       
  1639             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
       
  1640             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
       
  1641             }
       
  1642         else
       
  1643             {
       
  1644             // Show the number entry if it exists and update cba's.
       
  1645             SetNumberEntryVisibilityL( ETrue );
       
  1646             if ( IsDTMFEditorVisibleL() )
       
  1647                 {
       
  1648                 CloseDTMFEditorL();
       
  1649                 DisplayIdleScreenL();
       
  1650                 }
       
  1651             else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
       
  1652                 {
       
  1653                 CloseCustomizedDialerL();
       
  1654                 DisplayIdleScreenL();
       
  1655                 } 
       
  1656             }
       
  1657         }
       
  1658     else
       
  1659         {
       
  1660         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
  1661         if ( !TopAppIsDisplayedL() || IsAutoLockOn() || NeedToReturnToForegroundAppL() )
       
  1662             {
       
  1663             // Continue displaying current app but set up the 
       
  1664             // idle screen in the background
       
  1665             SetupIdleScreenInBackgroundL();
       
  1666             }
       
  1667         else
       
  1668             {
       
  1669             DisplayIdleScreenL();
       
  1670             }
       
  1671         }
       
  1672     DeleteTouchPaneButtons();
       
  1673     EndUiUpdate();
       
  1674     
       
  1675     // Display call termination note, if necessary
       
  1676     DisplayCallTerminationNoteL();
       
  1677     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
       
  1678     }
       
  1679 
       
  1680 // -----------------------------------------------------------
       
  1681 // CPhoneStateIdle::SetBubbleInitialized
       
  1682 // -----------------------------------------------------------
       
  1683 //
       
  1684 void CPhoneStateIdle::SetBubbleInitialized( TBool aValue )
       
  1685     {
       
  1686     __PHONELOG1( EBasic, EPhoneControl, 
       
  1687             "PhoneUIControl: CPhoneStateIdle::SetBubbleInitialized - aValue =%d ",
       
  1688             aValue );
       
  1689     iBubbleInitialized = aValue;
       
  1690     }
       
  1691 
       
  1692 // -----------------------------------------------------------
       
  1693 // CPhoneStateIdle::IsBubbleInitialized
       
  1694 // -----------------------------------------------------------
       
  1695 //
       
  1696 TBool CPhoneStateIdle::IsBubbleInitialized()
       
  1697     {
       
  1698     __PHONELOG1( EBasic, EPhoneControl, 
       
  1699             "PhoneUIControl: CPhoneStateIdle::IsBubbleInitialized - iBubbleInitialized =%d ",
       
  1700             iBubbleInitialized );
       
  1701     return iBubbleInitialized;
       
  1702     }
       
  1703 
       
  1704 // -----------------------------------------------------------
       
  1705 // CPhoneStateIdle::ChangeTo
       
  1706 // -----------------------------------------------------------
       
  1707 //
       
  1708 void CPhoneStateIdle::ChangeTo( TInt aState )
       
  1709     {
       
  1710     __PHONELOG1( EBasic, EPhoneControl, 
       
  1711            "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ",
       
  1712            aState );
       
  1713     SetBubbleInitialized( EFalse );
       
  1714     iStateMachine->ChangeState( aState );
       
  1715     }
       
  1716 
  1484 // End of File
  1717 // End of File