169 case EKeyNo: |
169 case EKeyNo: |
170 HandleEndKeyPressL( aMessage ); |
170 HandleEndKeyPressL( aMessage ); |
171 break; |
171 break; |
172 // send-key |
172 // send-key |
173 case EKeyYes: |
173 case EKeyYes: |
174 if ( IsNumberEntryUsedL() ) |
174 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
175 { |
175 { |
176 TPhoneCmdParamBoolean isSecurityMode; |
176 TPhoneCmdParamBoolean isSecurityMode; |
177 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
177 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
178 |
178 |
179 TPhoneCmdParamInteger numberEntryCountParam; |
179 TPhoneCmdParamInteger numberEntryCountParam; |
180 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
180 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
181 &numberEntryCountParam ); |
181 &numberEntryCountParam ); |
182 |
182 |
183 TInt neLength( numberEntryCountParam.Integer() ); |
183 TInt neLength( numberEntryCountParam.Integer() ); |
184 if ( IsAnyQueryActiveL() ) |
184 if ( neLength == 0 && !isSecurityMode.Boolean()) |
185 { |
|
186 return; |
|
187 } |
|
188 else if ( neLength == 0 && !isSecurityMode.Boolean()) |
|
189 { |
185 { |
190 // start logs |
186 // start logs |
191 iViewCommandHandle->HandleCommandL( |
187 iViewCommandHandle->HandleCommandL( |
192 EPhoneDialerCmdLog ); |
188 EPhoneDialerCmdLog ); |
193 return; |
189 return; |
257 break; |
253 break; |
258 |
254 |
259 case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
255 case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
260 // Note that after the sending of SS |
256 // Note that after the sending of SS |
261 // strings the view stays in Dialer. |
257 // strings the view stays in Dialer. |
262 if ( IsNumberEntryUsedL() ) |
258 if ( !iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue ) ) |
263 { |
259 { |
264 // Show the number entry if it exists |
260 RemoveDialogsAndSendPhoneToBackgroundL(); |
265 SetNumberEntryVisibilityL(ETrue); |
|
266 } |
|
267 else if ( NeedToSendToBackgroundL() ) |
|
268 { |
|
269 // Continue displaying current app but set up the |
|
270 // idle screen in the background |
|
271 SetupIdleScreenInBackgroundL(); |
|
272 } |
|
273 else |
|
274 { |
|
275 // Display idle screen |
|
276 DisplayIdleScreenL(); |
|
277 } |
261 } |
278 break; |
262 break; |
279 |
263 |
280 case MEngineMonitor::EPEMessageIdle: |
264 case MEngineMonitor::EPEMessageIdle: |
281 HandleIdleL( aCallId ); |
265 HandleIdleL( aCallId ); |
304 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
288 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
305 { |
289 { |
306 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
290 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
307 HandleAudioAvailableOutputChangedL(); |
291 HandleAudioAvailableOutputChangedL(); |
308 SetRingingTonePlaybackL( aCallId ); |
292 SetRingingTonePlaybackL( aCallId ); |
|
293 |
309 BeginUiUpdateLC(); |
294 BeginUiUpdateLC(); |
310 |
295 iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse); |
311 if ( IsNumberEntryUsedL() ) |
|
312 { |
|
313 SetNumberEntryVisibilityL(EFalse); |
|
314 } |
|
315 |
|
316 DisplayIncomingCallL( aCallId ); |
296 DisplayIncomingCallL( aCallId ); |
317 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
318 CheckDisableHWKeysAndCallUIL(); |
|
319 SetBackButtonActive(EFalse); |
297 SetBackButtonActive(EFalse); |
|
298 UpdateUiCommands(); |
320 EndUiUpdate(); |
299 EndUiUpdate(); |
321 |
300 |
322 iCbaManager->UpdateIncomingCbaL( aCallId ); |
301 ChangeTo( EPhoneStateIncoming ); |
323 iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
302 } |
324 iStateMachine->ChangeState( EPhoneStateIncoming ); |
303 |
325 SetDivertIndication( EFalse ); |
304 // ----------------------------------------------------------- |
326 } |
305 // CPhoneStateIdle::HandleDialingL |
327 |
|
328 // ----------------------------------------------------------- |
|
329 // CPhoneStateIdle::HandleDiallingL |
|
330 // Default handling for dialling message |
306 // Default handling for dialling message |
331 // (other items were commented in a header). |
307 // (other items were commented in a header). |
332 // ----------------------------------------------------------- |
308 // ----------------------------------------------------------- |
333 // |
309 // |
334 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
310 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
335 { |
311 { |
336 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
312 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
337 BeginUiUpdateLC(); |
313 TPhoneCmdParamKeyCapture captureParam; |
338 DisplayCallSetupL( aCallId ); |
314 captureParam.SetKeyCode( EKeyNo ); |
339 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
315 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
340 EndUiUpdate(); |
316 DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
341 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
317 SetToolbarButtonLoudspeakerEnabled(); |
342 iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
318 ChangeTo( EPhoneStateCallSetup ); |
343 iStateMachine->ChangeState( EPhoneStateCallSetup ); |
|
344 } |
319 } |
345 |
320 |
346 // ----------------------------------------------------------- |
321 // ----------------------------------------------------------- |
347 // CPhoneStateIdle::HandleConnectedL |
322 // CPhoneStateIdle::HandleConnectedL |
348 // Message Handling function for message EPEMessageConnected |
323 // Message Handling function for message EPEMessageConnected |
354 // ----------------------------------------------------------- |
329 // ----------------------------------------------------------- |
355 // |
330 // |
356 void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
331 void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
357 { |
332 { |
358 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
333 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
359 // Keep Phone app in the foreground if it is external |
|
360 if ( !TopAppIsDisplayedL() ) |
|
361 { |
|
362 TPhoneCmdParamInteger uidParam; |
|
363 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
364 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
365 &uidParam ); |
|
366 } |
|
367 BeginUiUpdateLC(); |
334 BeginUiUpdateLC(); |
368 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
335 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
369 DisplayCallSetupL( aCallId ); |
336 DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
370 UpdateSingleActiveCallL( aCallId ); |
337 UpdateSingleActiveCallL( aCallId ); |
371 SetTouchPaneButtons( EPhoneIncallButtons ); |
338 UpdateUiCommands(); |
372 EndUiUpdate(); |
339 EndUiUpdate(); |
373 |
340 ChangeTo( EPhoneStateSingle ); |
374 iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
375 iStateMachine->ChangeState( EPhoneStateSingle ); |
|
376 } |
341 } |
377 |
342 |
378 // ----------------------------------------------------------- |
343 // ----------------------------------------------------------- |
379 // CPhoneStateIdle::HandleCommandL |
344 // CPhoneStateIdle::HandleCommandL |
380 // ----------------------------------------------------------- |
345 // ----------------------------------------------------------- |
505 |
470 |
506 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
471 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
507 TPhoneCmdParamKeyCapture captureParam; |
472 TPhoneCmdParamKeyCapture captureParam; |
508 captureParam.SetKeyCode( EKeyNo ); |
473 captureParam.SetKeyCode( EKeyNo ); |
509 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
474 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
510 |
475 |
511 // Indicate that the Phone needs to be sent to the background if |
476 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
512 // an application other than the top application is in the foreground |
477 |
513 TPhoneCmdParamBoolean booleanParam; |
|
514 booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
515 iViewCommandHandle->ExecuteCommandL( |
|
516 EPhoneViewSetNeedToSendToBackgroundStatus, |
|
517 &booleanParam ); |
|
518 |
|
519 TPhoneCmdParamInteger uidParam; |
|
520 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
521 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
522 &uidParam ); |
|
523 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
524 &uidParam ); |
|
525 |
|
526 // Disable global notes when there is an incoming call |
478 // Disable global notes when there is an incoming call |
527 TPhoneCmdParamBoolean globalNotifierParam; |
479 TPhoneCmdParamBoolean globalNotifierParam; |
528 globalNotifierParam.SetBoolean( ETrue ); |
480 globalNotifierParam.SetBoolean( ETrue ); |
529 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
481 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
530 &globalNotifierParam ); |
482 &globalNotifierParam ); |
531 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
483 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
532 &globalNotifierParam ); |
484 &globalNotifierParam ); |
533 DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
485 iViewCommandHandle->ExecuteCommandL(EPhoneViewCreateCallHeader, aCallId); |
534 } |
|
535 |
|
536 // ----------------------------------------------------------- |
|
537 // CPhoneStateIdle::DisplayCallSetupL |
|
538 // ----------------------------------------------------------- |
|
539 // |
|
540 EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId ) |
|
541 { |
|
542 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) "); |
|
543 __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
544 |
|
545 TPhoneCmdParamKeyCapture captureParam; |
|
546 captureParam.SetKeyCode( EKeyNo ); |
|
547 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
548 |
|
549 // Indicate that the Phone needs to be sent to the background if |
|
550 // an application other than the top application is in the foreground |
|
551 TPhoneCmdParamBoolean booleanParam; |
|
552 booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
553 iViewCommandHandle->ExecuteCommandL( |
|
554 EPhoneViewSetNeedToSendToBackgroundStatus, |
|
555 &booleanParam ); |
|
556 |
|
557 // Bring Phone app in the foreground |
|
558 TPhoneCmdParamInteger uidParam; |
|
559 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
560 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
561 &uidParam ); |
|
562 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
563 &uidParam ); |
|
564 |
|
565 DisplayHeaderForOutgoingCallL( aCallId ); |
|
566 } |
486 } |
567 |
487 |
568 // ----------------------------------------------------------- |
488 // ----------------------------------------------------------- |
569 // CPhoneStateIdle::HandleIdleForegroundEventL |
489 // CPhoneStateIdle::HandleIdleForegroundEventL |
570 // ----------------------------------------------------------- |
490 // ----------------------------------------------------------- |
571 // |
491 // |
572 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
492 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
573 { |
493 { |
574 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
494 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
575 if ( IsNumberEntryUsedL() ) |
495 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
576 { |
|
577 if ( IsNumberEntryVisibleL() ) |
|
578 { |
|
579 iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
|
580 } |
|
581 } |
|
582 else if ( !IsAnyQueryActiveL() ) |
|
583 { |
|
584 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
585 } |
|
586 } |
496 } |
587 |
497 |
588 // ----------------------------------------------------------- |
498 // ----------------------------------------------------------- |
589 // CPhoneStateIdle::HandlePhoneForegroundEventL |
499 // CPhoneStateIdle::HandlePhoneForegroundEventL |
590 // ----------------------------------------------------------- |
500 // ----------------------------------------------------------- |
635 // ----------------------------------------------------------- |
545 // ----------------------------------------------------------- |
636 // |
546 // |
637 void CPhoneStateIdle::SendExitCommandL() |
547 void CPhoneStateIdle::SendExitCommandL() |
638 { |
548 { |
639 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
549 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
640 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
550 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
641 |
551 // Simulate exit command |
642 // Simulate exit command |
552 RWsSession& wsSession = EikonEnv()->WsSession(); |
643 CEikonEnv& eikEnv = *CEikonEnv::Static(); |
553 TKeyEvent keyEvent; |
644 CCoeEnv& coeEnv = eikEnv; |
554 keyEvent.iCode = EEikCmdExit; |
645 RWsSession& wsSession=coeEnv.WsSession(); |
555 keyEvent.iScanCode = EEikCmdExit; |
646 TKeyEvent keyEvent; |
556 keyEvent.iModifiers = 0; |
647 keyEvent.iCode = EEikCmdExit; |
557 keyEvent.iRepeats = 0; |
648 keyEvent.iScanCode = EEikCmdExit; |
558 wsSession.SimulateKeyEvent( keyEvent ); |
649 keyEvent.iModifiers = 0; |
559 wsSession.Flush(); |
650 keyEvent.iRepeats = 0; |
|
651 wsSession.SimulateKeyEvent( keyEvent ); |
|
652 wsSession.Flush(); |
|
653 |
560 |
654 iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
561 iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
655 } |
562 } |
656 |
563 |
657 // ----------------------------------------------------------- |
564 // ----------------------------------------------------------- |
663 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
570 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
664 // End key not handled also in phone startup when pressed during country/time/date query |
571 // End key not handled also in phone startup when pressed during country/time/date query |
665 RWsSession sess = CCoeEnv::Static()->WsSession(); |
572 RWsSession sess = CCoeEnv::Static()->WsSession(); |
666 TApaTaskList appList( sess ); |
573 TApaTaskList appList( sess ); |
667 TApaTask startup = appList.FindApp( KUidStartupApplication ); |
574 TApaTask startup = appList.FindApp( KUidStartupApplication ); |
668 if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() ) |
575 if ( !IsAutoLockOn() && !startup.Exists() ) |
669 { |
576 { |
670 //Cancels e.g. USB notifier and Audio notifier. |
577 //Cancels e.g. USB notifier and Audio notifier. |
671 iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
578 iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
672 // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
579 // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
673 // remove security note from screen. |
580 // remove security note from screen. |
681 { |
588 { |
682 if ( aMessage == EPhoneKeyLongPress ) |
589 if ( aMessage == EPhoneKeyLongPress ) |
683 { |
590 { |
684 iStateMachine->SendPhoneEngineMessage( |
591 iStateMachine->SendPhoneEngineMessage( |
685 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
592 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
686 if ( IsNumberEntryUsedL() ) |
593 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
687 { |
594 { |
688 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
595 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
689 // Do state-specific operation when number entry is cleared |
596 // Do state-specific operation when number entry is cleared |
690 HandleNumberEntryClearedL(); |
597 HandleNumberEntryClearedL(); |
691 // If long end key event occures then all calls are terminated and |
598 // If long end key event occures then all calls are terminated and |
692 // dialer is closed, therefore tel.icon must be removed from FSW. |
599 // dialer is closed, therefore tel.icon must be removed from FSW. |
693 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
600 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
694 } |
601 } |
695 if ( !TopAppIsDisplayedL() ) |
|
696 { |
|
697 DisplayIdleScreenL(); |
|
698 } |
|
699 } |
602 } |
700 else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
603 else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
701 { |
604 { |
702 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
605 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
703 // Do state-specific operation when number entry is cleared |
606 // Do state-specific operation when number entry is cleared |
704 HandleNumberEntryClearedL(); |
607 HandleNumberEntryClearedL(); |
705 } |
608 } |
706 else if ( !TopAppIsDisplayedL() ) |
609 } |
707 { |
610 else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
708 // Phone might not be the topmost app since it has |
|
709 // some dialog/query open therefore we need to check this |
|
710 // and remove dialog/phone. |
|
711 if ( IsAnyQueryActiveL() ) |
|
712 { |
|
713 if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
714 { |
|
715 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
716 } |
|
717 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
718 } |
|
719 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
720 } |
|
721 } |
|
722 else if ( IsNumberEntryUsedL() ) |
|
723 { |
611 { |
724 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
612 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
725 StartShowSecurityNoteL(); |
613 StartShowSecurityNoteL(); |
726 } |
614 } |
727 } |
615 } |