107 // so that the security note can be seen. |
107 // so that the security note can be seen. |
108 TPhoneCmdParamInteger foregroundAppParam; |
108 TPhoneCmdParamInteger foregroundAppParam; |
109 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication, |
109 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication, |
110 &foregroundAppParam ); |
110 &foregroundAppParam ); |
111 |
111 |
112 if ( !IsSimOk() ) |
112 if ( !IsSimOk() && KUidPhoneApplication.iUid != foregroundAppParam.Integer() ) |
113 { |
113 { |
114 TPhoneCmdParamInteger uidParam; |
114 TPhoneCmdParamInteger uidParam; |
115 // Bring Phone app in the foreground |
115 // Bring Phone app in the foreground |
116 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
116 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
117 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
117 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
418 // ----------------------------------------------------------- |
418 // ----------------------------------------------------------- |
419 // |
419 // |
420 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
420 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
421 { |
421 { |
422 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
422 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
|
423 |
423 HandleAudioAvailableOutputChangedL(); |
424 HandleAudioAvailableOutputChangedL(); |
|
425 |
424 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume ); |
426 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume ); |
|
427 |
425 SetRingingTonePlaybackL( aCallId ); |
428 SetRingingTonePlaybackL( aCallId ); |
426 |
429 |
427 CPhonePubSubProxy::Instance()->ChangePropertyValue( |
430 CPhonePubSubProxy::Instance()->ChangePropertyValue( |
428 KPSUidScreenSaver, |
431 KPSUidScreenSaver, |
429 KScreenSaverAllowScreenSaver, |
432 KScreenSaverAllowScreenSaver, |
430 EPhoneScreensaverNotAllowed ); |
433 EPhoneScreensaverNotAllowed ); |
431 |
434 |
432 TransitionHandlerL().IncomingCallUiUpdateLC(); |
435 IsNumberEntryUsedL() ? |
|
436 BeginTransEffectLC( ECallUiAppear ) : |
|
437 BeginTransEffectLC( ENumberEntryOpen ); |
|
438 BeginUiUpdateLC(); |
433 |
439 |
434 // Hide the number entry if it exists |
440 // Hide the number entry if it exists |
435 if ( IsNumberEntryUsedL() ) |
441 if ( IsNumberEntryUsedL() ) |
436 { |
442 { |
437 SetNumberEntryVisibilityL(EFalse); |
443 SetNumberEntryVisibilityL(EFalse); |
438 } |
444 } |
439 |
445 |
440 // Close fast swap window if it's displayed |
446 // Close fast swap window if it's displayed |
441 EikonEnv()->DismissTaskList(); |
447 CEikonEnv::Static()->DismissTaskList(); |
442 |
448 |
443 // Show incoming call buttons |
449 // Show incoming call buttons |
444 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
450 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
445 SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent ); |
451 SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent ); |
446 SetTouchPaneButtonEnabled( EPhoneInCallCmdHold ); |
452 SetTouchPaneButtonEnabled( EPhoneInCallCmdHold ); |
447 |
453 |
|
454 // Display incoming call |
448 DisplayIncomingCallL( aCallId ); |
455 DisplayIncomingCallL( aCallId ); |
449 TransitionHandlerL().EndUiUpdateAndEffect(); |
456 |
450 |
457 EndUiUpdate(); |
|
458 EndTransEffect(); |
|
459 |
|
460 // Go to incoming state |
451 iCbaManager->UpdateIncomingCbaL( aCallId ); |
461 iCbaManager->UpdateIncomingCbaL( aCallId ); |
452 UpdateSilenceButtonDimming(); |
462 UpdateSilenceButtonDimming(); |
453 UpdateIncomingContextMenuL( aCallId ); |
463 UpdateIncomingContextMenuL( aCallId ); |
454 //Dim toolbar items |
464 //Dim toolbar items |
455 SetToolbarDimming( ETrue ); |
465 SetToolbarDimming( ETrue ); |
456 //request that dimmed toolbar is visible. |
466 //request that dimmed toolbar is visible. |
457 iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
467 iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
|
468 |
458 ChangeTo( EPhoneStateIncoming ); |
469 ChangeTo( EPhoneStateIncoming ); |
|
470 |
|
471 // Reset divert indication |
|
472 SetDivertIndication( EFalse ); |
459 } |
473 } |
460 |
474 |
461 // ----------------------------------------------------------- |
475 // ----------------------------------------------------------- |
462 // CPhoneStateIdle::HandleDialingL |
476 // CPhoneStateIdle::HandleDialingL |
463 // Default handling for dialling message |
477 // Default handling for dialling message |
465 // ----------------------------------------------------------- |
479 // ----------------------------------------------------------- |
466 // |
480 // |
467 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
481 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
468 { |
482 { |
469 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
483 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
470 // Indicate that the Phone needs to be sent to the background if |
|
471 // an application other than phone or idle application is in the foreground |
|
472 SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() ); |
|
473 |
|
474 DisplayCallSetupL( aCallId ); |
484 DisplayCallSetupL( aCallId ); |
475 ChangeTo( EPhoneStateCallSetup ); |
485 ChangeTo( EPhoneStateCallSetup ); |
476 } |
486 } |
477 |
487 |
478 // ----------------------------------------------------------- |
488 // ----------------------------------------------------------- |
486 SetTouchPaneButtonDisabled( EPhoneInCallCmdHold ); |
496 SetTouchPaneButtonDisabled( EPhoneInCallCmdHold ); |
487 |
497 |
488 SetToolbarDimming( ETrue ); |
498 SetToolbarDimming( ETrue ); |
489 SetToolbarButtonLoudspeakerEnabled(); |
499 SetToolbarButtonLoudspeakerEnabled(); |
490 SetToolbarButtonHandsetEnabled(); |
500 SetToolbarButtonHandsetEnabled(); |
491 SetToolbarButtonBTHFEnabled(); |
|
492 |
501 |
493 TPhoneCmdParamInteger uidParam; |
502 TPhoneCmdParamInteger uidParam; |
494 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
503 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
495 |
504 |
496 // Set Phone as the top application |
505 // Set Phone as the top application |
517 TPhoneCmdParamInteger uidParam; |
526 TPhoneCmdParamInteger uidParam; |
518 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
527 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
519 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
528 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
520 &uidParam ); |
529 &uidParam ); |
521 } |
530 } |
522 TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiClose ); |
531 BeginTransEffectLC( ENumberEntryClose ); |
523 TransitionHandlerL().BeginUiUpdateLC(); |
532 BeginUiUpdateLC(); |
524 |
533 |
525 // Remove the number entry |
534 // Remove the number entry |
526 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
535 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
527 |
536 |
528 // Display call setup header |
537 // Display call setup header |
572 case EPhoneNumberAcqCmdVideoCall: |
583 case EPhoneNumberAcqCmdVideoCall: |
573 DialVideoCallL(); |
584 DialVideoCallL(); |
574 break; |
585 break; |
575 |
586 |
576 case EPhoneCmdBack: |
587 case EPhoneCmdBack: |
577 TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiClose ); |
588 BeginTransEffectLC( ENumberEntryClose ); |
578 HandleBackCommandL(); |
589 HandleBackCommandL(); |
579 TransitionHandlerL().EndTransEffect(); |
590 EndTransEffect(); |
580 break; |
591 break; |
581 |
592 |
582 case EPhoneViewOpenNumberEntry: |
593 case EPhoneViewOpenNumberEntry: |
583 TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiOpen ); |
594 BeginTransEffectLC( ENumberEntryOpen ); |
584 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
595 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
585 TransitionHandlerL().EndTransEffect(); |
596 EndTransEffect(); |
586 break; |
597 break; |
587 |
598 |
588 default: |
599 default: |
589 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
600 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
590 break; |
601 break; |
759 // Capture keys when there is an incoming call |
770 // Capture keys when there is an incoming call |
760 CaptureKeysDuringCallNotificationL( ETrue ); |
771 CaptureKeysDuringCallNotificationL( ETrue ); |
761 |
772 |
762 // Indicate that the Foreground application needs to be sent to the foreground |
773 // Indicate that the Foreground application needs to be sent to the foreground |
763 // after call is ended. |
774 // after call is ended. |
764 SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() ); |
775 TPhoneCmdParamBoolean booleanParam; |
765 |
776 booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
777 iViewCommandHandle->ExecuteCommandL( |
|
778 EPhoneViewSetNeedToReturnToForegroundAppStatus, |
|
779 &booleanParam ); |
|
780 |
766 // Bring Phone app in the foreground |
781 // Bring Phone app in the foreground |
767 TPhoneCmdParamInteger uidParam; |
782 TPhoneCmdParamInteger uidParam; |
768 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
783 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
769 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
784 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
770 &uidParam ); |
785 &uidParam ); |
772 // Set Phone as the top application |
787 // Set Phone as the top application |
773 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
788 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
774 &uidParam ); |
789 &uidParam ); |
775 |
790 |
776 // Disable global notes when there is an incoming call |
791 // Disable global notes when there is an incoming call |
777 TPhoneCmdParamBoolean globalNotifierParam; |
792 DisableGlobalNotifiersL(); |
778 globalNotifierParam.SetBoolean( ETrue ); |
793 DisableEikonNotifiersL(); |
779 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
780 &globalNotifierParam ); |
|
781 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
782 &globalNotifierParam ); |
|
783 |
794 |
784 DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
795 DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
785 } |
796 } |
786 |
797 |
787 // ----------------------------------------------------------- |
798 // ----------------------------------------------------------- |
878 // |
889 // |
879 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
890 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
880 { |
891 { |
881 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
892 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
882 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
893 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
883 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectCallUiDisappear ); |
894 CloseClearNumberEntryAndLoadEffectL( ECallUiDisappear ); |
884 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
895 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
885 // Reset flag. |
896 // Reset flag. |
886 SetCallInitialized( EFalse ); |
897 SetCallInitialized( EFalse ); |
887 } |
898 } |
888 |
899 |
924 { |
935 { |
925 __LOGMETHODSTARTEND(EPhoneControl, |
936 __LOGMETHODSTARTEND(EPhoneControl, |
926 "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) "); |
937 "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) "); |
927 if ( IsNumberEntryUsedL() ) |
938 if ( IsNumberEntryUsedL() ) |
928 { |
939 { |
929 TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectCallUiAppear ); |
940 BeginTransEffectLC( ECallUiAppear ); |
930 /*NE should be removed because if speeddial dial is interupted during |
941 /*NE should be removed because if speeddial dial is interupted during |
931 call setup phone should not return to NE/Dialler view.*/ |
942 call setup phone should not return to NE/Dialler view.*/ |
932 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
943 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
933 |
944 |
934 /*It might be possible that some async operation was ongoing and |
945 /*It might be possible that some async operation was ongoing and |
1030 &numberEntryCountParam ); |
1041 &numberEntryCountParam ); |
1031 |
1042 |
1032 if ( numberEntryCountParam.Integer() == 1 ) |
1043 if ( numberEntryCountParam.Integer() == 1 ) |
1033 { |
1044 { |
1034 // Remove the number entry window |
1045 // Remove the number entry window |
1035 iViewCommandHandle->ExecuteCommandL( EPhoneViewClearNumberEntryContent ); |
1046 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
1036 |
1047 |
1037 iStateMachine->SendPhoneEngineMessage( |
1048 iStateMachine->SendPhoneEngineMessage( |
1038 MPEPhoneModel::EPEMessageEndDTMF ); |
1049 MPEPhoneModel::EPEMessageEndDTMF ); |
1039 |
1050 |
1040 // Launch application. |
1051 // Launch application. |
1041 iViewCommandHandle->ExecuteCommandL( |
1052 iViewCommandHandle->ExecuteCommandL( |
1042 EPhoneViewLaunchApplication ); |
1053 EPhoneViewLaunchApplication ); |
1043 |
1054 |
|
1055 // Continue displaying current app but set up the |
|
1056 // idle screen in the background |
|
1057 SetupIdleScreenInBackgroundL(); |
1044 } |
1058 } |
1045 } |
1059 } |
1046 |
1060 |
1047 // ----------------------------------------------------------- |
1061 // ----------------------------------------------------------- |
1048 // CPhoneStateIdle:SendExitCommandL |
1062 // CPhoneStateIdle:SendExitCommandL |
1049 // ----------------------------------------------------------- |
1063 // ----------------------------------------------------------- |
1050 // |
1064 // |
1051 void CPhoneStateIdle::SendExitCommandL() |
1065 void CPhoneStateIdle::SendExitCommandL() |
1052 { |
1066 { |
1053 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
1067 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
1054 // Remove number entry from screen |
1068 // Remove number entry from screen |
1055 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
1069 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
1056 |
1070 |
1057 // Simulate exit command |
1071 // Simulate exit command |
1058 RWsSession& wsSession = EikonEnv()->WsSession(); |
1072 RWsSession& wsSession = CEikonEnv::Static()->WsSession(); |
1059 TKeyEvent keyEvent; |
1073 TKeyEvent keyEvent; |
1060 keyEvent.iCode = EEikCmdExit; |
1074 keyEvent.iCode = EEikCmdExit; |
1061 keyEvent.iScanCode = EEikCmdExit; |
1075 keyEvent.iScanCode = EEikCmdExit; |
1062 keyEvent.iModifiers = 0; |
1076 keyEvent.iModifiers = 0; |
1063 keyEvent.iRepeats = 0; |
1077 keyEvent.iRepeats = 0; |
1064 wsSession.SimulateKeyEvent( keyEvent ); |
1078 wsSession.SimulateKeyEvent( keyEvent ); |
1065 wsSession.Flush(); |
1079 wsSession.Flush(); |
1066 } |
1080 } |
1067 |
1081 |
1068 // ----------------------------------------------------------- |
1082 // ----------------------------------------------------------- |
1069 // CPhoneStateIdle::HandleEndKeyPressL |
1083 // CPhoneStateIdle::HandleEndKeyPressL |
1070 // ----------------------------------------------------------- |
1084 // ----------------------------------------------------------- |
1088 if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
1102 if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
1089 !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
1103 !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
1090 { |
1104 { |
1091 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
1105 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
1092 } |
1106 } |
1093 |
1107 // Handle end key if all startup related queries and graphics have been displayed. |
1094 if ( IsSimOk() ) |
1108 if ( IsSimOk() && AllStartupQueriesDisplayed() ) |
1095 { |
1109 { |
1096 if ( aMessage == EPhoneKeyLongPress ) |
1110 if ( aMessage == EPhoneKeyLongPress ) |
1097 { |
1111 { |
1098 // Close all connections |
1112 // Close all connections |
1099 iStateMachine->SendPhoneEngineMessage( |
1113 iStateMachine->SendPhoneEngineMessage( |
1100 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
1114 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
1101 |
1115 |
1102 if ( IsNumberEntryUsedL() ) |
1116 if ( IsNumberEntryUsedL() ) |
1103 { |
1117 { |
1104 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectPhoneUiClose ); |
1118 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
1105 // If long end key event occures then all calls are terminated and |
1119 // If long end key event occures then all calls are terminated and |
1106 // dialer is closed, therefore tel.icon must be removed from FSW. |
1120 // dialer is closed, therefore tel.icon must be removed from FSW. |
1107 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
1121 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
1108 } |
1122 } |
1109 if ( !TopAppIsDisplayedL() ) |
1123 if ( !TopAppIsDisplayedL() ) |
1110 { |
1124 { |
1111 // Display idle screen |
|
1112 DisplayIdleScreenL(); |
1125 DisplayIdleScreenL(); |
1113 } |
1126 } |
1114 } |
1127 } |
1115 else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
1128 else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
1116 { |
1129 { |
1117 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectPhoneUiClose ); |
1130 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
1118 } |
1131 } |
1119 else if ( !TopAppIsDisplayedL() ) |
1132 else if ( !TopAppIsDisplayedL() ) |
1120 { |
1133 { |
1121 // Phone might not be the topmost app since it has |
1134 // Phone might not be the topmost app since it has |
1122 // some dialog/query open therefore we need to remove dialog/phone. |
1135 // some dialog/query open therefore we need to remove dialog/phone. |