phoneapp/phoneuicontrol/src/cphonestateidle.cpp
changeset 56 5bcb308bd24d
parent 46 bc5a64e5bc3c
child 65 2a5d4ab426d3
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
    54 #include "cphonepubsubproxy.h"
    54 #include "cphonepubsubproxy.h"
    55 #include "phonelogger.h"
    55 #include "phonelogger.h"
    56 #include "phoneui.pan"
    56 #include "phoneui.pan"
    57 #include "mphonecustomization.h"
    57 #include "mphonecustomization.h"
    58 
    58 
    59 //CONSTANTS
       
    60 const TInt  KMaxParamLength = 1024;
       
    61 
    59 
    62 // ================= MEMBER FUNCTIONS =======================
    60 // ================= MEMBER FUNCTIONS =======================
    63 
    61 
    64 // C++ default constructor can NOT contain any code, that
    62 // C++ default constructor can NOT contain any code, that
    65 // might leave.
    63 // might leave.
    83 //
    81 //
    84 EXPORT_C void CPhoneStateIdle::ConstructL()
    82 EXPORT_C void CPhoneStateIdle::ConstructL()
    85     {
    83     {
    86     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
    84     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
    87     CPhoneState::BaseConstructL();
    85     CPhoneState::BaseConstructL();
    88     
       
    89     // Set send key activation on.
       
    90     TPhoneCmdParamBoolean boolean;
       
    91     boolean.SetBoolean( ETrue );
       
    92     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, 
       
    93                 &boolean );
       
    94     
       
    95     iViewCommandHandle->ExecuteCommandL( EPhoneViewCreatePhoneBookServices );
       
    96     }
    86     }
    97 
    87 
    98 // -----------------------------------------------------------
    88 // -----------------------------------------------------------
    99 // CPhoneStateIdle::NewL()
    89 // CPhoneStateIdle::NewL()
   100 // -----------------------------------------------------------
    90 // -----------------------------------------------------------
   179 EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( 
   169 EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( 
   180     TPhoneKeyEventMessages aMessage,
   170     TPhoneKeyEventMessages aMessage,
   181     TKeyCode aCode )
   171     TKeyCode aCode )
   182     {
   172     {
   183     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
   173     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
   184 
       
   185     if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) )
       
   186         {
       
   187         return;
       
   188         }
       
   189 
   174 
   190     switch ( aCode )
   175     switch ( aCode )
   191         {
   176         {
   192         case EKeyEnd:
   177         case EKeyEnd:
   193             // This key even occur only in idle state, behaviour for this should
   178             // This key even occur only in idle state, behaviour for this should
   217                     TInt neLength( numberEntryCountParam.Integer() );
   202                     TInt neLength( numberEntryCountParam.Integer() );
   218                     
   203                     
   219                     // Query on top of dialer
   204                     // Query on top of dialer
   220                     if ( IsAnyQueryActiveL() )
   205                     if ( IsAnyQueryActiveL() )
   221                         {
   206                         {
   222                         return;
       
   223                         }
       
   224                     else if ( IsMenuBarVisibleL() )
       
   225                         {
       
   226                         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   227                         return;
   207                         return;
   228                         }
   208                         }
   229                     
   209                     
   230                     else if ( neLength == 0 && !isSecurityMode.Boolean())
   210                     else if ( neLength == 0 && !isSecurityMode.Boolean())
   231                         {
   211                         {
   266             if ( !IsNumberEntryUsedL() )
   246             if ( !IsNumberEntryUsedL() )
   267                 {
   247                 {
   268                 HandleCommandL(EPhoneNumberAcqSecurityDialer);
   248                 HandleCommandL(EPhoneNumberAcqSecurityDialer);
   269                 }           
   249                 }           
   270             }
   250             }
   271             break;
       
   272             
       
   273         // "O" key
       
   274         case KPhoneDtmf0Character:
       
   275             if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
       
   276                 {
       
   277                 LaunchApplicationL();
       
   278                 }
       
   279             break;
   251             break;
   280             
   252             
   281 #ifdef RD_INTELLIGENT_TEXT_INPUT   
   253 #ifdef RD_INTELLIGENT_TEXT_INPUT   
   282         case EKeyEnter:
   254         case EKeyEnter:
   283             if ( IsNumberEntryVisibleL() )
   255             if ( IsNumberEntryVisibleL() )
   366 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   338 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   367     {
   339     {
   368     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   340     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   369 
   341 
   370     HandleAudioAvailableOutputChangedL();
   342     HandleAudioAvailableOutputChangedL();
   371     
       
   372     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
       
   373 
   343 
   374     SetRingingTonePlaybackL( aCallId );
   344     SetRingingTonePlaybackL( aCallId );
   375 
   345 
   376     BeginTransEffectLC( ENumberEntryClose );
       
   377     BeginUiUpdateLC();
   346     BeginUiUpdateLC();
   378     
   347     
   379     // Hide the number entry if it exists
   348     // Hide the number entry if it exists
   380     if ( IsNumberEntryUsedL() )
   349     if ( IsNumberEntryUsedL() )
   381         {
   350         {
   393     
   362     
   394     SetBackButtonActive(EFalse);
   363     SetBackButtonActive(EFalse);
   395     
   364     
   396     EndUiUpdate();
   365     EndUiUpdate();
   397     
   366     
   398     EndTransEffect();
       
   399     
       
   400     // Go to incoming state
   367     // Go to incoming state
   401     iCbaManager->UpdateIncomingCbaL( aCallId );
   368     iCbaManager->UpdateIncomingCbaL( aCallId );
   402     UpdateSilenceButtonDimming();
   369 
   403     UpdateIncomingContextMenuL( aCallId );
       
   404     //Dim toolbar items
       
   405     SetToolbarDimming( ETrue );
       
   406     //request that dimmed toolbar is visible.
   370     //request that dimmed toolbar is visible.
   407     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   371     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   408     iStateMachine->ChangeState( EPhoneStateIncoming );
   372     iStateMachine->ChangeState( EPhoneStateIncoming );
   409          
   373          
   410     // Reset divert indication
   374     // Reset divert indication
   418 // -----------------------------------------------------------
   382 // -----------------------------------------------------------
   419 //
   383 //
   420 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId )
   384 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId )
   421     {
   385     {
   422     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) ");
   386     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) ");
   423 
       
   424     BeginTransEffectLC( ENumberEntryClose );
       
   425     BeginUiUpdateLC();
   387     BeginUiUpdateLC();
   426 
   388 
   427     // Display call setup 
   389     // Display call setup 
   428     DisplayCallSetupL( aCallId );  
   390     DisplayCallSetupL( aCallId );  
   429     
   391     
   435     // Remove any phone dialogs if they are displayed
   397     // Remove any phone dialogs if they are displayed
   436     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   398     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   437             
   399             
   438     // Go to call setup state
   400     // Go to call setup state
   439     iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   401     iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   440 
       
   441     SetToolbarDimming( ETrue );
       
   442     
       
   443     EndTransEffect();
       
   444     
   402     
   445     iStateMachine->ChangeState( EPhoneStateCallSetup );
   403     iStateMachine->ChangeState( EPhoneStateCallSetup );
   446     }
   404     }
   447 
   405 
   448 // -----------------------------------------------------------
   406 // -----------------------------------------------------------
   464         TPhoneCmdParamInteger uidParam;
   422         TPhoneCmdParamInteger uidParam;
   465         uidParam.SetInteger( KUidPhoneApplication.iUid );
   423         uidParam.SetInteger( KUidPhoneApplication.iUid );
   466         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
   424         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
   467             &uidParam );
   425             &uidParam );
   468         }
   426         }
   469  
       
   470     BeginTransEffectLC( ENumberEntryClose );
       
   471     BeginUiUpdateLC();
   427     BeginUiUpdateLC();
   472             
   428             
   473     // Remove the number entry
   429     // Remove the number entry
   474     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   430     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   475  
   431  
   479     // Update single active call
   435     // Update single active call
   480     UpdateSingleActiveCallL( aCallId );
   436     UpdateSingleActiveCallL( aCallId );
   481     
   437     
   482     // Update touch buttons
   438     // Update touch buttons
   483     SetTouchPaneButtons( EPhoneIncallButtons );
   439     SetTouchPaneButtons( EPhoneIncallButtons );
   484     SetToolbarDimming( EFalse );
       
   485     
   440     
   486     EndUiUpdate();
   441     EndUiUpdate();
   487     EndTransEffect();
       
   488   
   442   
   489     // Go to single state
   443     // Go to single state
   490     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   444     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   491     iStateMachine->ChangeState( EPhoneStateSingle );
   445     iStateMachine->ChangeState( EPhoneStateSingle );
   492     }
   446     }
   502 
   456 
   503     switch( aCommand )
   457     switch( aCommand )
   504         {
   458         {
   505         case EPhoneCmdOptions:
   459         case EPhoneCmdOptions:
   506             {
   460             {
   507             // Open number entry menubar
       
   508             TPhoneCmdParamInteger integerParam;  
       
   509                       
       
   510             integerParam.SetInteger( 
       
   511              CPhoneMainResourceResolver::Instance()->
       
   512                 ResolveResourceID( EPhoneNumberAcqMenubar ) );               
       
   513 
       
   514             iViewCommandHandle->ExecuteCommandL( 
       
   515                 EPhoneViewMenuBarOpen, &integerParam );
       
   516             break;
   461             break;
   517             }
   462             }
   518         
   463         
   519         case EPhoneNumberAcqCmdCall:
   464         case EPhoneNumberAcqCmdCall:
   520             HandleVoiceCallCommandL();
   465             HandleVoiceCallCommandL();
   526         case EPhoneNumberAcqCmdVideoCall:
   471         case EPhoneNumberAcqCmdVideoCall:
   527             DialVideoCallL();
   472             DialVideoCallL();
   528             break;
   473             break;
   529             
   474             
   530         case EPhoneCmdBack:
   475         case EPhoneCmdBack:
   531             HandleBackCommandL();
       
   532             break;            
   476             break;            
   533             
   477             
   534         default:
   478         default:
   535             commandStatus = CPhoneState::HandleCommandL( aCommand );
   479             commandStatus = CPhoneState::HandleCommandL( aCommand );
   536             break;
   480             break;
   550     TBool commandStatus = EFalse;
   494     TBool commandStatus = EFalse;
   551     switch( aCommand )
   495     switch( aCommand )
   552        {
   496        {
   553        case EAknSoftkeyContextOptions:
   497        case EAknSoftkeyContextOptions:
   554            {
   498            {
   555            // Open number entry OK menubar
       
   556            TPhoneCmdParamInteger integerParam;
       
   557            integerParam.SetInteger( 
       
   558                CPhoneMainResourceResolver::Instance()->
       
   559                ResolveResourceID( EPhoneNumberAcqOkMenubar ) );
       
   560            iViewCommandHandle->ExecuteCommandL( 
       
   561                EPhoneViewMenuBarOpen, &integerParam );
       
   562            commandStatus = ETrue;
       
   563            }
   499            }
   564            break;       
   500            break;       
   565            
   501            
   566        default:
   502        default:
   567            commandStatus = CPhoneState::ProcessCommandL( aCommand );
   503            commandStatus = CPhoneState::ProcessCommandL( aCommand );
   605     else
   541     else
   606         {
   542         {
   607         DialVoiceCallL();                
   543         DialVoiceCallL();                
   608         }
   544         }
   609     }
   545     }
   610     
       
   611 // -----------------------------------------------------------
       
   612 // CPhoneStateIdle::HandleBackCommandL
       
   613 // -----------------------------------------------------------
       
   614 //
       
   615 void CPhoneStateIdle::HandleBackCommandL()
       
   616     {
       
   617     TBool previousApp(EFalse);
       
   618     // If previous app activation is true then open
       
   619     // previous application.
       
   620     if ( iOnScreenDialer && 
       
   621         IsSimOk() )
       
   622         {
       
   623         TPhoneCmdParamBoolean booleanParam;
       
   624         iViewCommandHandle->ExecuteCommandL( 
       
   625             EPhoneViewGetActivatePreviousApp, &booleanParam );
       
   626         
       
   627         if ( booleanParam.Boolean() )
       
   628             {
       
   629             // Open previous app.
       
   630             iViewCommandHandle->ExecuteCommandL( 
       
   631                 EPhoneViewActivatePreviousApp );
       
   632 
       
   633             // Remove number entry from screen
       
   634             iViewCommandHandle->ExecuteCommandL( 
       
   635                 EPhoneViewRemoveNumberEntry ); 
       
   636 
       
   637             iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); 
       
   638             previousApp = ETrue;   
       
   639             }
       
   640         }
       
   641         
       
   642     if ( !previousApp )
       
   643         {
       
   644         // Remove number entry from screen
       
   645         iViewCommandHandle->ExecuteCommandL( 
       
   646             EPhoneViewRemoveNumberEntry );
       
   647         // Do state-specific operation when number entry is cleared
       
   648         HandleNumberEntryClearedL();
       
   649         }    
       
   650     }
       
   651 
   546 
   652 // -----------------------------------------------------------
   547 // -----------------------------------------------------------
   653 // CPhoneStateIdle::DialVideoCallL
   548 // CPhoneStateIdle::DialVideoCallL
   654 // -----------------------------------------------------------
   549 // -----------------------------------------------------------
   655 //
   550 //
   685 EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId )
   580 EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId )
   686     {
   581     {
   687     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) ");
   582     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) ");
   688     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0,
   583     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0,
   689         Panic( EPhoneCtrlInvariant ) );
   584         Panic( EPhoneCtrlInvariant ) );
   690     // Close menu bar, if it is displayed
       
   691     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   692 
   585 
   693     // Remove any phone dialogs if they are displayed
   586     // Remove any phone dialogs if they are displayed
   694     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   587     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   695 
   588 
   696     TPhoneCmdParamKeyCapture captureParam;
   589     TPhoneCmdParamKeyCapture captureParam;
   735 //
   628 //
   736 EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId )
   629 EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId )
   737     {
   630     {
   738     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) ");
   631     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) ");
   739     __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) );
   632     __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) );
   740     
       
   741     // Close menu bar, if it is displayed
       
   742     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   743 
   633 
   744     TPhoneCmdParamKeyCapture captureParam;
   634     TPhoneCmdParamKeyCapture captureParam;
   745     captureParam.SetKeyCode( EKeyNo );
   635     captureParam.SetKeyCode( EKeyNo );
   746     iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
   636     iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
   747     
   637     
   778 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL()
   668 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL()
   779     {
   669     {
   780     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) ");
   670     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) ");
   781     
   671     
   782     if ( IsNumberEntryUsedL() )
   672     if ( IsNumberEntryUsedL() )
   783         {
   673         {        
   784         // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
   674         if ( IsNumberEntryVisibleL() )
   785         // to ensure that numberentry/dialler is drawn to UI.
       
   786         TPhoneViewResponseId respond = 
       
   787             iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
       
   788         
       
   789         if ( respond && IsNumberEntryVisibleL() )
       
   790             {
   675             {
   791             // Set Number Entry CBA
   676             // Set Number Entry CBA
   792             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
   677             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
   793             }
   678             }
   794         }
   679         }
   848     {
   733     {
   849     __LOGMETHODSTARTEND(
   734     __LOGMETHODSTARTEND(
   850         EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
   735         EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
   851     
   736     
   852     HandleVoiceCallCommandL();
   737     HandleVoiceCallCommandL();
   853     }
       
   854 
       
   855 // -----------------------------------------------------------
       
   856 // CPhoneStateIdle::LaunchApplicationL()
       
   857 // -----------------------------------------------------------
       
   858 //
       
   859 void CPhoneStateIdle::LaunchApplicationL()
       
   860     {
       
   861     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchApplicationL( ) ");
       
   862     // Check if only one number exists in the number
       
   863     // entry
       
   864     TPhoneCmdParamInteger numberEntryCountParam;
       
   865     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
       
   866         &numberEntryCountParam );
       
   867 
       
   868     if ( numberEntryCountParam.Integer() == 1 )
       
   869         {
       
   870         // Remove the number entry window
       
   871         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   872         
       
   873         iStateMachine->SendPhoneEngineMessage( 
       
   874                 MPEPhoneModel::EPEMessageEndDTMF );
       
   875 
       
   876         // Launch application.
       
   877         iViewCommandHandle->ExecuteCommandL(
       
   878             EPhoneViewLaunchApplication );
       
   879 
       
   880         // Continue displaying current app but set up the 
       
   881         // idle screen in the background
       
   882         SetupIdleScreenInBackgroundL();
       
   883         }
       
   884     }
   738     }
   885 
   739 
   886 // -----------------------------------------------------------
   740 // -----------------------------------------------------------
   887 // CPhoneStateIdle:SendExitCommandL
   741 // CPhoneStateIdle:SendExitCommandL
   888 // -----------------------------------------------------------
   742 // -----------------------------------------------------------
   923     
   777     
   924     if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() )
   778     if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() )
   925         {
   779         {
   926         //Cancels e.g. USB notifier and Audio notifier.
   780         //Cancels e.g. USB notifier and Audio notifier.
   927         iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications );
   781         iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications );
   928         iViewCommandHandle->ExecuteCommandL( EPhoneViewExitApplications );
       
   929         // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not
   782         // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not
   930         // remove security note from screen.
   783         // remove security note from screen.
   931         if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && 
   784         if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && 
   932                 !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
   785                 !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
   933             {
   786             {
  1004 //
   857 //
  1005 EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL()
   858 EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL()
  1006     {
   859     {
  1007     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) ");
   860     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) ");
  1008     
   861     
  1009     if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
       
  1010         KTelephonyLVFlagMannerMode ) )
       
  1011         {
       
  1012         ChangeMannerModeL();
       
  1013         }            
       
  1014     else
       
  1015         {
       
  1016         StartAlsLineChangeTimerL();
       
  1017         }
       
  1018 
       
  1019     // Check if any application launch functionality
       
  1020     // is configured for pressing hash for a long time
       
  1021     // the return value of CheckAppLaunchingL ignored.
       
  1022     CheckAppLaunchingL( TKeyCode( KPhoneDtmfHashCharacter ) );
       
  1023     }
   862     }
  1024 
   863 
  1025 // ---------------------------------------------------------
   864 // ---------------------------------------------------------
  1026 // CPhoneStateIdle::ChangeMannerModeL
   865 // CPhoneStateIdle::ChangeMannerModeL
  1027 // ---------------------------------------------------------
   866 // ---------------------------------------------------------
  1084                     restoreValue );
   923                     restoreValue );
  1085         
   924         
  1086     return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ));
   925     return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ));
  1087     }
   926     }
  1088 
   927 
  1089 // -----------------------------------------------------------------------------
       
  1090 // CPhoneStateIdle::CheckAppLaunchingL
       
  1091 // -----------------------------------------------------------------------------
       
  1092 //
       
  1093 TBool CPhoneStateIdle::CheckAppLaunchingL( const TKeyCode aCode )
       
  1094     {
       
  1095     TBool valuesFetched( EFalse );
       
  1096     
       
  1097     if( !IsSimOk() )
       
  1098         {
       
  1099         return valuesFetched;
       
  1100         }
       
  1101     
       
  1102     TPhoneCmdParamAppInfo appInfo;
       
  1103     HBufC8* appParam = HBufC8::NewL( KMaxParamLength );
       
  1104     CleanupStack::PushL( appParam );
       
  1105 
       
  1106     TPhoneCmdParamInteger numberEntryCount;
       
  1107     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
       
  1108         &numberEntryCount );
       
  1109     
       
  1110     TBool isValidAppLaunchingKeyEvent = EFalse;
       
  1111     if ( iCustomization && iCustomization->AllowAlphaNumericMode() &&
       
  1112          TKeyCode( KPhoneDtmfHashCharacter ) == aCode )
       
  1113         {
       
  1114         // If alphanumeric mode is supported FEP changes text input mode with
       
  1115         // long hash and removes hash from number entry.
       
  1116         isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 0 );
       
  1117         }
       
  1118     else
       
  1119         {
       
  1120         isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 1 );
       
  1121         }
       
  1122     
       
  1123     if ( isValidAppLaunchingKeyEvent )
       
  1124         {
       
  1125         TRAPD( err, 
       
  1126             CPhoneCenRepProxy::Instance()->FetchValuesFromCenRepL( 
       
  1127             appInfo, aCode, appParam, valuesFetched ) );
       
  1128         
       
  1129         if ( KErrNone == err && valuesFetched )
       
  1130             {
       
  1131             // Remove the number entry window
       
  1132             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  1133 
       
  1134             // Stop playing DTMF tone
       
  1135             iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
       
  1136 
       
  1137             TPhoneCommandParam* phoneCommandParam = 
       
  1138                 static_cast<TPhoneCommandParam*>( &appInfo );
       
  1139             iViewCommandHandle->ExecuteCommandL( 
       
  1140                         EPhoneViewActivateAppViewConventional,
       
  1141                         phoneCommandParam ); 
       
  1142             
       
  1143             // Continue displaying current app but set up the 
       
  1144             // idle screen in the background
       
  1145             SetupIdleScreenInBackgroundL();
       
  1146             }
       
  1147         }
       
  1148     CleanupStack::PopAndDestroy( appParam );
       
  1149     return valuesFetched;
       
  1150     }
       
  1151 
       
  1152 // -----------------------------------------------------------
   928 // -----------------------------------------------------------
  1153 // CPhoneStateIdle::HandleVoiceCallCommandL()
   929 // CPhoneStateIdle::HandleVoiceCallCommandL()
  1154 // -----------------------------------------------------------
   930 // -----------------------------------------------------------
  1155 //
   931 //
  1156 void CPhoneStateIdle::HandleVoiceCallCommandL()
   932 void CPhoneStateIdle::HandleVoiceCallCommandL()