30 #include <Profile.hrh> |
30 #include <Profile.hrh> |
31 #include <PUAcodes.hrh> |
31 #include <PUAcodes.hrh> |
32 #include <AknUtils.h> |
32 #include <AknUtils.h> |
33 #include <telephonyvariant.hrh> |
33 #include <telephonyvariant.hrh> |
34 #include <aknsoundsystem.h> |
34 #include <aknsoundsystem.h> |
35 #include <cphcntprofileengine.h> |
|
36 #include <wlaninternalpskeys.h> |
35 #include <wlaninternalpskeys.h> |
37 #include <btengdomainpskeys.h> |
36 #include <btengdomainpskeys.h> |
38 #include <btengdomaincrkeys.h> |
37 #include <btengdomaincrkeys.h> |
39 #include <settingsinternalcrkeys.h> |
38 #include <settingsinternalcrkeys.h> |
40 #include <starterclient.h> |
39 #include <starterclient.h> |
41 #include <RSSSettings.h> |
40 #include <rsssettings.h> |
42 #include <UikonInternalPSKeys.h> |
41 #include <UikonInternalPSKeys.h> |
43 #include <telephonydomainpstypes.h> |
42 #include <telephonydomainpstypes.h> |
44 #include <telinformationpskeys.h> |
43 #include <telinformationpskeys.h> |
45 #include <activeidle2domainpskeys.h> |
|
46 #include <coreapplicationuisdomainpskeys.h> |
44 #include <coreapplicationuisdomainpskeys.h> |
47 #include <mccecall.h> |
45 #include <mccecall.h> |
48 #include <ccpdefs.h> |
46 #include <ccpdefs.h> |
49 #include <LogsDomainCRKeys.h> |
47 #include <LogsDomainCRKeys.h> |
50 #include <spsettings.h> |
48 #include <spsettings.h> |
51 #include <ScreensaverInternalPSKeys.h> |
|
52 #include <startupdomainpskeys.h> |
49 #include <startupdomainpskeys.h> |
53 #include <MediatorDomainUIDs.h> |
50 #include <MediatorDomainUIDs.h> |
54 #include <videotelcontrolmediatorapi.h> |
51 #include <videotelcontrolmediatorapi.h> |
55 #include <textresolver.h> |
52 #include <textresolver.h> |
56 #include <phoneappvoipcommands.hrh> |
53 #include <phoneappvoipcommands.hrh> |
103 #include "cphonemediatorsender.h" |
99 #include "cphonemediatorsender.h" |
104 #include "cphonereleasecommand.h" |
100 #include "cphonereleasecommand.h" |
105 #include "cphonecontinueemergencycallcommand.h" |
101 #include "cphonecontinueemergencycallcommand.h" |
106 #include "cphonecallheadermanager.h" |
102 #include "cphonecallheadermanager.h" |
107 #include "cphonenumberentrymanager.h" |
103 #include "cphonenumberentrymanager.h" |
108 #include "mphonesecuritymodeobserver.h" |
104 #include "tphonecmdparamsfidata.h" |
109 #include "easydialingcommands.hrh" |
105 #include "mphonestorage.h" |
110 |
106 #include "phoneconstants.h" |
|
107 #include "cphoneclearblacklist.h" |
111 |
108 |
112 // ================= MEMBER FUNCTIONS ======================= |
109 // ================= MEMBER FUNCTIONS ======================= |
113 |
110 |
114 EXPORT_C CPhoneState::CPhoneState( |
111 EXPORT_C CPhoneState::CPhoneState( |
115 MPhoneStateMachine* aStateMachine, |
112 MPhoneStateMachine* aStateMachine, |
116 MPhoneViewCommandHandle* aViewCommandHandle, |
113 MPhoneViewCommandHandle* aViewCommandHandle, |
117 MPhoneCustomization* aCustomization) : |
114 MPhoneCustomization* aCustomization) : |
118 iStateMachine( aStateMachine ), |
115 iStateMachine( aStateMachine ), |
119 iViewCommandHandle( aViewCommandHandle ), |
116 iViewCommandHandle( aViewCommandHandle ), |
120 iCustomization( aCustomization ) |
117 iCustomization( aCustomization ), |
|
118 iEnv( *CEikonEnv::Static() ) |
121 { |
119 { |
122 // Need to get current SimState for inherited classis |
120 // Need to get current SimState for inherited classis |
123 iPreviousSimState = SimState(); |
121 iPreviousSimState = SimState(); |
124 __ASSERT_ALWAYS( |
122 __ASSERT_ALWAYS( |
125 aStateMachine && aViewCommandHandle, |
123 aStateMachine && aViewCommandHandle, |
209 case MEngineMonitor::EPEMessageRemoteBusy: |
209 case MEngineMonitor::EPEMessageRemoteBusy: |
210 HandleRemoteBusyL( aCallId ); |
210 HandleRemoteBusyL( aCallId ); |
211 break; |
211 break; |
212 |
212 |
213 case MEngineMonitor::EPEMessageCallWaiting: |
213 case MEngineMonitor::EPEMessageCallWaiting: |
214 SendGlobalInfoNoteL( EPhoneWaitingText ); |
214 // No need to send waiting notification for user. |
|
215 //SendGlobalInfoNoteL( EPhoneWaitingText, ETrue ); |
215 break; |
216 break; |
216 |
217 |
217 case MEngineMonitor::EPEMessageProfileChanged: |
218 case MEngineMonitor::EPEMessageProfileChanged: |
218 { |
219 { |
219 TPhoneCmdParamBoolean keypadVolumeParam; |
|
220 if ( iStateMachine->PhoneEngineInfo()->KeypadVolume() == 0 ) |
|
221 { |
|
222 iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioDisabled ); |
|
223 } |
|
224 else |
|
225 { |
|
226 iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioEnabled ); |
|
227 } |
|
228 UpdateProfileDisplayL(); |
|
229 } |
220 } |
230 break; |
221 break; |
231 |
222 |
232 case MEngineMonitor::EPEMessageRemoteTerminated: |
223 case MEngineMonitor::EPEMessageRemoteTerminated: |
233 // Close menu bar, if it is displayed, for call ending note |
|
234 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
235 /* Flow through */ |
224 /* Flow through */ |
236 case MEngineMonitor::EPEMessageDisconnecting: |
225 case MEngineMonitor::EPEMessageDisconnecting: |
237 HandleDisconnectingL( aCallId ); |
226 HandleDisconnectingL( aCallId ); |
238 break; |
227 break; |
239 |
228 |
240 case MEngineMonitor::EPEMessageTransferDone: |
229 case MEngineMonitor::EPEMessageTransferDone: |
241 SendGlobalInfoNoteL( EPhoneInCallTransferred ); |
230 SendGlobalInfoNoteL( EPhoneInCallTransferred, ETrue ); |
242 break; |
231 break; |
243 |
232 |
244 case MEngineMonitor::EPEMessageInitiatedEmergencyCall: |
233 case MEngineMonitor::EPEMessageInitiatedEmergencyCall: |
245 HandleInitiatedEmergencyCallL( aCallId ); |
234 HandleInitiatedEmergencyCallL( aCallId ); |
246 break; |
235 break; |
247 |
236 |
248 case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo: |
237 case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo: |
249 HandleInitiatedEmergencyWhileActiveVideoL(); |
238 HandleInitiatedEmergencyWhileActiveVideoL(); |
250 break; |
239 break; |
251 |
240 |
252 case MEngineMonitor::EPEMessageShowIMEI: |
241 case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
253 // Stop playing DTMF tone |
242 HandleCallSecureStatusChangeL( aCallId ); |
254 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
243 |
255 HandleShowImeiL(); |
244 if ( iCustomization ) |
256 break; |
245 { |
257 |
246 iCustomization->HandlePhoneEngineMessageL( aMessage, |
258 case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
247 aCallId ); |
259 HandleCallSecureStatusChangeL( aCallId ); |
248 } |
260 ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId ); |
249 break; |
261 break; |
|
262 |
|
263 case MEngineMonitor::EPEMessageActivateWarrantyMode: |
|
264 // Stop playing DTMF tone |
|
265 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
266 HandleShowLifeTimerL(); |
|
267 break; |
|
268 |
250 |
269 case MEngineMonitor::EPEMessageIssuingUSSDRequest: |
251 case MEngineMonitor::EPEMessageIssuingUSSDRequest: |
270 { |
252 { |
271 // Enable global notes |
253 // Enable global notes |
272 TPhoneCmdParamBoolean globalNotifierParam; |
254 TPhoneCmdParamBoolean globalNotifierParam; |
641 void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent, |
607 void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent, |
642 TEventCode aEventCode ) |
608 TEventCode aEventCode ) |
643 { |
609 { |
644 |
610 |
645 if ( !IsTouchDTmfDialerOn() |
611 if ( !IsTouchDTmfDialerOn() |
646 && !IsAnyQueryActiveL() |
612 && !IsAnyQueryActiveL() ) |
647 && !IsMenuBarVisibleL() ) |
613 { |
648 { |
614 // Send the key event to the phone engine. |
649 if( IsKeyEventFurtherProcessedL( aKeyEvent )) |
615 SendKeyEventL( aKeyEvent, aEventCode ); |
650 { |
616 } |
651 // Send the key event to the phone engine. |
|
652 SendKeyEventL( aKeyEvent, aEventCode ); |
|
653 } |
|
654 } |
|
655 |
|
656 } |
617 } |
657 |
618 |
658 // ----------------------------------------------------------------------------- |
619 // ----------------------------------------------------------------------------- |
659 // CPhoneState::IsKeyEventFurtherProcessed |
620 // CPhoneState::IsKeyEventFurtherProcessed |
660 // ----------------------------------------------------------------------------- |
621 // ----------------------------------------------------------------------------- |
661 // |
622 // |
662 TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const |
623 TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& /*aKeyEvent*/ ) const |
663 { |
624 { |
664 // While being in some special keyboard mode (Full Screen&mini QWERTY, |
|
665 // handwriting mode) FEP sends only EEventKey -event and thus manual |
|
666 // DTMFs can not be played with the user specified tone lengths. Also, |
|
667 // in general, DTMFs are tried to play only in numeric mode. |
|
668 TBool numericMode = iViewCommandHandle->HandleCommandL( |
|
669 EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess; |
|
670 |
|
671 // Key presses simulated by dialer are played even if in alphanumeric mode. |
|
672 const TBool simulatedByDialer = |
|
673 ( ( aKeyEvent.iModifiers & ( EModifierNumLock | EModifierKeypad ) ) |
|
674 == ( EModifierNumLock | EModifierKeypad ) ); |
|
675 |
|
676 |
|
677 if ( ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode ) && !simulatedByDialer ) |
|
678 { |
|
679 return EFalse; |
|
680 } |
|
681 |
|
682 return ETrue; |
625 return ETrue; |
683 } |
626 } |
684 |
627 |
685 // ----------------------------------------------------------- |
628 // ----------------------------------------------------------- |
686 // CPhoneState::HandleErrorL |
629 // CPhoneState::HandleErrorL |
737 } |
674 } |
738 } |
675 } |
739 } |
676 } |
740 break; |
677 break; |
741 |
678 |
742 case ECCPErrorCCServiceNotAvailable: |
679 case ECCPErrorCCServiceNotAvailable: |
743 { |
|
744 if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
745 { |
680 { |
746 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( EFalse ); |
681 if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
682 { |
|
683 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( EFalse ); |
|
684 } |
747 } |
685 } |
748 } |
686 break; |
749 break; |
687 |
750 |
688 case ECCPErrorBadRequest: |
751 case ECCPErrorBadRequest: |
|
752 { |
|
753 TPECallType callType = |
|
754 iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
|
755 |
|
756 if( callType == EPECallTypeVideo ) |
|
757 { |
689 { |
758 // Dialling MO video call cannot reach 3G network. |
690 TPECallType callType = |
759 __PHONELOG1( EBasic, EPhoneControl, |
691 iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
760 "PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 2, callid%d ", |
692 |
761 aErrorInfo.iCallId ); |
693 if( callType == EPECallTypeVideo ) |
762 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
694 { |
|
695 // Dialling MO video call cannot reach 3G network. |
|
696 __PHONELOG1( EBasic, EPhoneControl, |
|
697 "PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 2, callid%d ", |
|
698 aErrorInfo.iCallId ); |
|
699 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
700 } |
763 } |
701 } |
764 } |
702 break; |
765 break; |
703 |
766 |
704 case ECCPErrorVideoCallNotSupportedByNetwork: |
767 case ECCPErrorVideoCallNotSupportedByNetwork: // Flow trough |
|
768 case ECCPErrorVideoCallSetupFailed: |
705 case ECCPErrorVideoCallSetupFailed: |
769 case ECCPErrorNotReached: |
706 case ECCPErrorNotReached: |
770 case ECCPErrorCCBearerCapabilityNotCurrentlyAvailable: |
707 // If call id found and seems to be Video Call |
771 case ECCPErrorCCBearerCapabilityNotAuthorised: |
|
772 case ECCPErrorServiceSettingError: |
|
773 case ECCPErrorNoAnswerForVideo: |
|
774 { |
|
775 // If call id found and seems to be Video Call |
|
776 if ( IsVideoCall( aErrorInfo.iCallId ) ) |
708 if ( IsVideoCall( aErrorInfo.iCallId ) ) |
777 { |
709 { |
778 // Get active call count |
710 // Get active call count |
779 TPhoneCmdParamInteger activeCallCount; |
711 TPhoneCmdParamInteger activeCallCount; |
780 iViewCommandHandle->ExecuteCommandL( |
712 iViewCommandHandle->ExecuteCommandL( |
851 // Update only if the display is on or if HAL::Get returns an error, |
778 // Update only if the display is on or if HAL::Get returns an error, |
852 // in which case display value cannot be trusted. |
779 // in which case display value cannot be trusted. |
853 if ( ret || isDisplayOn ) |
780 if ( ret || isDisplayOn ) |
854 { |
781 { |
855 // Get the call duration |
782 // Get the call duration |
856 TTime time( 0 ); |
783 TTimeIntervalSeconds seconds = |
857 TTimeIntervalSeconds timeInterval = |
|
858 iStateMachine->PhoneEngineInfo()->CallDuration( aCallId ); |
784 iStateMachine->PhoneEngineInfo()->CallDuration( aCallId ); |
859 time += timeInterval; |
785 |
860 |
786 TPhoneCmdParamInteger time; |
861 // Read format string from AVKON resource |
787 time.SetInteger(seconds.Int()); |
862 TBuf<KPhoneMaxCharsInNote> timeDurationFormatString( KNullDesC ); |
788 iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time); |
863 LoadResource( timeDurationFormatString, EPhoneCallDurationFormatString ); |
789 } |
864 |
790 } |
865 // Format the time |
|
866 TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC ); |
|
867 time.FormatL( timeString, timeDurationFormatString ); |
|
868 |
|
869 // Localize time format |
|
870 AknTextUtils::LanguageSpecificNumberConversion( timeString ); |
|
871 |
|
872 // update the call header call duration |
|
873 iViewCommandHandle->ExecuteCommandL( |
|
874 EPhoneViewUpdateCallHeaderCallDuration, |
|
875 aCallId, |
|
876 timeString ); |
|
877 } |
|
878 } |
|
879 |
791 |
880 // ----------------------------------------------------------------------------- |
792 // ----------------------------------------------------------------------------- |
881 // CPhoneState::HandleRemoteBusyL |
793 // CPhoneState::HandleRemoteBusyL |
882 // ----------------------------------------------------------------------------- |
794 // ----------------------------------------------------------------------------- |
883 // |
795 // |
884 void CPhoneState::HandleRemoteBusyL( TInt aCallId ) |
796 void CPhoneState::HandleRemoteBusyL( TInt aCallId ) |
885 { |
797 { |
886 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleRemoteBusyL( ) "); |
798 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleRemoteBusyL( ) "); |
887 ShowNumberBusyNoteL(); |
799 |
888 |
800 TPEErrorInfo info; |
|
801 info.iCallId = aCallId; |
|
802 info.iErrorCode = ECCPErrorBusy; |
|
803 info.iErrorType = EPECcp; |
|
804 CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( info ); |
|
805 |
889 const TPECallType callType = |
806 const TPECallType callType = |
890 iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
807 iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
891 |
808 |
892 if( callType == EPECallTypeVideo ) |
809 if( callType == EPECallTypeVideo ) |
893 { |
810 { |
1038 } |
938 } |
1039 } |
939 } |
1040 } |
940 } |
1041 |
941 |
1042 // ----------------------------------------------------------- |
942 // ----------------------------------------------------------- |
1043 // CPhoneState::IsNoteVisibleL |
|
1044 // ----------------------------------------------------------- |
|
1045 // |
|
1046 EXPORT_C TBool CPhoneState::IsNoteVisibleL() |
|
1047 { |
|
1048 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteVisibleL( ) "); |
|
1049 TPhoneCmdParamBoolean booleanParam; |
|
1050 iViewCommandHandle->ExecuteCommandL( |
|
1051 EPhoneViewGetIsNoteVisible, &booleanParam ); |
|
1052 return booleanParam.Boolean(); |
|
1053 } |
|
1054 |
|
1055 // ----------------------------------------------------------- |
|
1056 // CPhoneState::IsMenuBarVisibleL |
|
1057 // ----------------------------------------------------------- |
|
1058 // |
|
1059 EXPORT_C TBool CPhoneState::IsMenuBarVisibleL() const |
|
1060 { |
|
1061 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsMenuBarVisibleL( ) "); |
|
1062 return iViewCommandHandle->HandleCommandL( |
|
1063 EPhoneViewIsMenuBarVisible ) == |
|
1064 EPhoneViewResponseSuccess; |
|
1065 } |
|
1066 |
|
1067 // ----------------------------------------------------------- |
|
1068 // CPhoneState::HandleNumericKeyEventL |
943 // CPhoneState::HandleNumericKeyEventL |
1069 // ----------------------------------------------------------- |
944 // ----------------------------------------------------------- |
1070 // |
945 // |
1071 EXPORT_C void CPhoneState::HandleNumericKeyEventL( |
946 EXPORT_C void CPhoneState::HandleNumericKeyEventL( |
1072 const TKeyEvent& aKeyEvent, |
947 const TKeyEvent& /*aKeyEvent*/, |
1073 TEventCode aEventCode ) |
948 TEventCode /*aEventCode*/ ) |
1074 { |
949 { |
1075 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) "); |
950 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) "); |
1076 |
|
1077 TBool numberEntryUsed = IsNumberEntryUsedL(); |
|
1078 |
|
1079 if ( numberEntryUsed && ( aKeyEvent.iRepeats == 0 || |
|
1080 aKeyEvent.iScanCode == EStdKeyBackspace || |
|
1081 aKeyEvent.iScanCode == EStdKeyLeftArrow || |
|
1082 aKeyEvent.iScanCode == EStdKeyUpArrow || |
|
1083 aKeyEvent.iScanCode == EStdKeyDownArrow || |
|
1084 aKeyEvent.iScanCode == EStdKeyRightArrow )) |
|
1085 { |
|
1086 // Number entry exists but may be hidden |
|
1087 KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode ); |
|
1088 } |
|
1089 |
951 |
1090 } |
952 } |
1091 |
953 |
1092 // ----------------------------------------------------------------------------- |
954 // ----------------------------------------------------------------------------- |
1093 // CPhoneState::IsAnyQueryActiveL |
955 // CPhoneState::IsAnyQueryActiveL |
1257 } |
1087 } |
1258 } |
1088 } |
1259 |
1089 |
1260 // <------------------------------ SYSTEM EVENTS -----------------------------> |
1090 // <------------------------------ SYSTEM EVENTS -----------------------------> |
1261 |
1091 |
1262 // ----------------------------------------------------------- |
|
1263 // CPhoneState::DynInitMenuPaneL |
|
1264 // ----------------------------------------------------------- |
|
1265 // |
|
1266 EXPORT_C void CPhoneState::DynInitMenuPaneL( |
|
1267 TInt aResourceId, |
|
1268 CEikMenuPane* aMenuPane ) |
|
1269 { |
|
1270 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuPaneL( ) "); |
|
1271 __ASSERT_DEBUG( aMenuPane && aResourceId, |
|
1272 Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
1273 |
|
1274 // Save the number of digits in the number entry before processing |
|
1275 // the menu pane |
|
1276 if ( IsNumberEntryUsedL() ) |
|
1277 { |
|
1278 TPhoneCmdParamBoolean serviceCodeParam; |
|
1279 serviceCodeParam.SetBoolean( |
|
1280 iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ); |
|
1281 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag, |
|
1282 &serviceCodeParam ); |
|
1283 } |
|
1284 |
|
1285 // Process the menu pane |
|
1286 TPhoneCmdParamDynMenu dynMenuPane; |
|
1287 dynMenuPane.SetResourceId( aResourceId ); |
|
1288 dynMenuPane.SetDynMenu( aMenuPane ); |
|
1289 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane ); |
|
1290 |
|
1291 if ( iCustomization ) |
|
1292 { |
|
1293 // Menu pane is customized after default items are decided |
|
1294 iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane); |
|
1295 } |
|
1296 } |
|
1297 |
|
1298 // ----------------------------------------------------------- |
|
1299 // CPhoneState::DynInitMenuBarL |
|
1300 // ----------------------------------------------------------- |
|
1301 // |
|
1302 EXPORT_C void CPhoneState::DynInitMenuBarL( |
|
1303 TInt aResourceId, |
|
1304 CEikMenuBar* aMenuBar ) |
|
1305 { |
|
1306 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuBarL( ) "); |
|
1307 __ASSERT_DEBUG( aMenuBar && aResourceId, |
|
1308 Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
1309 |
|
1310 TPhoneCmdParamDynMenu dynMenuBar; |
|
1311 dynMenuBar.SetResourceId( aResourceId ); |
|
1312 dynMenuBar.SetDynMenu( aMenuBar ); |
|
1313 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBar, &dynMenuBar ); |
|
1314 |
|
1315 if ( iCustomization ) |
|
1316 { |
|
1317 // Menu bar is customized after default items are decided |
|
1318 iCustomization->CustomizeMenuBarL(aResourceId, aMenuBar); |
|
1319 } |
|
1320 |
|
1321 } |
|
1322 |
1092 |
1323 // ----------------------------------------------------------- |
1093 // ----------------------------------------------------------- |
1324 // CPhoneState::HandleSystemEventL |
1094 // CPhoneState::HandleSystemEventL |
1325 // ----------------------------------------------------------- |
1095 // ----------------------------------------------------------- |
1326 // |
1096 // |
1543 return iViewCommandHandle->HandleCommandL( |
1245 return iViewCommandHandle->HandleCommandL( |
1544 EPhoneViewGetTopApplicationIsDisplayedStatus ) == |
1246 EPhoneViewGetTopApplicationIsDisplayedStatus ) == |
1545 EPhoneViewResponseSuccess; |
1247 EPhoneViewResponseSuccess; |
1546 } |
1248 } |
1547 |
1249 |
1548 // ----------------------------------------------------------- |
|
1549 // CPhoneState::TitlePaneIsVisibleL |
|
1550 // ----------------------------------------------------------- |
|
1551 // |
|
1552 TBool CPhoneState::TitlePaneIsVisibleL() const |
|
1553 { |
|
1554 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TitlePaneIsVisibleL( ) "); |
|
1555 return iViewCommandHandle->HandleCommandL( |
|
1556 EPhoneViewGetTitlePaneIsVisibleStatus ) == |
|
1557 EPhoneViewResponseSuccess; |
|
1558 } |
|
1559 |
|
1560 // <---------------------------- MENU AND CBA EVENTS -------------------------> |
1250 // <---------------------------- MENU AND CBA EVENTS -------------------------> |
1561 |
1251 |
1562 EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand ) |
1252 EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand ) |
1563 { |
1253 { |
1564 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) "); |
1254 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) "); |
1565 TBool commandStatus = ETrue; |
1255 TBool commandStatus = ETrue; |
1566 switch( aCommand ) |
1256 switch( aCommand ) |
1567 { |
1257 { |
1568 case EPhoneEmergencyCmdExit: |
1258 case EPhoneEmergencyCmdExit: |
|
1259 { |
|
1260 } |
1569 // this should be bypasses? |
1261 // this should be bypasses? |
1570 case EPhoneDialerCallHandling: |
1262 case EPhoneDialerCallHandling: |
1571 case EPhoneCmdBack: |
1263 case EPhoneCmdBack: |
1572 CloseClearNumberEntryAndLoadEffectL( ECallUiAppear ); |
1264 // Remove number entry from screen |
|
1265 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1266 // Do state-specific behaviour if number entry is cleared |
|
1267 HandleNumberEntryClearedL(); |
1573 break; |
1268 break; |
1574 |
1269 |
1575 case EPhoneDialerCmdTouchInput: |
1270 case EPhoneDialerCmdTouchInput: |
1576 OpenVkbL(); |
|
1577 break; |
1271 break; |
1578 |
1272 |
1579 case EPhoneNumberAcqCmdSendMessage: |
1273 case EPhoneNumberAcqCmdSendMessage: |
1580 // Open the mms editor |
|
1581 iViewCommandHandle->ExecuteCommandL( |
|
1582 EPhoneViewSendMessage ); |
|
1583 if ( !IsOnScreenDialerSupported() ) |
|
1584 { |
|
1585 // Remove number entry from screen |
|
1586 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1587 // Do state-specific behaviour if number entry is cleared |
|
1588 HandleNumberEntryClearedL(); |
|
1589 } |
|
1590 break; |
1274 break; |
1591 |
1275 |
1592 case EPhoneNumberAcqCmdSave: |
1276 case EPhoneNumberAcqCmdSave: |
1593 // Open Create contact |
|
1594 iViewCommandHandle->ExecuteCommandL( |
|
1595 EPhoneViewAddContact ); |
|
1596 break; |
1277 break; |
1597 |
1278 |
1598 case EPhoneNumberAcqCmdAddToName: |
1279 case EPhoneNumberAcqCmdAddToName: |
1599 // Open the message editor |
|
1600 iViewCommandHandle->ExecuteCommandL( |
|
1601 EPhoneViewUpdateContact ); |
|
1602 break; |
1280 break; |
1603 |
1281 |
1604 case EPhoneNumberAcqCmdAddToContacts: |
1282 case EPhoneNumberAcqCmdAddToContacts: |
1605 { |
1283 { |
1606 if ( IsOnScreenDialerSupported() ) |
1284 if ( IsOnScreenDialerSupported() ) |
1971 EXPORT_C void CPhoneState::DialVoiceCallL() |
1606 EXPORT_C void CPhoneState::DialVoiceCallL() |
1972 { |
1607 { |
1973 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
1608 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
1974 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
1609 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
1975 Panic( EPhoneCtrlInvariant ) ); |
1610 Panic( EPhoneCtrlInvariant ) ); |
|
1611 |
1976 // Disable global notes |
1612 // Disable global notes |
1977 TPhoneCmdParamBoolean globalNotifierParam; |
1613 TPhoneCmdParamBoolean globalNotifierParam; |
1978 globalNotifierParam.SetBoolean( ETrue ); |
1614 globalNotifierParam.SetBoolean( ETrue ); |
1979 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
1615 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
1980 &globalNotifierParam ); |
1616 &globalNotifierParam ); |
1981 iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
1617 iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
1982 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
1618 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
1983 } |
1619 } |
1984 |
1620 |
1985 // ----------------------------------------------------------- |
1621 // ----------------------------------------------------------- |
1986 // CPhoneState::DisconnectCallL |
1622 // CPhoneState::DisconnectCallL |
1987 // ----------------------------------------------------------- |
1623 // ----------------------------------------------------------- |
1988 // |
1624 // |
1989 EXPORT_C void CPhoneState::DisconnectCallL() |
1625 EXPORT_C TBool CPhoneState::DisconnectCallL() |
1990 { |
1626 { |
1991 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
1627 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
1992 // Fetch active call's id from view |
1628 TPhoneCmdParamInteger callIdParam; |
1993 TPhoneCmdParamCallStateData callStateData; |
1629 iViewCommandHandle->ExecuteCommandL( |
1994 callStateData.SetCallState( EPEStateConnected ); |
1630 EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
1995 iViewCommandHandle->HandleCommandL( |
1631 |
1996 EPhoneViewGetCallIdByState, &callStateData ); |
1632 TBool ret = EFalse; |
1997 |
1633 if( callIdParam.Integer() > KErrNotFound ) |
1998 if( callStateData.CallId() == KErrNotFound ) |
|
1999 { |
|
2000 // No connected call, find the hold call |
|
2001 callStateData.SetCallState( EPEStateHeld ); |
|
2002 iViewCommandHandle->HandleCommandL( |
|
2003 EPhoneViewGetCallIdByState, &callStateData ); |
|
2004 |
|
2005 if( callStateData.CallId() == KErrNotFound ) |
|
2006 { |
|
2007 // No hold call, find the dialing call |
|
2008 callStateData.SetCallState( EPEStateDialing ); |
|
2009 iViewCommandHandle->HandleCommandL( |
|
2010 EPhoneViewGetCallIdByState, &callStateData ); |
|
2011 } |
|
2012 |
|
2013 if( callStateData.CallId() == KErrNotFound ) |
|
2014 { |
|
2015 // No dialing call, find the outgoing call |
|
2016 callStateData.SetCallState( EPEStateConnecting ); |
|
2017 iViewCommandHandle->HandleCommandL( |
|
2018 EPhoneViewGetCallIdByState, &callStateData ); |
|
2019 } |
|
2020 |
|
2021 if( callStateData.CallId() == KErrNotFound ) |
|
2022 { |
|
2023 // No active call, find the disconnectinging call |
|
2024 callStateData.SetCallState( EPEStateDisconnecting ); |
|
2025 iViewCommandHandle->HandleCommandL( |
|
2026 EPhoneViewGetCallIdByState, &callStateData ); |
|
2027 } |
|
2028 } |
|
2029 |
|
2030 if( callStateData.CallId() > KErrNotFound ) |
|
2031 { |
1634 { |
2032 // Release the call |
1635 // Release the call |
2033 iStateMachine->SetCallId( callStateData.CallId() ); |
1636 iStateMachine->SetCallId( callIdParam.Integer() ); |
2034 if( IsVideoCall( callStateData.CallId() ) ) |
1637 |
|
1638 if( IsVideoCall( callIdParam.Integer() ) ) |
2035 { |
1639 { |
2036 // Video call can be released only after we get response to VT Shutdown Command |
1640 // Video call can be released only after we get response to VT Shutdown Command |
2037 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
1641 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
2038 KCatPhoneToVideotelCommands, |
1642 KCatPhoneToVideotelCommands, |
2039 EVtCmdReleaseDataport, |
1643 EVtCmdReleaseDataport, |
2040 TVersion( KPhoneToVideotelCmdVersionMajor, |
1644 TVersion( KPhoneToVideotelCmdVersionMajor, |
2041 KPhoneToVideotelCmdVersionMinor, |
1645 KPhoneToVideotelCmdVersionMinor, |
2042 KPhoneToVideotelCmdVersionBuild ), |
1646 KPhoneToVideotelCmdVersionBuild ), |
2043 KNullDesC8, |
1647 KNullDesC8, |
2044 CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
1648 CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
2045 } |
1649 } |
2046 else |
1650 else |
2047 { |
1651 { |
2048 // Release the call |
1652 // Release the call |
2049 iStateMachine->SendPhoneEngineMessage( |
1653 iStateMachine->SendPhoneEngineMessage( |
2050 MPEPhoneModel::EPEMessageRelease ); |
1654 MPEPhoneModel::EPEMessageRelease ); |
2051 } |
1655 } |
|
1656 ret = ETrue; |
2052 } |
1657 } |
2053 else |
1658 else |
2054 { |
1659 { |
2055 __PHONELOG( EOnlyFatal, EPhoneControl, |
1660 __PHONELOG( EOnlyFatal, EPhoneControl, |
2056 "CPhoneState::DisconnectCallL has negative call id!" ); |
1661 "CPhoneState::DisconnectCallL has negative call id!" ); |
2057 } |
1662 } |
2058 } |
1663 |
|
1664 return ret; |
|
1665 } |
2059 |
1666 |
2060 // ----------------------------------------------------------- |
1667 // ----------------------------------------------------------- |
2061 // CPhoneState::DisplayIdleScreenL |
1668 // CPhoneState::DisplayIdleScreenL |
2062 // ----------------------------------------------------------- |
1669 // ----------------------------------------------------------- |
2063 // |
1670 // |
2246 EndUiUpdate(); |
1846 EndUiUpdate(); |
2247 |
1847 |
2248 // Go to current state implementation |
1848 // Go to current state implementation |
2249 iCbaManager->UpdateInCallCbaL(); |
1849 iCbaManager->UpdateInCallCbaL(); |
2250 |
1850 |
2251 //Update state of switch to video or voice call touch button. |
1851 // Go to background if necessary |
2252 TPECallType type = iStateMachine->PhoneEngineInfo()->CallType( aCallId ); |
1852 if ( NeedToSendToBackgroundL() || IsAutoLockOn() ) |
2253 |
1853 { |
2254 if( type == EPECallTypeVideo ) |
1854 } |
2255 { |
1855 // If there is no need to send back ground and number entry is used then |
2256 TPhoneCmdParamBoolean booleanParam; |
1856 // we must show number entry. |
2257 booleanParam.SetBoolean( ETrue ); |
1857 else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() ) |
2258 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam ); |
1858 { |
2259 } |
1859 SetNumberEntryVisibilityL(ETrue); |
2260 else |
|
2261 { |
|
2262 TPhoneCmdParamBoolean booleanParam; |
|
2263 booleanParam.SetBoolean( EFalse ); |
|
2264 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam ); |
|
2265 } |
|
2266 |
|
2267 // Check if application and number entry was open before incoming call. If so give control to number entry |
|
2268 // to prevent flickering |
|
2269 if ( NeedToReturnToForegroundAppL() || IsAutoLockOn() ) |
|
2270 { |
|
2271 // If number entry is used set control and visibility. |
|
2272 if ( IsNumberEntryUsedL() ) |
|
2273 { |
|
2274 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility ); |
|
2275 } |
|
2276 } |
1860 } |
2277 } |
1861 } |
2278 |
1862 |
2279 // ----------------------------------------------------------- |
1863 // ----------------------------------------------------------- |
2280 // CPhoneState::CaptureKeysDuringCallNotificationL |
1864 // CPhoneState::CaptureKeysDuringCallNotificationL |
2281 // ----------------------------------------------------------- |
1865 // ----------------------------------------------------------- |
2282 // |
1866 // |
2283 EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL( |
1867 EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL( |
2284 TBool aCaptured ) |
1868 TBool /*aCaptured*/ ) |
2285 { |
1869 { |
2286 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) "); |
1870 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) "); |
2287 |
|
2288 if ( AknLayoutUtils::PenEnabled() ) |
|
2289 { |
|
2290 //Capture pointer events |
|
2291 TPhoneCmdParamBoolean booleanParam; |
|
2292 booleanParam.SetBoolean( aCaptured ); |
|
2293 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPointerCapture, &booleanParam ); |
|
2294 } |
|
2295 |
|
2296 // Determine which view command to execute based on the capture status |
1871 // Determine which view command to execute based on the capture status |
2297 const TInt viewCommandId = aCaptured ? |
1872 /*const TInt viewCommandId = aCaptured ? |
2298 EPhoneViewStartCapturingKey : |
1873 EPhoneViewStartCapturingKey : |
2299 EPhoneViewStopCapturingKey; |
1874 EPhoneViewStopCapturingKey; |
2300 |
1875 |
2301 // Capture the App key |
1876 // Capture the App key |
2302 TPhoneCmdParamKeyCapture appKeyCaptureParam; |
1877 TPhoneCmdParamKeyCapture appKeyCaptureParam; |
2624 globalNotifierParam.SetBoolean( EFalse ); |
2149 globalNotifierParam.SetBoolean( EFalse ); |
2625 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
2150 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
2626 &globalNotifierParam ); |
2151 &globalNotifierParam ); |
2627 |
2152 |
2628 TPhoneCmdParamGlobalNote globalNoteParam; |
2153 TPhoneCmdParamGlobalNote globalNoteParam; |
2629 |
2154 PhoneNotificationType type = aNotificationDialog ? |
2630 globalNoteParam.SetType( EAknGlobalInformationNote ); |
2155 EPhoneNotificationDialog : EPhoneMessageBoxInformation; |
|
2156 globalNoteParam.SetType( type ); |
2631 globalNoteParam.SetTextResourceId( |
2157 globalNoteParam.SetTextResourceId( |
2632 CPhoneMainResourceResolver::Instance()-> |
2158 CPhoneMainResourceResolver::Instance()-> |
2633 ResolveResourceID( aResourceId ) ); |
2159 ResolveResourceID( aResourceId ) ); |
2634 globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
2160 |
2635 |
2161 globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
|
2162 |
2636 iViewCommandHandle->ExecuteCommandL( |
2163 iViewCommandHandle->ExecuteCommandL( |
2637 EPhoneViewShowGlobalNote, &globalNoteParam ); |
2164 EPhoneViewShowGlobalNote, &globalNoteParam ); |
2638 } |
2165 } |
2639 } |
2166 } |
2640 |
2167 |
2641 // --------------------------------------------------------- |
2168 // --------------------------------------------------------- |
2642 // CPhoneUIController::SendGlobalWarningNoteL |
2169 // CPhoneUIController::SendGlobalWarningNoteL |
2643 // --------------------------------------------------------- |
2170 // --------------------------------------------------------- |
2644 // |
2171 // |
2645 EXPORT_C void CPhoneState::SendGlobalWarningNoteL( TInt aResourceId ) |
2172 EXPORT_C void CPhoneState::SendGlobalWarningNoteL( |
|
2173 TInt aResourceId, TBool aNotificationDialog ) |
2646 { |
2174 { |
2647 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) "); |
2175 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) "); |
2648 __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
2176 __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
2649 if ( CPhonePubSubProxy::Instance()->Value( |
2177 if ( CPhonePubSubProxy::Instance()->Value( |
2650 KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || |
2178 KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || |
2655 globalNotifierParam.SetBoolean( EFalse ); |
2183 globalNotifierParam.SetBoolean( EFalse ); |
2656 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
2184 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
2657 &globalNotifierParam ); |
2185 &globalNotifierParam ); |
2658 |
2186 |
2659 TPhoneCmdParamGlobalNote globalNoteParam; |
2187 TPhoneCmdParamGlobalNote globalNoteParam; |
2660 globalNoteParam.SetType( EAknGlobalWarningNote ); |
2188 PhoneNotificationType type = aNotificationDialog ? |
|
2189 EPhoneNotificationDialog : EPhoneMessageBoxWarning; |
|
2190 globalNoteParam.SetType( type ); |
2661 globalNoteParam.SetTextResourceId( |
2191 globalNoteParam.SetTextResourceId( |
2662 CPhoneMainResourceResolver::Instance()-> |
2192 CPhoneMainResourceResolver::Instance()-> |
2663 ResolveResourceID( aResourceId ) ); |
2193 ResolveResourceID( aResourceId ) ); |
2664 globalNoteParam.SetTone( EAvkonSIDWarningTone ); |
2194 |
2665 |
2195 globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
|
2196 |
2666 iViewCommandHandle->ExecuteCommandL( |
2197 iViewCommandHandle->ExecuteCommandL( |
2667 EPhoneViewShowGlobalNote, &globalNoteParam ); |
2198 EPhoneViewShowGlobalNote, &globalNoteParam ); |
2668 } |
2199 } |
2669 } |
2200 } |
2670 |
2201 |
2671 // --------------------------------------------------------- |
2202 // --------------------------------------------------------- |
2672 // CPhoneUIController::SendGlobalErrorNoteL |
2203 // CPhoneUIController::SendGlobalErrorNoteL |
2673 // --------------------------------------------------------- |
2204 // --------------------------------------------------------- |
2674 // |
2205 // |
2675 EXPORT_C void CPhoneState::SendGlobalErrorNoteL( TInt aResourceId ) |
2206 EXPORT_C void CPhoneState::SendGlobalErrorNoteL( |
|
2207 TInt aResourceId, TBool aNotificationDialog ) |
2676 { |
2208 { |
2677 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) "); |
2209 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) "); |
2678 __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
2210 __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
2679 if ( CPhonePubSubProxy::Instance()->Value( |
2211 if ( CPhonePubSubProxy::Instance()->Value( |
2680 KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
2212 KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
2722 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) "); |
2257 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) "); |
2723 CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
2258 CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
2724 iViewCommandHandle, iStateMachine, this ); |
2259 iViewCommandHandle, iStateMachine, this ); |
2725 if ( !bt->SetBTHandsfreeModeL( aHandsfreeMode )) |
2260 if ( !bt->SetBTHandsfreeModeL( aHandsfreeMode )) |
2726 { |
2261 { |
2727 SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed ); |
2262 SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
2728 } |
2263 } |
2729 CleanupStack::PopAndDestroy( bt ); |
2264 CleanupStack::PopAndDestroy( bt ); |
2730 } |
2265 } |
2731 |
2266 |
2732 // <-------------------------- INTERNAL FUNCTIONS ------------------------> |
2267 // <-------------------------- INTERNAL FUNCTIONS ------------------------> |
2733 |
2268 |
2734 // ----------------------------------------------------------- |
2269 // ----------------------------------------------------------- |
2735 // CPhoneState::UpdateIncallIndicatorL |
|
2736 // ----------------------------------------------------------- |
|
2737 // |
|
2738 void CPhoneState::UpdateIncallIndicatorL( TInt aCallState ) |
|
2739 { |
|
2740 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncallIndicatorL( ) "); |
|
2741 TPhoneCmdParamIncallIndicatorData incallIndicatorParam; |
|
2742 // Set the state. |
|
2743 incallIndicatorParam.SetCallState( aCallState ); |
|
2744 |
|
2745 if((aCallState == EPSCTsyCallStateUninitialized) || |
|
2746 (aCallState == EPSCTsyCallStateNone)) |
|
2747 { |
|
2748 incallIndicatorParam.SetLittleBubbleVisible( EFalse ); |
|
2749 } |
|
2750 else |
|
2751 { |
|
2752 SetLittleBubbleVisibilityL(&incallIndicatorParam); |
|
2753 } |
|
2754 |
|
2755 // Set mode |
|
2756 incallIndicatorParam.SetMode( |
|
2757 CPhonePubSubProxy::Instance()->Value( |
|
2758 KPSUidCtsyCallInformation, |
|
2759 KCTsyCallType ) ); |
|
2760 |
|
2761 TInt activeCallId = GetActiveCallIdL(); |
|
2762 if ( activeCallId > KErrNone ) |
|
2763 { |
|
2764 if ( iStateMachine->PhoneEngineInfo()->CallALSLine( activeCallId ) |
|
2765 == CCCECallParameters::ECCELineTypeAux ) |
|
2766 { |
|
2767 incallIndicatorParam.SetLine2( ETrue ); |
|
2768 } |
|
2769 } |
|
2770 |
|
2771 // Set the mute status |
|
2772 const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute(); |
|
2773 incallIndicatorParam.SetMute( audioMute ); |
|
2774 |
|
2775 // Set the voice privacy status |
|
2776 if ( activeCallId > KErrNotFound && activeCallId != KConferenceCallId ) |
|
2777 { |
|
2778 incallIndicatorParam.SetCiphering( |
|
2779 iStateMachine->PhoneEngineInfo()->IsSecureCall( activeCallId ) ); |
|
2780 } |
|
2781 else |
|
2782 { |
|
2783 incallIndicatorParam.SetCiphering( ETrue ); |
|
2784 } |
|
2785 |
|
2786 incallIndicatorParam.SetCipheringIndicatorAllowed( |
|
2787 iStateMachine->PhoneEngineInfo()->SecureSpecified() ); |
|
2788 |
|
2789 // Set the emergency status |
|
2790 if( EPEStateIdle != iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) ) |
|
2791 { |
|
2792 incallIndicatorParam.SetEmergency( ETrue ); |
|
2793 } |
|
2794 |
|
2795 // Update the in-call indicator |
|
2796 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateIncallIndicator, |
|
2797 &incallIndicatorParam ); |
|
2798 } |
|
2799 |
|
2800 // ----------------------------------------------------------- |
|
2801 // CPhoneState::UpdateProfileDisplayL |
2270 // CPhoneState::UpdateProfileDisplayL |
2802 // ----------------------------------------------------------- |
2271 // ----------------------------------------------------------- |
2803 // |
2272 // |
2804 void CPhoneState::UpdateProfileDisplayL() |
2273 void CPhoneState::UpdateProfileDisplayL() |
2805 { |
2274 { |
2806 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateProfileDisplayL( ) "); |
2275 } |
2807 // Get the profile information |
2276 |
2808 const TInt profileId = |
|
2809 iStateMachine->PhoneEngineInfo()->ProfileId(); |
|
2810 TPEProfileName profileName = |
|
2811 iStateMachine->PhoneEngineInfo()->ProfileName(); |
|
2812 |
|
2813 HBufC* profileString = HBufC::NewLC( profileName.Length() + |
|
2814 KPhoneMaxDateDisplayTextLength ); |
|
2815 |
|
2816 TPtr profileNameBuf = profileString->Des(); |
|
2817 profileNameBuf.Zero(); |
|
2818 profileNameBuf.Append( profileName ); |
|
2819 |
|
2820 if ( ( profileId == EProfileGeneralId ) || |
|
2821 ( profileId == EProfileOffLineId ) ) |
|
2822 { |
|
2823 // Show date instead of profile name on navi pane |
|
2824 HBufC* buffer = HBufC::NewLC( KPhoneMaxDateDisplayTextLength ); |
|
2825 TPtr dateString( buffer->Des() ); |
|
2826 |
|
2827 TTime time; |
|
2828 time.HomeTime(); |
|
2829 |
|
2830 // Get date string |
|
2831 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
2832 |
|
2833 HBufC* dateFormatString = |
|
2834 StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO, coeEnv ); |
|
2835 time.FormatL( dateString, *dateFormatString ); |
|
2836 CleanupStack::PopAndDestroy( dateFormatString ); |
|
2837 |
|
2838 // To arabic |
|
2839 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( |
|
2840 dateString ); |
|
2841 |
|
2842 //Get week day abbreviation |
|
2843 TDayNameAbb wkDayAbb = TDayNameAbb(); |
|
2844 wkDayAbb.Set(time.DayNoInWeek()); |
|
2845 |
|
2846 //Get time format string |
|
2847 HBufC* timeFormat = StringLoader::LoadLC( |
|
2848 CPhoneMainResourceResolver::Instance()-> |
|
2849 ResolveResourceID( EPhoneIdleTimeFormat ), |
|
2850 coeEnv ); |
|
2851 |
|
2852 //Set date and weekdays to time format |
|
2853 profileNameBuf.Zero(); |
|
2854 |
|
2855 StringLoader::Format( |
|
2856 profileNameBuf, |
|
2857 *timeFormat, |
|
2858 1, // date |
|
2859 dateString ); |
|
2860 |
|
2861 dateString.Copy( profileNameBuf ); |
|
2862 |
|
2863 StringLoader::Format( |
|
2864 profileNameBuf, |
|
2865 dateString, |
|
2866 0, // weekday |
|
2867 wkDayAbb ); |
|
2868 |
|
2869 CleanupStack::PopAndDestroy( timeFormat ); |
|
2870 CleanupStack::PopAndDestroy( buffer ); |
|
2871 } |
|
2872 |
|
2873 // Set silence indicator based on the ringing profile |
|
2874 const TProfileRingingType ringingType = |
|
2875 iStateMachine->PhoneEngineInfo()->RingingType(); |
|
2876 if ( ringingType == EProfileRingingTypeSilent ) |
|
2877 { |
|
2878 TBuf< 1 > silent; |
|
2879 silent.Append( KPuaCodeSilentSymbol ); |
|
2880 profileNameBuf.Insert( 0, silent ); |
|
2881 } |
|
2882 |
|
2883 // Update the profile display on the navi pane |
|
2884 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneContent, 0, |
|
2885 profileNameBuf ); |
|
2886 |
|
2887 if ( profileId == EProfileOffLineId ) |
|
2888 { |
|
2889 iViewCommandHandle->ExecuteCommandL( |
|
2890 EPhoneViewSetTitlePaneContent, |
|
2891 0, |
|
2892 profileName ); |
|
2893 } |
|
2894 else |
|
2895 { |
|
2896 UpdateOperatorDisplayL(); |
|
2897 } |
|
2898 |
|
2899 CleanupStack::PopAndDestroy( profileString ); |
|
2900 } |
|
2901 |
|
2902 // ----------------------------------------------------------- |
|
2903 // CPhoneState::UpdateOperatorDisplayL |
|
2904 // ----------------------------------------------------------- |
|
2905 // |
|
2906 void CPhoneState::UpdateOperatorDisplayL() |
|
2907 { |
|
2908 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateOperatorDisplayL( ) "); |
|
2909 __PHONELOG( EBasic, EPhoneControl, "CPhoneState::UpdateOperatorDisplayL" ); |
|
2910 // Get current title pane content. |
|
2911 TTelTitleDisplay titleContent; |
|
2912 titleContent.iDisplayTag.Zero(); |
|
2913 titleContent.iLogoHandle = 0; |
|
2914 TPckg<TTelTitleDisplay> titlePckg( titleContent ); |
|
2915 |
|
2916 RProperty::Get( |
|
2917 KPSUidTelInformation, |
|
2918 KTelDisplayInfo, |
|
2919 titlePckg ); |
|
2920 |
|
2921 if ( TitlePaneIsVisibleL() ) |
|
2922 { |
|
2923 // There is a title pane icon. |
|
2924 if ( titleContent.iLogoHandle != 0 ) |
|
2925 { |
|
2926 // Set new logo. |
|
2927 __PHONELOG( EBasic, EPhoneControl, |
|
2928 "CPhoneState::UpdateOperatorDisplayL - logo found" ); |
|
2929 |
|
2930 if( iLogoHandle != titleContent.iLogoHandle ) |
|
2931 { |
|
2932 __PHONELOG( EBasic, EPhoneControl, |
|
2933 "CPhoneState::UpdateOperatorDisplayL - set new logo" ); |
|
2934 |
|
2935 TPhoneCmdParamBitmap bitmapParam; |
|
2936 |
|
2937 // Duplicate bitmap from handle. |
|
2938 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
2939 CleanupStack::PushL( bitmap ); |
|
2940 User::LeaveIfError( |
|
2941 bitmap->Duplicate( titleContent.iLogoHandle ) ); |
|
2942 bitmapParam.SetBitmap( bitmap ); |
|
2943 |
|
2944 // Duplicate and set bitmap mask if needed |
|
2945 CFbsBitmap* maskBitmap = NULL; |
|
2946 if( titleContent.iLogoMaskHandle != 0 ) |
|
2947 { |
|
2948 maskBitmap = new( ELeave )CFbsBitmap; |
|
2949 CleanupStack::PushL( maskBitmap ); |
|
2950 User::LeaveIfError( maskBitmap->Duplicate( |
|
2951 titleContent.iLogoMaskHandle ) ); |
|
2952 bitmapParam.SetMaskBitmap( maskBitmap ); |
|
2953 } |
|
2954 |
|
2955 iViewCommandHandle->ExecuteCommandL( |
|
2956 EPhoneViewSetTitlePanePicture, |
|
2957 &bitmapParam ); |
|
2958 |
|
2959 // The title pane takes ownership of the bitmaps so no need |
|
2960 // to destroy it here. |
|
2961 if( maskBitmap ) |
|
2962 { |
|
2963 // Pop maskBitmap only, if it has been created |
|
2964 CleanupStack::Pop( maskBitmap ); |
|
2965 } |
|
2966 CleanupStack::Pop( bitmap ); |
|
2967 } |
|
2968 } |
|
2969 else |
|
2970 { |
|
2971 __PHONELOG1( EBasic, EPhoneControl, |
|
2972 "CPhoneState::UpdateOperatorDisplayL - set text=%S", &titleContent.iDisplayTag ); |
|
2973 iLogoHandle = titleContent.iLogoHandle; |
|
2974 |
|
2975 iViewCommandHandle->ExecuteCommandL( |
|
2976 EPhoneViewSetTitlePaneContent, |
|
2977 0, |
|
2978 titleContent.iDisplayTag ); |
|
2979 } |
|
2980 } |
|
2981 |
|
2982 // Check background image. |
|
2983 TPhoneCmdParamBitmap savedBitmapParam; |
|
2984 iViewCommandHandle->ExecuteCommandL( |
|
2985 EPhoneViewGetBackgroundImageBitmap, |
|
2986 &savedBitmapParam ); |
|
2987 |
|
2988 if ( titleContent.iBackgroundImageHandle != |
|
2989 savedBitmapParam.Bitmap()->Handle() ) |
|
2990 { |
|
2991 __PHONELOG2( EBasic, EPhoneControl, |
|
2992 "CPhoneState::UpdateOperatorDisplayL - update background image since different titleContent(%d), saved(%d)", |
|
2993 titleContent.iBackgroundImageHandle, savedBitmapParam.Bitmap()->Handle() ); |
|
2994 // Background image has changed. Duplicate bitmap from handle if |
|
2995 // available; otherwise reset the background image |
|
2996 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
2997 CleanupStack::PushL( bitmap ); |
|
2998 TInt err = KErrNone; |
|
2999 if ( titleContent.iBackgroundImageHandle != 0 ) |
|
3000 { |
|
3001 err = bitmap->Duplicate( titleContent.iBackgroundImageHandle ); |
|
3002 } |
|
3003 else |
|
3004 { |
|
3005 bitmap->Reset(); |
|
3006 } |
|
3007 |
|
3008 if ( err == KErrNone ) |
|
3009 { |
|
3010 iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter; |
|
3011 TPhoneCmdParamBitmap bitmapParam; |
|
3012 bitmapParam.SetBitmap( bitmap ); |
|
3013 iViewCommandHandle->ExecuteCommandL( |
|
3014 EPhoneViewSetBackgroundImageBitmap, |
|
3015 &bitmapParam ); |
|
3016 } |
|
3017 |
|
3018 CleanupStack::PopAndDestroy( bitmap ); |
|
3019 } |
|
3020 else if ( titleContent.iBackgroundImageRedrawCounter != |
|
3021 iBitmapRedrawCounter ) |
|
3022 { |
|
3023 iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter; |
|
3024 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateView ); |
|
3025 } |
|
3026 } |
|
3027 |
2277 |
3028 // ----------------------------------------------------------- |
2278 // ----------------------------------------------------------- |
3029 // CPhoneState::HandleInitiatedEmergencyCallL |
2279 // CPhoneState::HandleInitiatedEmergencyCallL |
3030 // Default handling for EPEMessageInitiatedEmergencyCallL message |
2280 // Default handling for EPEMessageInitiatedEmergencyCallL message |
3031 // (other items were commented in a header). |
2281 // (other items were commented in a header). |
3061 { |
2308 { |
3062 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) "); |
2309 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) "); |
3063 |
2310 |
3064 // We have existing video call so need to release dataport before continuing |
2311 // We have existing video call so need to release dataport before continuing |
3065 // emergency call. Otherwise we will face problems with dataport use later. |
2312 // emergency call. Otherwise we will face problems with dataport use later. |
3066 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
2313 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
3067 KMediatorVideoTelephonyDomain, |
2314 KCatPhoneToVideotelCommands, |
3068 KCatPhoneToVideotelCommands, |
2315 EVtCmdReleaseDataport, |
3069 EVtCmdReleaseDataport, |
2316 TVersion( KPhoneToVideotelCmdVersionMajor, |
3070 TVersion( KPhoneToVideotelCmdVersionMajor, |
2317 KPhoneToVideotelCmdVersionMinor, |
3071 KPhoneToVideotelCmdVersionMinor, |
2318 KPhoneToVideotelCmdVersionBuild ), |
3072 KPhoneToVideotelCmdVersionBuild ), |
2319 KNullDesC8, |
3073 KNullDesC8, |
2320 CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) ); |
3074 CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) ); |
|
3075 } |
|
3076 |
|
3077 // ----------------------------------------------------------- |
|
3078 // CPhoneState::HandleShowImeiL |
|
3079 // ----------------------------------------------------------- |
|
3080 // |
|
3081 void CPhoneState::HandleShowImeiL() |
|
3082 { |
|
3083 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowImeiL( ) "); |
|
3084 |
|
3085 if ( IsOnScreenDialerSupported() ) |
|
3086 { |
|
3087 NumberEntryClearL(); |
|
3088 } |
|
3089 else |
|
3090 { |
|
3091 // Remove number entry from screen |
|
3092 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3093 } |
|
3094 |
|
3095 // Fetch IMEI |
|
3096 TBuf<RMobilePhone::KPhoneSerialNumberSize> serialNumber; |
|
3097 TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine-> |
|
3098 PhoneEngineInfo()->PhoneIdentityParameters(); |
|
3099 serialNumber = phoneIdentityParameters.iSerialNumber; |
|
3100 |
|
3101 // Add it to the resource string |
|
3102 HBufC* buf = StringLoader::LoadLC( |
|
3103 CPhoneMainResourceResolver::Instance()-> |
|
3104 ResolveResourceID( |
|
3105 EPhonePhoneImeiString ), serialNumber ); |
|
3106 |
|
3107 TPhoneCmdParamNote noteParam; |
|
3108 noteParam.SetType( EPhoneNoteCustom ); |
|
3109 noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3110 ResolveResourceID( EPhoneInformationWaitNote ) ); |
|
3111 noteParam.SetText( *buf ); |
|
3112 |
|
3113 // Display note |
|
3114 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3115 |
|
3116 CleanupStack::PopAndDestroy( buf ); |
|
3117 } |
2321 } |
3118 |
2322 |
3119 // ----------------------------------------------------------- |
2323 // ----------------------------------------------------------- |
3120 // CPhoneState::HandleCallSecureStatusChangeL |
2324 // CPhoneState::HandleCallSecureStatusChangeL |
3121 // ----------------------------------------------------------- |
2325 // ----------------------------------------------------------- |
3140 |
2344 |
3141 iViewCommandHandle->ExecuteCommandL( |
2345 iViewCommandHandle->ExecuteCommandL( |
3142 EPhoneViewCipheringInfoChange, |
2346 EPhoneViewCipheringInfoChange, |
3143 aCallId, |
2347 aCallId, |
3144 &callHeaderParam ); |
2348 &callHeaderParam ); |
3145 } |
|
3146 |
|
3147 // ----------------------------------------------------------- |
|
3148 // CPhoneState::HandleShowLifeTimerL |
|
3149 // ----------------------------------------------------------- |
|
3150 // |
|
3151 void CPhoneState::HandleShowLifeTimerL() |
|
3152 { |
|
3153 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowLifeTimerL( ) "); |
|
3154 if ( IsOnScreenDialerSupported() ) |
|
3155 { |
|
3156 NumberEntryClearL(); |
|
3157 } |
|
3158 else |
|
3159 { |
|
3160 // Remove number entry from screen |
|
3161 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3162 } |
|
3163 |
|
3164 // Fetch LifeTime |
|
3165 TPELifeTimeData lifeTimeData = iStateMachine-> |
|
3166 PhoneEngineInfo()->LifeTimerData(); |
|
3167 |
|
3168 TLocale locale; |
|
3169 TBuf<KTimerTextLength> lifetimerText; |
|
3170 lifetimerText.NumFixedWidth( |
|
3171 lifeTimeData.iHours, |
|
3172 EDecimal, |
|
3173 KPhoneLifeTimerHoursLength ); |
|
3174 |
|
3175 lifetimerText.Append(locale.TimeSeparator( KTimerMinuteSeparator ) ); // minute seperator |
|
3176 |
|
3177 TBuf<KPhoneLifeTimerMinutesLength> mins; |
|
3178 mins.NumFixedWidth( |
|
3179 lifeTimeData.iMinutes, |
|
3180 EDecimal, |
|
3181 KPhoneLifeTimerMinutesLength ); |
|
3182 |
|
3183 lifetimerText.Append(mins); |
|
3184 |
|
3185 // Add it to the resource string |
|
3186 HBufC* buf = StringLoader::LoadLC( |
|
3187 CPhoneMainResourceResolver::Instance()-> |
|
3188 ResolveResourceID( |
|
3189 EPhoneLifeTimeFormat ), lifetimerText ); |
|
3190 TPhoneCmdParamNote noteParam; |
|
3191 noteParam.SetType( EPhoneNoteCustom ); |
|
3192 noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3193 ResolveResourceID( EPhoneInformationWaitNote ) ); |
|
3194 noteParam.SetText( *buf ); |
|
3195 |
|
3196 // Display note |
|
3197 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3198 |
|
3199 CleanupStack::PopAndDestroy( buf ); |
|
3200 } |
2349 } |
3201 |
2350 |
3202 // --------------------------------------------------------- |
2351 // --------------------------------------------------------- |
3203 // CPhoneState::IsVideoCall |
2352 // CPhoneState::IsVideoCall |
3204 // --------------------------------------------------------- |
2353 // --------------------------------------------------------- |
3739 |
2889 |
3740 // --------------------------------------------------------- |
2890 // --------------------------------------------------------- |
3741 // CPhoneState::SetTouchPaneButtons |
2891 // CPhoneState::SetTouchPaneButtons |
3742 // --------------------------------------------------------- |
2892 // --------------------------------------------------------- |
3743 // |
2893 // |
3744 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt aResourceId ) |
2894 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ ) |
3745 { |
2895 { |
3746 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
2896 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3747 { |
2897 { |
3748 // Display Video Share button instead of Hold Button if |
2898 TPhoneCmdParamBoolean muteParam; |
3749 // the feature is enabled and video sharing is currently available. |
2899 muteParam.SetBoolean( iStateMachine->PhoneEngineInfo()->AudioMute() ); |
3750 if ( aResourceId == EPhoneIncallButtons && |
2900 iViewCommandHandle->ExecuteCommand(EPhoneViewSetMuteFlag,&muteParam); |
3751 FeatureManager::FeatureSupported( KFeatureIdFfEntryPointForVideoShare ) && |
2901 |
3752 CPhonePubSubProxy::Instance()->Value |
2902 const TPEAudioOutput audioOutput = |
3753 ( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator ) |
2903 iStateMachine->PhoneEngineInfo()->AudioOutput(); |
3754 == ECoreAppUIsVideoSharingIndicatorOn ) |
2904 |
3755 { |
2905 TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
3756 aResourceId = EPhoneIncallVideoShareButtons; |
2906 EPEBTAudioAccessory ); |
3757 } |
2907 |
3758 TPhoneCmdParamInteger integerParam; |
2908 TPhoneCmdParamBoolean btParam; |
3759 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()-> |
2909 btParam.SetBoolean( audioOutput == EPEBTAudioAccessory ); |
3760 ResolveResourceID( aResourceId ) ); |
2910 iViewCommandHandle->ExecuteCommand(EPhoneViewSetBlueToothFlag,&btParam); |
|
2911 |
|
2912 TPhoneCmdParamBoolean btAvailableParam; |
|
2913 btAvailableParam.SetBoolean( btAvailable ); |
|
2914 iViewCommandHandle->ExecuteCommand( |
|
2915 EPhoneViewSetBluetoothAvailableFlag,&btAvailableParam); |
|
2916 |
|
2917 TBool emergency( EPEStateIdle != |
|
2918 iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) ); |
|
2919 TPhoneCmdParamBoolean booleanParam; |
|
2920 booleanParam.SetBoolean( emergency ); |
|
2921 |
3761 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
2922 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
3762 EPhoneViewSetTouchPaneButtons, |
2923 EPhoneViewSetTouchPaneButtons, |
3763 &integerParam ) ); |
2924 &booleanParam ) ); |
3764 |
|
3765 SetTouchPaneVisible( ETrue ); |
|
3766 } |
2925 } |
3767 } |
2926 } |
3768 |
2927 |
3769 // --------------------------------------------------------- |
2928 // --------------------------------------------------------- |
3770 // CPhoneState::DeleteTouchPaneButtons |
2929 // CPhoneState::DeleteTouchPaneButtons |
3772 // |
2931 // |
3773 EXPORT_C void CPhoneState::DeleteTouchPaneButtons() |
2932 EXPORT_C void CPhoneState::DeleteTouchPaneButtons() |
3774 { |
2933 { |
3775 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
2934 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3776 { |
2935 { |
3777 TPhoneCmdParamInteger integerParam; |
2936 TPhoneCmdParamBoolean boolParam; |
3778 integerParam.SetInteger( 0 ); |
|
3779 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
2937 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
3780 EPhoneViewSetTouchPaneButtons, |
2938 EPhoneViewSetTouchPaneButtons, |
3781 &integerParam ) ); |
2939 &boolParam ) ); |
3782 |
|
3783 SetTouchPaneVisible( EFalse ); |
|
3784 } |
|
3785 } |
|
3786 |
|
3787 // --------------------------------------------------------- |
|
3788 // CPhoneState::SetTouchPaneVisible |
|
3789 // --------------------------------------------------------- |
|
3790 // |
|
3791 EXPORT_C void CPhoneState::SetTouchPaneVisible( TBool aVisible ) |
|
3792 { |
|
3793 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3794 { |
|
3795 TPhoneCmdParamBoolean booleanParam; |
|
3796 booleanParam.SetBoolean( aVisible ); |
|
3797 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3798 EPhoneViewSetTouchPaneVisible, |
|
3799 &booleanParam ) ); |
|
3800 } |
|
3801 } |
|
3802 |
|
3803 // ---------------------------------------------------------------------------- |
|
3804 // CPhoneState::SetTouchButtonEnabled |
|
3805 // ---------------------------------------------------------------------------- |
|
3806 // |
|
3807 EXPORT_C void CPhoneState::SetTouchPaneButtonEnabled( TInt aCommandId ) |
|
3808 { |
|
3809 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3810 { |
|
3811 TPhoneCmdParamInteger commandParam; |
|
3812 commandParam.SetInteger( aCommandId ); |
|
3813 iViewCommandHandle->ExecuteCommand( EPhoneViewEnableTouchButton, |
|
3814 &commandParam ); |
|
3815 } |
|
3816 } |
|
3817 |
|
3818 // ---------------------------------------------------------------------------- |
|
3819 // CPhoneState::SetTouchButtonDisabled |
|
3820 // ---------------------------------------------------------------------------- |
|
3821 // |
|
3822 EXPORT_C void CPhoneState::SetTouchPaneButtonDisabled( TInt aCommandId ) |
|
3823 { |
|
3824 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3825 { |
|
3826 TPhoneCmdParamInteger commandParam; |
|
3827 commandParam.SetInteger( aCommandId ); |
|
3828 |
|
3829 iViewCommandHandle->ExecuteCommand( EPhoneViewDisableTouchButton, |
|
3830 &commandParam ); |
|
3831 } |
2940 } |
3832 } |
2941 } |
3833 |
2942 |
3834 // --------------------------------------------------------- |
2943 // --------------------------------------------------------- |
3835 // CPhoneState::HandleLongHashL |
2944 // CPhoneState::HandleLongHashL |
3837 // |
2946 // |
3838 EXPORT_C void CPhoneState::HandleLongHashL() |
2947 EXPORT_C void CPhoneState::HandleLongHashL() |
3839 { |
2948 { |
3840 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() "); |
2949 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() "); |
3841 |
2950 |
3842 TPhoneCmdParamInteger numberEntryCountParam; |
|
3843 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
3844 &numberEntryCountParam ); |
|
3845 TInt neLength( numberEntryCountParam.Integer() ); |
|
3846 |
|
3847 if( neLength == 1 ) |
|
3848 { |
|
3849 if ( !iStateMachine->SecurityMode()->IsSecurityMode() ) |
|
3850 { |
|
3851 OnlyHashInNumberEntryL(); |
|
3852 } |
|
3853 } |
|
3854 } |
|
3855 |
|
3856 // ----------------------------------------------------------- |
|
3857 // CPhoneState::OpenVKBL |
|
3858 // ----------------------------------------------------------- |
|
3859 // |
|
3860 void CPhoneState::OpenVkbL() |
|
3861 { |
|
3862 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() "); |
|
3863 iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard ); |
|
3864 } |
2951 } |
3865 |
2952 |
3866 // ----------------------------------------------------------- |
2953 // ----------------------------------------------------------- |
3867 // CPhoneState::BeginUiUpdateLC |
2954 // CPhoneState::BeginUiUpdateLC |
3868 // ----------------------------------------------------------- |
2955 // ----------------------------------------------------------- |
3869 // |
2956 // |
3870 EXPORT_C void CPhoneState::BeginUiUpdateLC() |
2957 EXPORT_C void CPhoneState::BeginUiUpdateLC() |
3871 { |
2958 { |
|
2959 |
3872 iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
2960 iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
|
2961 |
3873 TCleanupItem operation( UiUpdateCleanup, this ); |
2962 TCleanupItem operation( UiUpdateCleanup, this ); |
3874 CleanupStack::PushL( operation ); |
2963 CleanupStack::PushL( operation ); |
3875 } |
2964 } |
3876 |
2965 |
3877 // ----------------------------------------------------------- |
2966 // ----------------------------------------------------------- |
3878 // CPhoneState::EndUiUpdate |
2967 // CPhoneState::EndUiUpdate |
3879 // ----------------------------------------------------------- |
2968 // ----------------------------------------------------------- |
3880 // |
2969 // |
3881 EXPORT_C void CPhoneState::EndUiUpdate() |
2970 EXPORT_C void CPhoneState::EndUiUpdate() |
3882 { |
2971 { |
3883 CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
2972 CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
3884 } |
|
3885 |
|
3886 // ----------------------------------------------------------- |
|
3887 // CPhoneState::BeginTransEffectLC |
|
3888 // ----------------------------------------------------------- |
|
3889 // |
|
3890 EXPORT_C void CPhoneState::BeginTransEffectLC( TStateTransEffectType aType ) |
|
3891 { |
|
3892 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) "); |
|
3893 TPhoneCmdParamTransEffect effectParam; |
|
3894 switch ( aType ) |
|
3895 { |
|
3896 case ENumberEntryOpen: |
|
3897 effectParam.SetType( EPhoneTransEffectDialerOpen ); |
|
3898 break; |
|
3899 case ENumberEntryClose: |
|
3900 effectParam.SetType( EPhoneTransEffectDialerClose ); |
|
3901 break; |
|
3902 case ENumberEntryCreate: |
|
3903 effectParam.SetType( EPhoneTransEffectDialerCreate ); |
|
3904 break; |
|
3905 case ECallUiAppear: |
|
3906 effectParam.SetType( EPhoneTransEffectCallUiAppear ); |
|
3907 break; |
|
3908 case ECallUiDisappear: |
|
3909 effectParam.SetType( EPhoneTransEffectCallUiDisappear ); |
|
3910 break; |
|
3911 default: |
|
3912 effectParam.SetType( EPhoneTransEffectNone ); |
|
3913 } |
|
3914 effectParam.SetAppUid( KUidPhoneApplication ); |
|
3915 iViewCommandHandle->ExecuteCommand( |
|
3916 EPhoneViewBeginTransEffect, |
|
3917 &effectParam ); |
|
3918 // Always put the cleanup item into stack as expected by the caller. |
|
3919 TCleanupItem operation( EffectCleanup, this ); |
|
3920 CleanupStack::PushL( operation ); |
|
3921 } |
|
3922 |
|
3923 // ----------------------------------------------------------- |
|
3924 // CPhoneState::EndTransEffect |
|
3925 // ----------------------------------------------------------- |
|
3926 // |
|
3927 EXPORT_C void CPhoneState::EndTransEffect() |
|
3928 { |
|
3929 CleanupStack::PopAndDestroy(); // Call EffectCleanup |
|
3930 } |
2973 } |
3931 |
2974 |
3932 // ----------------------------------------------------------- |
2975 // ----------------------------------------------------------- |
3933 // CPhoneState::CheckIfShowTerminationNote |
2976 // CPhoneState::CheckIfShowTerminationNote |
3934 // This method is intended to be overridden in states |
2977 // This method is intended to be overridden in states |
3972 // |
3015 // |
3973 void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
3016 void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
3974 { |
3017 { |
3975 static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
3018 static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
3976 EPhoneViewEndUpdate ); |
3019 EPhoneViewEndUpdate ); |
3977 } |
|
3978 |
|
3979 // ----------------------------------------------------------------------------- |
|
3980 // CPhoneState::EffectCleanup |
|
3981 // ----------------------------------------------------------------------------- |
|
3982 // |
|
3983 void CPhoneState::EffectCleanup(TAny* aThis ) |
|
3984 { |
|
3985 TPhoneCmdParamTransEffect effectParam; |
|
3986 effectParam.SetType( EPhoneTransEffectStop ); |
|
3987 // won't do anything if effect wasn't started |
|
3988 static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3989 EPhoneViewEndTransEffect, &effectParam ); |
|
3990 } |
|
3991 |
|
3992 // ----------------------------------------------------------------------------- |
|
3993 // CPhoneState::IsDTMFEditorVisibleL |
|
3994 // ----------------------------------------------------------------------------- |
|
3995 // |
|
3996 EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const |
|
3997 { |
|
3998 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsDTMFEditorVisibleL( ) "); |
|
3999 return iViewCommandHandle->HandleCommandL( |
|
4000 EPhoneViewIsDTMFEditorVisible ) == |
|
4001 EPhoneViewResponseSuccess; |
|
4002 } |
|
4003 |
|
4004 // ----------------------------------------------------------------------------- |
|
4005 // CPhoneState::CloseDTMFEditorL |
|
4006 // ----------------------------------------------------------------------------- |
|
4007 // |
|
4008 EXPORT_C void CPhoneState::CloseDTMFEditorL() |
|
4009 { |
|
4010 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()"); |
|
4011 if ( iOnScreenDialer ) // Touch |
|
4012 { |
|
4013 TPhoneCmdParamBoolean booleanParam; |
|
4014 booleanParam.SetBoolean( EFalse ); |
|
4015 iViewCommandHandle->ExecuteCommandL( |
|
4016 EPhoneViewSetDtmfDialerViewVisible, |
|
4017 &booleanParam ); |
|
4018 CloseClearNumberEntryAndLoadEffectL( ECallUiAppear ); |
|
4019 } |
|
4020 else // Non-Touch |
|
4021 { |
|
4022 // If dtmf query is visible then remove number entry |
|
4023 // because it should not be shown if user has pressed end key. |
|
4024 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
4025 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
4026 // Do state-specific behaviour if number entry is cleared |
|
4027 HandleNumberEntryClearedL(); |
|
4028 } |
|
4029 } |
3020 } |
4030 |
3021 |
4031 // ----------------------------------------------------------- |
3022 // ----------------------------------------------------------- |
4032 // CPhoneState::SetDefaultFlagsL() |
3023 // CPhoneState::SetDefaultFlagsL() |
4033 // ----------------------------------------------------------- |
3024 // ----------------------------------------------------------- |
4337 iCustomization ); |
3330 iCustomization ); |
4338 } |
3331 } |
4339 return iCallHeaderManager; |
3332 return iCallHeaderManager; |
4340 } |
3333 } |
4341 |
3334 |
4342 // ----------------------------------------------------------------------------- |
|
4343 // CPhoneState::CloseCustomizedDialerL |
|
4344 // ----------------------------------------------------------------------------- |
|
4345 // |
|
4346 EXPORT_C void CPhoneState::CloseCustomizedDialerL() |
|
4347 { |
|
4348 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) "); |
|
4349 // Set dialer back to default mode. |
|
4350 iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer ); |
|
4351 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
|
4352 } |
|
4353 |
|
4354 // ----------------------------------------------------------------------------- |
|
4355 // CPhoneState::CustomizedDialerMenuResourceId |
|
4356 // ----------------------------------------------------------------------------- |
|
4357 // |
|
4358 EXPORT_C TInt CPhoneState::CustomizedDialerMenuResourceIdL() |
|
4359 { |
|
4360 __LOGMETHODSTARTEND(EPhoneControl, |
|
4361 "CPhoneState::CustomizedDialerMenuResourceId( ) "); |
|
4362 // Get and return customized dialer menu resource id |
|
4363 TPhoneCmdParamInteger integerParam; |
|
4364 iViewCommandHandle->HandleCommandL( |
|
4365 EPhoneViewGetCustomizedDialerMenuResourceId, |
|
4366 &integerParam ); |
|
4367 return integerParam.Integer(); |
|
4368 } |
|
4369 |
|
4370 // ----------------------------------------------------------------------------- |
|
4371 // CPhoneState::CustomizedDialerCbaResourceId |
|
4372 // ----------------------------------------------------------------------------- |
|
4373 // |
|
4374 EXPORT_C TInt CPhoneState::CustomizedDialerCbaResourceIdL() |
|
4375 { |
|
4376 __LOGMETHODSTARTEND(EPhoneControl, |
|
4377 "CPhoneState::CustomizedDialerCbaResourceId( ) "); |
|
4378 // Get and return customized dialer CBA resource id |
|
4379 TPhoneCmdParamInteger integerParam; |
|
4380 iViewCommandHandle->HandleCommandL( |
|
4381 EPhoneViewGetCustomizedDialerCbaResourceId, |
|
4382 &integerParam ); |
|
4383 return integerParam.Integer(); |
|
4384 } |
|
4385 |
|
4386 // ----------------------------------------------------------- |
|
4387 // CPhoneState::ShowDtmfDialerL |
|
4388 // ----------------------------------------------------------- |
|
4389 // |
|
4390 void CPhoneState::ShowDtmfDialerL() |
|
4391 { |
|
4392 __LOGMETHODSTARTEND(EPhoneControl, |
|
4393 "CPhoneState::ShowDtmfDialerL()" ); |
|
4394 |
|
4395 // Set dialer to DTMF mode. |
|
4396 TPhoneCmdParamBoolean booleanParam; |
|
4397 booleanParam.SetBoolean( ETrue ); |
|
4398 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible, |
|
4399 &booleanParam ); |
|
4400 BeginTransEffectLC( ECallUiDisappear ); |
|
4401 if ( IsNumberEntryUsedL() ) |
|
4402 { |
|
4403 // Store the number entry content to cache |
|
4404 if ( !IsNumberEntryContentStored() ) |
|
4405 { |
|
4406 StoreNumberEntryContentL(); |
|
4407 } |
|
4408 // Clear and display DTMF dialer |
|
4409 NumberEntryClearL(); |
|
4410 SetNumberEntryVisibilityL(ETrue); |
|
4411 } |
|
4412 else |
|
4413 { |
|
4414 // Create and display DTMF dialer |
|
4415 NumberEntryManagerL()->CreateNumberEntryL(); |
|
4416 } |
|
4417 EndTransEffect(); |
|
4418 |
|
4419 // Update CBA |
|
4420 iCbaManager->UpdateInCallCbaL(); |
|
4421 |
|
4422 if( EPSCTsyCallStateDialling == |
|
4423 CPhonePubSubProxy::Instance()->Value(KPSUidCtsyCallInformation, KCTsyCallState ) ) |
|
4424 { |
|
4425 // Call indicator update to ensure that small call |
|
4426 // bubble is shown in dtmf dialer during dialing |
|
4427 // call this needs to be done because when call is |
|
4428 // initialized small call bubble visibility is set to false. |
|
4429 UpdateIncallIndicatorL(EPSCTsyCallStateDialling); |
|
4430 } |
|
4431 } |
|
4432 |
|
4433 // ----------------------------------------------------------- |
3335 // ----------------------------------------------------------- |
4434 // CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer |
3336 // CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer |
4435 // ----------------------------------------------------------- |
3337 // ----------------------------------------------------------- |
4436 // |
3338 // |
4437 EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer() |
3339 EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer() |
4438 { |
3340 { |
4439 if ( IsOnScreenDialerSupported() ) |
3341 |
4440 { |
|
4441 TBool isDialerVisible( EFalse ); |
|
4442 TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() ); |
|
4443 |
|
4444 if ( isDialerVisible ) |
|
4445 { |
|
4446 TRAP_IGNORE( CloseDTMFEditorL() ); |
|
4447 } |
|
4448 |
|
4449 // if the DTMF dialer is used before the idle message, we have to |
|
4450 // restore the original content of the number entry |
|
4451 if ( IsNumberEntryContentStored() ) |
|
4452 { |
|
4453 TBool isNumberEntryUsed( EFalse ); |
|
4454 TRAP_IGNORE( isNumberEntryUsed = IsNumberEntryUsedL() ); |
|
4455 |
|
4456 if ( !isNumberEntryUsed ) |
|
4457 { |
|
4458 TRAP_IGNORE( NumberEntryManagerL()->CreateNumberEntryL() ); |
|
4459 } |
|
4460 // Restore the number entry content from cache |
|
4461 TRAP_IGNORE( RestoreNumberEntryContentL() ); |
|
4462 } |
|
4463 } |
|
4464 } |
3342 } |
4465 |
3343 |
4466 // ----------------------------------------------------------- |
3344 // ----------------------------------------------------------- |
4467 // CPhoneState::IsOnScreenDialerSupported |
3345 // CPhoneState::IsOnScreenDialerSupported |
4468 // ----------------------------------------------------------- |
3346 // ----------------------------------------------------------- |
4677 // |
3514 // |
4678 void CPhoneState::NumberEntryClearL() |
3515 void CPhoneState::NumberEntryClearL() |
4679 { |
3516 { |
4680 NumberEntryManagerL()->NumberEntryClearL(); |
3517 NumberEntryManagerL()->NumberEntryClearL(); |
4681 } |
3518 } |
4682 |
3519 |
4683 // ----------------------------------------------------------- |
3520 // ----------------------------------------------------------- |
4684 // CPhoneState::UpdateSilenceButtonDimming |
3521 // CPhoneState::GetBlockedKeyList |
4685 // ----------------------------------------------------------- |
3522 // ----------------------------------------------------------- |
4686 // |
3523 // |
4687 EXPORT_C void CPhoneState::UpdateSilenceButtonDimming() |
3524 EXPORT_C const RArray<TInt>& CPhoneState::GetBlockedKeyList() const |
4688 { |
3525 { |
4689 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3526 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetBlockedKeyList( ) "); |
4690 { |
3527 return iStateMachine->PhoneStorage()->GetBlockedKeyList(); |
4691 const TProfileRingingType ringingType = |
3528 } |
4692 iStateMachine->PhoneEngineInfo()->RingingType(); |
3529 |
|
3530 // ----------------------------------------------------------- |
|
3531 // CPhoneState::DisableHWKeysL |
|
3532 // ----------------------------------------------------------- |
|
3533 // |
|
3534 EXPORT_C void CPhoneState::DisableHWKeysL() |
|
3535 { |
|
3536 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableHWKeysL( ) "); |
|
3537 |
|
3538 if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
3539 { |
|
3540 __PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableHWKeysL HW Keys Disabled " ); |
|
3541 |
|
3542 iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyNo ); |
|
3543 iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyYes ); |
|
3544 } |
|
3545 } |
|
3546 |
|
3547 // ----------------------------------------------------------- |
|
3548 // CPhoneState::DisableCallUIL |
|
3549 // ----------------------------------------------------------- |
|
3550 // |
|
3551 EXPORT_C void CPhoneState::DisableCallUIL() |
|
3552 { |
|
3553 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableCallUIL( ) "); |
|
3554 |
|
3555 // Set Call UI state to storage |
|
3556 if( !iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
3557 { |
|
3558 __PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableCallUIL CallUI Disabled " ); |
|
3559 |
|
3560 // Show keys locked note |
|
3561 TPhoneCmdParamNote noteParam; |
|
3562 noteParam.SetType( EPhoneNoteUIDisabled ); |
|
3563 noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3564 ResolveResourceID( EPhoneInformationNote ) ); |
|
3565 |
|
3566 HBufC* noteText = StringLoader::LoadLC( |
|
3567 CPhoneMainResourceResolver::Instance()-> |
|
3568 ResolveResourceID( EPhoneIncomingCallKeysLocked ) ); |
|
3569 noteParam.SetText( *noteText ); |
|
3570 |
|
3571 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3572 CleanupStack::PopAndDestroy( noteText ); |
|
3573 |
|
3574 // Start capturing the key guard key |
|
3575 TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
3576 appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
3577 appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
|
3578 appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
3579 iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
4693 |
3580 |
4694 TBool callIsAlerting = |
3581 // Set Call UI state to storage |
4695 !(( ringingType == EProfileRingingTypeSilent ) || |
3582 iStateMachine->PhoneStorage()->SetScreenLocked( ETrue ); |
4696 ( ringingType == EProfileRingingTypeBeepOnce )); |
3583 } |
4697 |
3584 } |
4698 if ( !callIsAlerting ) |
3585 |
4699 { |
3586 // ----------------------------------------------------------- |
4700 SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent ); |
3587 // CPhoneState::EnableCallUIL |
4701 } |
3588 // ----------------------------------------------------------- |
4702 } |
3589 // |
4703 } |
3590 EXPORT_C void CPhoneState::EnableCallUIL() |
4704 |
3591 { |
4705 // --------------------------------------------------------- |
3592 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EnableCallUIL( ) "); |
4706 // CPhoneState::SetToolbarDimming |
3593 |
4707 // --------------------------------------------------------- |
3594 if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
4708 // |
3595 { |
4709 EXPORT_C void CPhoneState::SetToolbarDimming( TBool aDimmed ) |
3596 __PHONELOG( EBasic, EPhoneControl, " CPhoneState::EnableCallUIL CallUI Enabled " ); |
4710 { |
3597 |
4711 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3598 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
4712 { |
3599 iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote ); |
4713 // Check that we are not undimming toolbar in security mode |
3600 |
4714 if ( !( !aDimmed && iStateMachine->SecurityMode()->IsSecurityMode() ) ) |
3601 // Stop capturing the key guard key |
4715 { |
3602 TPhoneCmdParamKeyCapture appKeyCaptureParam; |
4716 TPhoneCmdParamBoolean booleanParam; |
3603 appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
4717 booleanParam.SetBoolean( aDimmed ); |
3604 appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
4718 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
3605 appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
4719 EPhoneViewSetToolbarDimming, &booleanParam )); |
3606 iViewCommandHandle->ExecuteCommandL( EPhoneViewStopCapturingKey, &appKeyCaptureParam ); |
4720 } |
3607 |
|
3608 iStateMachine->PhoneStorage()->SetScreenLocked( EFalse ); |
|
3609 } |
|
3610 } |
|
3611 |
|
3612 // ----------------------------------------------------------- |
|
3613 // CPhoneState::CheckDisableHWKeysAndCallUIL |
|
3614 // ----------------------------------------------------------- |
|
3615 // |
|
3616 EXPORT_C void CPhoneState::CheckDisableHWKeysAndCallUIL() |
|
3617 { |
|
3618 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::CheckDisableHWKeysAndCallUIL( ) "); |
|
3619 |
|
3620 if( IsKeyLockOn() || IsAutoLockOn() ) |
|
3621 { |
|
3622 // Disable HW keys if needed |
|
3623 if( CPhoneCenRepProxy::Instance()-> |
|
3624 IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3625 { |
|
3626 DisableHWKeysL(); |
|
3627 } |
|
3628 |
|
3629 // Disable Call UI if needed |
|
3630 if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3631 && !CPhoneCenRepProxy::Instance()-> |
|
3632 IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
3633 { |
|
3634 DisableCallUIL(); |
|
3635 iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( ETrue ); |
|
3636 } |
|
3637 } |
|
3638 } |
|
3639 |
|
3640 // ----------------------------------------------------------- |
|
3641 // CPhoneState::HandleHoldSwitchL |
|
3642 // ----------------------------------------------------------- |
|
3643 // |
|
3644 EXPORT_C void CPhoneState::HandleHoldSwitchL() |
|
3645 { |
|
3646 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::HandleHoldSwitchL( ) "); |
|
3647 |
|
3648 if( CPhoneCenRepProxy::Instance()-> |
|
3649 IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3650 { |
|
3651 if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
3652 { |
|
3653 // Disable HW Keys if needed |
|
3654 DisableHWKeysL(); |
|
3655 } |
|
3656 else |
|
3657 { |
|
3658 // Reset blocked keys list |
|
3659 iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
3660 } |
|
3661 } |
|
3662 |
|
3663 if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3664 && !CPhoneCenRepProxy::Instance()-> |
|
3665 IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
3666 { |
|
3667 if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
3668 { |
|
3669 // Enable Call |
|
3670 EnableCallUIL(); |
|
3671 } |
|
3672 else |
|
3673 { |
|
3674 // Set keylock enabled |
|
3675 iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
3676 // Disable Call |
|
3677 DisableCallUIL(); |
|
3678 } |
|
3679 } |
|
3680 |
|
3681 // Stop ringingtone |
|
3682 iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
3683 } |
|
3684 |
|
3685 // ----------------------------------------------------------- |
|
3686 // CPhoneState::RetainPreviousKeylockStateL |
|
3687 // ----------------------------------------------------------- |
|
3688 // |
|
3689 EXPORT_C void CPhoneState::RetainPreviousKeylockStateL() |
|
3690 { |
|
3691 // Lock keypad, if keylock was enabled before incoming call. |
|
3692 // Also reset PhoneStorage keylock status. |
|
3693 if ( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) && |
|
3694 iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
3695 { |
|
3696 iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
3697 iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
3698 } |
|
3699 } |
|
3700 |
|
3701 // --------------------------------------------------------- |
|
3702 // CPhoneState::HandleKeyLockEnabledL |
|
3703 // --------------------------------------------------------- |
|
3704 // |
|
3705 EXPORT_C void CPhoneState::HandleKeyLockEnabled( TBool aKeylockEnabled ) |
|
3706 { |
|
3707 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyLockEnabledL( ) "); |
|
3708 if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3709 && CPhoneCenRepProxy::Instance()-> |
|
3710 IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3711 { |
|
3712 if( !aKeylockEnabled ) |
|
3713 { |
|
3714 // Keylock disabled |
|
3715 // Reset blocked keys list |
|
3716 iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
3717 } |
4721 } |
3718 } |
4722 } |
3719 } |
4723 |
3720 |
4724 // --------------------------------------------------------- |
3721 // --------------------------------------------------------- |
4725 // CPhoneState::SetToolbarButtonLoudspeakerEnabled |
3722 // CPhoneState::SetToolbarButtonLoudspeakerEnabled |
4729 { |
3726 { |
4730 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3727 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
4731 { |
3728 { |
4732 TPhoneCmdParamInteger integerParam; |
3729 TPhoneCmdParamInteger integerParam; |
4733 integerParam.SetInteger( EPhoneInCallCmdActivateIhf ); |
3730 integerParam.SetInteger( EPhoneInCallCmdActivateIhf ); |
|
3731 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3732 EPhoneViewEnableToolbarButton, &integerParam )); |
|
3733 } |
|
3734 } |
|
3735 |
|
3736 // --------------------------------------------------------- |
|
3737 // CPhoneState::SetBackButtonActive |
|
3738 // --------------------------------------------------------- |
|
3739 // |
|
3740 EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive ) |
|
3741 { |
|
3742 if(IsAutoLockOn() && aActive) { |
|
3743 // keep back button dimmed device lock case |
|
3744 return; |
|
3745 } |
|
3746 |
|
3747 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3748 { |
|
3749 TPhoneCmdParamBoolean booleanParam; |
|
3750 booleanParam.SetBoolean( aActive ); |
4734 iViewCommandHandle->ExecuteCommand( |
3751 iViewCommandHandle->ExecuteCommand( |
4735 EPhoneViewEnableToolbarButton, &integerParam ); |
3752 EPhoneViewBackButtonActive, &booleanParam ); |
4736 } |
3753 } |
4737 } |
3754 } |
4738 |
3755 |
4739 // --------------------------------------------------------- |
3756 // ----------------------------------------------------------- |
4740 // CPhoneState::SetToolbarButtonHandsetEnabled |
3757 // CPhoneState::OpenSoftRejectMessageEditorL |
4741 // --------------------------------------------------------- |
3758 // ----------------------------------------------------------- |
4742 // |
3759 // |
4743 EXPORT_C void CPhoneState::SetToolbarButtonHandsetEnabled() |
3760 EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
4744 { |
3761 { |
4745 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3762 __LOGMETHODSTARTEND(EPhoneControl, |
4746 { |
3763 "CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
4747 TPhoneCmdParamInteger integerParam; |
3764 |
4748 integerParam.SetInteger( EPhoneInCallCmdHandset ); |
3765 // Fetch incoming call's id from view |
4749 iViewCommandHandle->ExecuteCommand( |
3766 TPhoneCmdParamCallStateData callStateData; |
4750 EPhoneViewEnableToolbarButton, &integerParam ); |
3767 callStateData.SetCallState( EPEStateRinging ); |
4751 } |
3768 iViewCommandHandle->HandleCommandL( |
4752 } |
3769 EPhoneViewGetCallIdByState, &callStateData ); |
4753 |
3770 |
4754 // --------------------------------------------------------- |
3771 TInt ringingCallId( KErrNotFound ); |
4755 // CPhoneState::SetToolbarButtonBTHFEnabled |
3772 // Do nothing if negative incoming call id |
4756 // --------------------------------------------------------- |
3773 if( callStateData.CallId() > KErrNotFound ) |
4757 // |
3774 { |
4758 EXPORT_C void CPhoneState::SetToolbarButtonBTHFEnabled() |
3775 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
4759 { |
3776 |
4760 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3777 ringingCallId = callStateData.CallId(); |
4761 { |
3778 } |
4762 TPhoneCmdParamInteger integerParam; |
|
4763 integerParam.SetInteger( EPhoneInCallCmdBtHandsfree ); |
|
4764 iViewCommandHandle->ExecuteCommand( |
|
4765 EPhoneViewEnableToolbarButton, &integerParam ); |
|
4766 } |
|
4767 } |
|
4768 |
|
4769 // --------------------------------------------------------- |
|
4770 // CPhoneState::HandleEasyDialingCommandsL |
|
4771 // --------------------------------------------------------- |
|
4772 // |
|
4773 void CPhoneState::HandleEasyDialingCommandsL( TInt aCommandId ) |
|
4774 { |
|
4775 switch ( aCommandId ) |
|
4776 { |
|
4777 case EPhoneCmdUpdateCba: |
|
4778 iCbaManager->UpdateInCallCbaL(); |
|
4779 break; |
|
4780 |
|
4781 case EPhoneDialerValidNumber: |
|
4782 { |
|
4783 TPhoneCmdParamBoolean command; |
|
4784 command.SetBoolean( EFalse ); |
|
4785 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetInvalidCsPhoneNumberFlag, &command ); |
|
4786 } |
|
4787 break; |
|
4788 |
|
4789 case EPhoneDialerInvalidNumber: |
|
4790 { |
|
4791 TPhoneCmdParamBoolean command; |
|
4792 command.SetBoolean( ETrue ); |
|
4793 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetInvalidCsPhoneNumberFlag, &command ); |
|
4794 } |
|
4795 break; |
|
4796 |
|
4797 case EPhoneCmdBlockingDialogLaunched: |
|
4798 { |
|
4799 TPhoneCmdParamBoolean param; |
|
4800 param.SetBoolean( ETrue ); |
|
4801 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetBlockingDialogStatus, ¶m ); |
|
4802 } |
|
4803 break; |
|
4804 |
|
4805 case EPhoneCmdBlockingDialogClosed: |
|
4806 { |
|
4807 TPhoneCmdParamBoolean param; |
|
4808 param.SetBoolean( EFalse ); |
|
4809 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetBlockingDialogStatus, ¶m ); |
|
4810 } |
|
4811 break; |
|
4812 |
|
4813 default: |
|
4814 break; |
|
4815 } |
|
4816 } |
|
4817 |
|
4818 // ----------------------------------------------------------- |
|
4819 // CPhoneState::ForwardPEMessageToPhoneCustomizationL |
|
4820 // Forward Phone Engine messages to Phone customization |
|
4821 // (other items were commented in a header). |
|
4822 // ----------------------------------------------------------- |
|
4823 // |
|
4824 EXPORT_C TBool CPhoneState::ForwardPEMessageToPhoneCustomizationL( |
|
4825 const TInt aMessage, |
|
4826 TInt aCallId ) |
|
4827 { |
|
4828 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ForwardPEMessageToPhoneCustomizationL() " ); |
|
4829 TBool handled = EFalse; |
|
4830 |
3779 |
4831 if ( iCustomization ) |
3780 |
4832 { |
3781 TPhoneCmdParamSfiData sfiDataParam; |
4833 handled = iCustomization->HandlePhoneEngineMessageL( aMessage, aCallId ); |
3782 |
4834 } |
3783 if (KErrNotFound != ringingCallId) |
4835 return handled; |
3784 { |
4836 } |
3785 if ( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ).Length() ) |
4837 |
3786 { |
4838 // ----------------------------------------------------------- |
3787 // store both the name and the number |
4839 // CPhoneState::SetLittleBubbleVisibilityL |
3788 sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
4840 // ----------------------------------------------------------- |
3789 sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) ); |
4841 // |
3790 } |
4842 void CPhoneState::SetLittleBubbleVisibilityL( |
3791 else |
4843 TPhoneCommandParam* aCommandParam) |
3792 { |
4844 { |
3793 // store the number |
4845 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetLittleBubbleVisibilityL() " ); |
3794 sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
4846 // If user has opened dtmfeditor(dtmfdialer) then do not make any changes |
3795 } |
4847 // to SetLittleBubbleVisible value. SetLittleBubbleVisible value is true by default. |
3796 } |
4848 if( !IsDTMFEditorVisibleL() ) |
3797 |
4849 { |
3798 iViewCommandHandle->ExecuteCommandL( |
4850 TPhoneCmdParamIncallIndicatorData* incallIndicatorParam = |
3799 EPhoneViewOpenSoftRejectEditor, &sfiDataParam ); |
4851 static_cast<TPhoneCmdParamIncallIndicatorData*>( aCommandParam ); |
|
4852 TInt activeCallId = GetActiveCallIdL(); |
|
4853 switch( incallIndicatorParam->CallState() ) |
|
4854 { |
|
4855 case EPSCTsyCallStateRinging: |
|
4856 case EPSCTsyCallStateDialling: |
|
4857 { |
|
4858 // If we have single ringing or dialling call then it is ok |
|
4859 // to set visibility to false. |
|
4860 if ( activeCallId < KErrNone ) |
|
4861 { |
|
4862 incallIndicatorParam->SetLittleBubbleVisible( EFalse ); |
|
4863 } |
|
4864 } |
|
4865 break; |
|
4866 default: |
|
4867 incallIndicatorParam->SetLittleBubbleVisible( ETrue ); |
|
4868 break; |
|
4869 } |
|
4870 } |
|
4871 } |
|
4872 |
|
4873 // ----------------------------------------------------------- |
|
4874 // CPhoneState::DisplayCallSetupL |
|
4875 // ----------------------------------------------------------- |
|
4876 // |
|
4877 EXPORT_C void CPhoneState::DisplayCallSetupL( TInt aCallId ) |
|
4878 { |
|
4879 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::DisplayCallSetupL() "); |
|
4880 BeginTransEffectLC( ECallUiAppear ); |
|
4881 BeginUiUpdateLC(); |
|
4882 SetNumberEntryVisibilityL( EFalse ); |
|
4883 CaptureKeysDuringCallNotificationL( ETrue ); |
|
4884 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
4885 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
4886 TPhoneCmdParamInteger uidParam; |
|
4887 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
4888 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
4889 &uidParam ); |
|
4890 // Do state-specific operations. |
|
4891 DoStateSpecificCallSetUpDefinitionsL(); |
|
4892 DisplayHeaderForOutgoingCallL(aCallId); |
|
4893 EndUiUpdate(); |
|
4894 EndTransEffect(); |
|
4895 iCbaManager->UpdateCbaL(EPhoneCallHandlingCallSetupCBA); |
|
4896 } |
|
4897 |
|
4898 // ----------------------------------------------------------- |
|
4899 // Sends command to viewcontroller to store the flag |
|
4900 // ----------------------------------------------------------- |
|
4901 // |
|
4902 EXPORT_C void CPhoneState::SetNeedToReturnToForegroundAppStatusL( |
|
4903 TBool aNeedToReturn ) |
|
4904 { |
|
4905 TPhoneCmdParamBoolean booleanParam; |
|
4906 booleanParam.SetBoolean( aNeedToReturn ); |
|
4907 iViewCommandHandle->ExecuteCommandL( |
|
4908 EPhoneViewSetNeedToReturnToForegroundAppStatus, |
|
4909 &booleanParam ); |
|
4910 } |
|
4911 |
|
4912 // ----------------------------------------------------------- |
|
4913 // CPhoneState::DoStateSpecificCallSetUpDefinitionsL |
|
4914 // ----------------------------------------------------------- |
|
4915 // |
|
4916 EXPORT_C void CPhoneState::DoStateSpecificCallSetUpDefinitionsL() |
|
4917 { |
|
4918 // do nothing |
|
4919 } |
|
4920 |
|
4921 // ----------------------------------------------------------- |
|
4922 // CPhoneState::CloseClearNumberEntryAndLoadEffect |
|
4923 // ----------------------------------------------------------- |
|
4924 // |
|
4925 EXPORT_C void CPhoneState::CloseClearNumberEntryAndLoadEffectL( |
|
4926 TStateTransEffectType aType ) |
|
4927 { |
|
4928 __LOGMETHODSTARTEND( EPhoneControl, |
|
4929 "CPhoneState::CloseClearNumberEntryAndLoadEffectL() "); |
|
4930 BeginTransEffectLC( aType ); |
|
4931 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
4932 EndTransEffect(); |
|
4933 // Do state-specific operation when number entry is cleared |
|
4934 HandleNumberEntryClearedL(); |
|
4935 } |
3800 } |
4936 |
3801 |
4937 // End of File |
3802 // End of File |
4938 |
3803 |