19 // INCLUDES |
19 // INCLUDES |
20 #include <featmgr.h> |
20 #include <featmgr.h> |
21 #include <StringLoader.h> |
21 #include <StringLoader.h> |
22 #include <PSVariables.h> |
22 #include <PSVariables.h> |
23 #include <hwrmdomainpskeys.h> |
23 #include <hwrmdomainpskeys.h> |
24 #include <UikonInternalPSKeys.h> |
|
25 #include <mpeengineinfo.h> |
24 #include <mpeengineinfo.h> |
26 #include <videotelcontrolmediatorapi.h> |
25 #include <videotelcontrolmediatorapi.h> |
27 #include <MediatorDomainUIDs.h> |
26 #include <MediatorDomainUIDs.h> |
28 #include <bldvariant.hrh> |
27 #include <bldvariant.hrh> |
29 |
28 |
154 EXPORT_C void CPhoneStateInCall::HandleNumberEntryClearedL() |
153 EXPORT_C void CPhoneStateInCall::HandleNumberEntryClearedL() |
155 { |
154 { |
156 __LOGMETHODSTARTEND(EPhoneControl, |
155 __LOGMETHODSTARTEND(EPhoneControl, |
157 "CPhoneStateInCall::HandleNumberEntryClearedL()" ); |
156 "CPhoneStateInCall::HandleNumberEntryClearedL()" ); |
158 // Update single call CBA when number entry is cleared |
157 // Update single call CBA when number entry is cleared |
159 UpdateInCallCbaL(); |
158 UpdateUiCommands(); |
160 } |
159 } |
161 |
160 |
162 // ----------------------------------------------------------- |
161 // ----------------------------------------------------------- |
163 // CPhoneStateInCall::HandlePhoneEngineMessageL |
162 // CPhoneStateInCall::HandlePhoneEngineMessageL |
164 // ----------------------------------------------------------- |
163 // ----------------------------------------------------------- |
218 // If there is a waiting call then update header and label |
217 // If there is a waiting call then update header and label |
219 // else forward message to CPhoneState. |
218 // else forward message to CPhoneState. |
220 if ( IsWaitingCallL( aCallId ) ) |
219 if ( IsWaitingCallL( aCallId ) ) |
221 { |
220 { |
222 // Update remote info data and label. |
221 // Update remote info data and label. |
223 UpdateRemoteInfoDataAndLabelL( aCallId, UpdateCallHeaderInfoL( aCallId ) ); |
222 UpdateRemoteInfoDataAndLabelL( aCallId ); |
224 } |
223 } |
225 else |
224 else |
226 { |
225 { |
227 CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
226 CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
228 } |
227 } |
237 // ----------------------------------------------------------- |
236 // ----------------------------------------------------------- |
238 // CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL |
237 // CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL |
239 // ----------------------------------------------------------- |
238 // ----------------------------------------------------------- |
240 // |
239 // |
241 void CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL( |
240 void CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL( |
242 TInt aCallId, |
241 TInt aCallId ) |
243 TPhoneCmdParamCallHeaderData aCallHeaderParam ) |
|
244 { |
242 { |
245 __LOGMETHODSTARTEND(EPhoneControl, |
243 __LOGMETHODSTARTEND(EPhoneControl, |
246 "CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL ()" ); |
244 "CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL ()" ); |
247 iViewCommandHandle->ExecuteCommandL( |
245 iViewCommandHandle->ExecuteCommandL( |
248 EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, |
246 EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, |
249 aCallId, |
247 aCallId ); |
250 &aCallHeaderParam ); |
|
251 } |
248 } |
252 |
249 |
253 // ----------------------------------------------------------- |
250 // ----------------------------------------------------------- |
254 // CPhoneStateInCall::HandleIdleL |
251 // CPhoneStateInCall::HandleIdleL |
255 // ----------------------------------------------------------- |
252 // ----------------------------------------------------------- |
261 TBool showDialer( EFalse ); |
258 TBool showDialer( EFalse ); |
262 HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
259 HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
263 TPtr ptr( phoneNumber->Des() ); |
260 TPtr ptr( phoneNumber->Des() ); |
264 TPhoneCmdParamString stringParam; |
261 TPhoneCmdParamString stringParam; |
265 stringParam.SetString( &ptr ); |
262 stringParam.SetString( &ptr ); |
266 |
263 |
267 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
268 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
|
269 |
264 |
270 BeginUiUpdateLC(); |
265 BeginUiUpdateLC(); |
271 SetDefaultFlagsL(); |
266 SetDefaultFlagsL(); |
272 if ( IsNumberEntryUsedL() ) |
267 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
268 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
|
269 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
273 { |
270 { |
274 iViewCommandHandle->ExecuteCommand( |
271 iViewCommandHandle->ExecuteCommand( |
275 EPhoneViewGetNumberFromEntry, |
272 EPhoneViewGetNumberFromEntry, |
276 &stringParam ); |
273 &stringParam ); |
277 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
274 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
278 showDialer = ETrue; |
275 showDialer = ETrue; |
279 } |
276 } |
280 |
277 |
281 if ( !TopAppIsDisplayedL() || IsAutoLockOn() ) |
278 if ( IsAutoLockOn() || !showDialer ) |
282 { |
279 { |
283 // Continue displaying current app but set up the |
280 RemoveDialogsAndSendPhoneToBackgroundL(); |
284 // idle screen in the background |
|
285 SetupIdleScreenInBackgroundL(); |
|
286 } |
281 } |
287 else if ( showDialer ) |
282 else if ( showDialer ) |
288 { |
283 { |
289 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
284 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
290 } |
|
291 else |
|
292 { |
|
293 DisplayIdleScreenL(); |
|
294 } |
285 } |
295 |
286 |
296 DeleteTouchPaneButtons(); |
287 DeleteTouchPaneButtons(); |
297 EndUiUpdate(); |
288 EndUiUpdate(); |
298 DisplayCallTerminationNoteL(); |
289 DisplayCallTerminationNoteL(); |
303 CleanupStack::PopAndDestroy( phoneNumber ); |
294 CleanupStack::PopAndDestroy( phoneNumber ); |
304 iStateMachine->ChangeState( EPhoneStateIdle ); |
295 iStateMachine->ChangeState( EPhoneStateIdle ); |
305 } |
296 } |
306 |
297 |
307 // ----------------------------------------------------------- |
298 // ----------------------------------------------------------- |
308 // CPhoneStateInCall::UpdateInCallCbaL |
|
309 // ----------------------------------------------------------- |
|
310 // |
|
311 EXPORT_C void CPhoneStateInCall::UpdateInCallCbaL() |
|
312 { |
|
313 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateInCallCbaL() "); |
|
314 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
315 } |
|
316 |
|
317 // ----------------------------------------------------------- |
|
318 // CPhoneStateInCall::UpdateCbaL |
|
319 // ----------------------------------------------------------- |
|
320 // |
|
321 EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource ) |
|
322 { |
|
323 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() "); |
|
324 iCbaManager->UpdateCbaL( aResource ); |
|
325 } |
|
326 |
|
327 // ----------------------------------------------------------- |
|
328 // CPhoneStateInCall::HandleAudioMuteChangedL |
299 // CPhoneStateInCall::HandleAudioMuteChangedL |
329 // ----------------------------------------------------------- |
300 // ----------------------------------------------------------- |
330 // |
301 // |
331 void CPhoneStateInCall::HandleAudioMuteChangedL() |
302 void CPhoneStateInCall::HandleAudioMuteChangedL() |
332 { |
303 { |
333 __LOGMETHODSTARTEND(EPhoneControl, |
304 __LOGMETHODSTARTEND(EPhoneControl, |
334 "CPhoneStateInCall::HandleAudioMuteChangedL()" ); |
305 "CPhoneStateInCall::HandleAudioMuteChangedL()" ); |
335 CPhoneState::HandleAudioMuteChangedL(); |
306 CPhoneState::HandleAudioMuteChangedL(); |
336 // Update the single call CBA only if the number entry is not |
307 UpdateUiCommands(); |
337 // used |
|
338 if ( !IsNumberEntryUsedL() ) |
|
339 { |
|
340 // Go to current state implementation |
|
341 UpdateInCallCbaL(); |
|
342 } |
|
343 } |
308 } |
344 |
309 |
345 // ----------------------------------------------------------- |
310 // ----------------------------------------------------------- |
346 // CPhoneStateInCall::HandleAudioOutputChangedL |
311 // CPhoneStateInCall::HandleAudioOutputChangedL |
347 // ----------------------------------------------------------- |
312 // ----------------------------------------------------------- |
348 // |
313 // |
349 void CPhoneStateInCall::HandleAudioOutputChangedL() |
314 void CPhoneStateInCall::HandleAudioOutputChangedL() |
350 { |
315 { |
351 __LOGMETHODSTARTEND(EPhoneControl, |
316 __LOGMETHODSTARTEND(EPhoneControl, |
352 "CPhoneStateInCall::HandleAudioOutputChangedL()" ); |
317 "CPhoneStateInCall::HandleAudioOutputChangedL()" ); |
353 CPhoneState::HandleAudioOutputChangedL(); |
318 CPhoneState::HandleAudioOutputChangedL(); |
354 |
319 UpdateUiCommands(); |
355 UpdateInCallCbaL(); |
|
356 |
|
357 SetTouchPaneButtons(0); |
|
358 } |
320 } |
359 |
321 |
360 // ----------------------------------------------------------- |
322 // ----------------------------------------------------------- |
361 // CPhoneStateInCall::HandleAudioVolumeChangedL |
323 // CPhoneStateInCall::HandleAudioVolumeChangedL |
362 // ----------------------------------------------------------- |
324 // ----------------------------------------------------------- |
553 if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
515 if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
554 phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
516 phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
555 { |
517 { |
556 // Send a manual control sequence by providing number |
518 // Send a manual control sequence by providing number |
557 // information with dial command |
519 // information with dial command |
558 CallFromNumberEntryL(); |
520 iNumberEntryManager->CallFromNumberEntryL(); |
559 } |
521 } |
560 else |
522 else |
561 { |
523 { |
562 iStateMachine->SendPhoneEngineMessage( |
524 iStateMachine->SendPhoneEngineMessage( |
563 MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
525 MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
564 } |
526 } |
565 CleanupStack::PopAndDestroy( phoneNumber ); |
527 CleanupStack::PopAndDestroy( phoneNumber ); |
566 } |
528 } |
567 else |
529 else |
568 { |
530 { |
569 CallFromNumberEntryL(); |
531 iNumberEntryManager->CallFromNumberEntryL(); |
570 } |
532 } |
571 break; |
533 break; |
572 |
534 |
573 case EPhoneCmdEnd: |
535 case EPhoneCmdEnd: |
574 CPhoneState::DisconnectCallL(); |
536 CPhoneState::DisconnectCallL(); |
589 break; |
551 break; |
590 |
552 |
591 case EPhoneNumberAcqCmdVideoCall: |
553 case EPhoneNumberAcqCmdVideoCall: |
592 {// Create normal voice call, if number is emergency number. |
554 {// Create normal voice call, if number is emergency number. |
593 // Get the number entry contents |
555 // Get the number entry contents |
594 HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
556 HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
595 iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
557 iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
596 iStateMachine->SendPhoneEngineMessage( |
558 iStateMachine->SendPhoneEngineMessage( |
597 MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
559 MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
598 CleanupStack::PopAndDestroy( phoneNumber );} |
560 CleanupStack::PopAndDestroy( phoneNumber );} |
599 break; |
561 break; |
600 |
|
601 case EPhoneInCallCmdLockKeypad: |
|
602 case EPhoneInCallCmdLockScreen: |
|
603 LockKeypadL(); |
|
604 break; |
|
605 |
562 |
606 case EPhoneViewOpenCallHandling: |
563 case EPhoneViewOpenCallHandling: |
607 if ( IsNumberEntryUsedL() ) |
564 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
608 { |
565 { |
609 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
566 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
610 HandleNumberEntryClearedL(); |
567 HandleNumberEntryClearedL(); |
611 } |
568 } |
612 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
569 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
613 break; |
570 break; |
614 |
571 |
615 case EPhoneInCallCmdNewCallFind: |
|
616 case EPhoneInCallCmdNewCall: |
572 case EPhoneInCallCmdNewCall: |
617 case EPhoneInCallCmdDtmfListViewSearch: |
|
618 case EPhoneInCallCmdDtmfManualQuery: |
573 case EPhoneInCallCmdDtmfManualQuery: |
619 case EPhoneCmdDtmfSearch: |
|
620 case EPhoneDtmfDialerExit: |
574 case EPhoneDtmfDialerExit: |
621 case EPhoneCmdOptions: |
575 case EPhoneCmdOptions: |
622 break; |
576 break; |
623 |
577 |
624 default: |
578 default: |
842 { |
793 { |
843 __PHONELOG( EOnlyFatal, EPhoneControl, |
794 __PHONELOG( EOnlyFatal, EPhoneControl, |
844 "CPhoneStateInCall::DisconnectOutgoingCallL() has negative call id!" ); |
795 "CPhoneStateInCall::DisconnectOutgoingCallL() has negative call id!" ); |
845 __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) ); |
796 __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) ); |
846 } |
797 } |
847 } |
|
848 |
|
849 // ----------------------------------------------------------------------------- |
|
850 // CPhoneStateInCall::LockKeysL |
|
851 // ----------------------------------------------------------------------------- |
|
852 // |
|
853 void CPhoneStateInCall::LockKeypadL() |
|
854 { |
|
855 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::LockKeypadL()"); |
|
856 TInt state = EPSHWRMGripStatusUninitialized; |
|
857 if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) ) |
|
858 { |
|
859 TInt err = RProperty::Get( KPSUidHWRM, KHWRMGripStatus, state ); |
|
860 if ( state == EPSHWRMGripOpen ) |
|
861 { |
|
862 SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
|
863 } |
|
864 } |
|
865 |
|
866 if ( state != EPSHWRMGripOpen ) |
|
867 { |
|
868 iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock ); |
|
869 } |
|
870 } |
798 } |
871 |
799 |
872 // ----------------------------------------------------------------------------- |
800 // ----------------------------------------------------------------------------- |
873 // CPhoneStateInCall::HandleEndKeyPressL |
801 // CPhoneStateInCall::HandleEndKeyPressL |
874 // ----------------------------------------------------------------------------- |
802 // ----------------------------------------------------------------------------- |
898 } |
826 } |
899 else |
827 else |
900 { |
828 { |
901 iStateMachine->SendPhoneEngineMessage( |
829 iStateMachine->SendPhoneEngineMessage( |
902 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
830 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
903 if ( IsNumberEntryContentStored() ) |
831 iNumberEntryManager->ClearNumberEntryContentCacheIfContentStored(); |
904 { |
|
905 ClearNumberEntryContentCache(); |
|
906 } |
|
907 } |
832 } |
908 |
833 |
909 if ( IsNumberEntryUsedL() ) |
834 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
910 { |
835 { |
911 iViewCommandHandle->ExecuteCommandL( |
836 iViewCommandHandle->ExecuteCommandL( |
912 EPhoneViewRemoveNumberEntry ); |
837 EPhoneViewRemoveNumberEntry ); |
913 // Do state-specific operation when number entry is cleared |
838 // Do state-specific operation when number entry is cleared |
914 HandleNumberEntryClearedL(); |
839 HandleNumberEntryClearedL(); |
915 } |
|
916 |
|
917 if ( !TopAppIsDisplayedL() ) |
|
918 { |
|
919 TPhoneCmdParamInteger uidParam; |
|
920 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
921 iViewCommandHandle->ExecuteCommandL( |
|
922 EPhoneViewBringAppToForeground, &uidParam ); |
|
923 } |
840 } |
924 } |
841 } |
925 else |
842 else |
926 { |
843 { |
927 // handle short end key |
844 // handle short end key |