132 CPhoneState::SendGlobalErrorNoteL( |
131 CPhoneState::SendGlobalErrorNoteL( |
133 EPhoneNoteTextNotAllowed, ETrue ); |
132 EPhoneNoteTextNotAllowed, ETrue ); |
134 } |
133 } |
135 break; |
134 break; |
136 |
135 |
137 // end-key |
136 case EKeyNo: // end-key |
138 case EKeyNo: |
|
139 if ( aMessage == EPhoneKeyLongPress ) |
137 if ( aMessage == EPhoneKeyLongPress ) |
140 { |
138 { |
141 // Close all connections |
|
142 iStateMachine->SendPhoneEngineMessage( |
139 iStateMachine->SendPhoneEngineMessage( |
143 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
140 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
144 |
141 |
145 if ( IsNumberEntryContentStored() ) |
142 if ( IsNumberEntryContentStored() ) |
146 { |
143 { |
147 ClearNumberEntryContentCache(); |
144 ClearNumberEntryContentCache(); |
148 } |
145 } |
149 |
146 |
150 if ( CPhoneState::IsNumberEntryUsedL() ) |
147 if ( CPhoneState::IsNumberEntryUsedL() ) |
151 { |
148 { |
152 // Remove number entry from screen |
|
153 iViewCommandHandle->ExecuteCommandL( |
149 iViewCommandHandle->ExecuteCommandL( |
154 EPhoneViewRemoveNumberEntry ); |
150 EPhoneViewRemoveNumberEntry ); |
155 // Do state-specific operation when number entry is cleared |
151 // Do state-specific operation when number entry is cleared |
156 HandleNumberEntryClearedL(); |
152 HandleNumberEntryClearedL(); |
157 } |
153 } |
158 if ( !TopAppIsDisplayedL() ) |
154 if ( !TopAppIsDisplayedL() ) |
159 { |
155 { |
160 // Bring app to foreground |
|
161 TPhoneCmdParamInteger uidParam; |
156 TPhoneCmdParamInteger uidParam; |
162 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
157 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
163 iViewCommandHandle->ExecuteCommandL( |
158 iViewCommandHandle->ExecuteCommandL( |
164 EPhoneViewBringAppToForeground, &uidParam ); |
159 EPhoneViewBringAppToForeground, &uidParam ); |
165 } |
160 } |
166 } |
161 } |
167 else |
162 else // handle short end key |
168 { |
163 { |
169 // handle end key |
164 DisconnectOutgoingCallL(); |
170 DisconnectOutgoingCallL(); |
|
171 } |
165 } |
172 break; |
166 break; |
173 |
167 |
174 default: |
168 default: |
175 // do base operation |
|
176 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
169 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
177 break; |
170 break; |
178 } |
171 } |
179 } |
172 } |
180 |
173 |
199 break; |
192 break; |
200 |
193 |
201 case MEngineMonitor::EPEMessageIdle: |
194 case MEngineMonitor::EPEMessageIdle: |
202 HandleIdleL( aCallId ); |
195 HandleIdleL( aCallId ); |
203 break; |
196 break; |
204 |
197 |
205 case MEngineMonitor::EPEMessageRemoteBusy: |
|
206 // If call setup failed then stop capturing keys. |
|
207 CaptureKeysDuringCallNotificationL( EFalse ); |
|
208 CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
209 break; |
|
210 default: |
198 default: |
211 CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
199 CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
212 break; |
200 break; |
213 } |
201 } |
214 } |
202 } |
215 |
203 |
216 |
|
217 // ----------------------------------------------------------- |
204 // ----------------------------------------------------------- |
218 // CPhoneSingleAndCallSetupAndWaiting:HandleCommandL |
205 // CPhoneSingleAndCallSetupAndWaiting:HandleCommandL |
219 // ----------------------------------------------------------- |
206 // ----------------------------------------------------------- |
220 // |
207 // |
221 TBool CPhoneSingleAndCallSetupAndWaiting::HandleCommandL( TInt aCommand ) |
208 TBool CPhoneSingleAndCallSetupAndWaiting::HandleCommandL( TInt aCommand ) |
222 { |
209 { |
223 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleCommandL() "); |
210 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleCommandL() "); |
224 TBool commandStatus = ETrue; |
211 TBool commandStatus = ETrue; |
225 |
|
226 switch( aCommand ) |
212 switch( aCommand ) |
227 { |
213 { |
228 // 'End active call' from menu |
|
229 case EPhoneInCallCmdEndThisActiveCall: |
214 case EPhoneInCallCmdEndThisActiveCall: |
230 DisconnectOutgoingCallL(); |
215 DisconnectOutgoingCallL(); |
231 break; |
216 break; |
232 |
217 |
233 // 'End all calls' from menu |
|
234 case EPhoneInCallCmdEndAllCalls: |
218 case EPhoneInCallCmdEndAllCalls: |
235 iStateMachine->SendPhoneEngineMessage( |
219 iStateMachine->SendPhoneEngineMessage( |
236 MPEPhoneModel::EPEMessageReleaseAll ); |
220 MPEPhoneModel::EPEMessageReleaseAll ); |
237 break; |
221 break; |
238 |
222 |
239 case EPhoneDtmfDialerCancel: |
223 case EPhoneDtmfDialerCancel: |
240 { |
224 break; |
241 } |
|
242 break; |
|
243 |
225 |
244 default: |
226 default: |
245 commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
227 commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
246 break; |
228 break; |
247 } |
229 } |
248 |
|
249 return commandStatus; |
230 return commandStatus; |
250 } |
231 } |
251 |
232 |
252 // ----------------------------------------------------------- |
233 // ----------------------------------------------------------- |
253 // CPhoneSingleAndCallSetupAndWaiting:HandleIdleL |
234 // CPhoneSingleAndCallSetupAndWaiting:HandleIdleL |
342 // ----------------------------------------------------------- |
319 // ----------------------------------------------------------- |
343 // |
320 // |
344 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId ) |
321 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId ) |
345 { |
322 { |
346 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() "); |
323 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() "); |
347 |
|
348 // Remove the number entry if it isn't DTMF dialer |
324 // Remove the number entry if it isn't DTMF dialer |
349 if ( !iOnScreenDialer || !IsNumberEntryVisibleL() ) |
325 if ( !IsNumberEntryVisibleL() ) |
350 { |
326 { |
351 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
327 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
352 } |
328 } |
353 |
|
354 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
329 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
355 |
330 |
356 // Re-enable global notes |
|
357 TPhoneCmdParamBoolean globalNotifierParam; |
331 TPhoneCmdParamBoolean globalNotifierParam; |
358 globalNotifierParam.SetBoolean( EFalse ); |
332 globalNotifierParam.SetBoolean( EFalse ); |
359 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
333 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
360 &globalNotifierParam ); |
334 &globalNotifierParam ); |
361 |
335 |
362 BeginUiUpdateLC(); |
336 BeginUiUpdateLC(); |
363 |
|
364 // Update bubble content |
|
365 UpdateRemoteInfoDataL( aCallId ); |
337 UpdateRemoteInfoDataL( aCallId ); |
366 |
|
367 // Update bubble type |
|
368 TPhoneCmdParamCallHeaderData callHeaderParam; |
338 TPhoneCmdParamCallHeaderData callHeaderParam; |
369 callHeaderParam.SetCallState( EPEStateConnecting ); |
339 callHeaderParam.SetCallState( EPEStateConnecting ); |
370 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
340 iViewCommandHandle->ExecuteCommandL( |
371 &callHeaderParam ); |
341 EPhoneViewUpdateBubble, |
372 |
342 aCallId, |
373 EndUiUpdate(); |
343 &callHeaderParam ); |
374 |
344 EndUiUpdate(); |
375 // Set call waiting cba |
|
376 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
345 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
377 |
|
378 // Stop key Capture when the phone is connecting |
|
379 CaptureKeysDuringCallNotificationL( EFalse ); |
|
380 } |
346 } |
381 |
347 |
382 // ----------------------------------------------------------- |
348 // ----------------------------------------------------------- |
383 // CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL |
349 // CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL |
384 // ----------------------------------------------------------- |
350 // ----------------------------------------------------------- |
385 // |
351 // |
386 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId ) |
352 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId ) |
387 { |
353 { |
388 __LOGMETHODSTARTEND( EPhoneUIStates, |
354 __LOGMETHODSTARTEND( EPhoneUIStates, |
389 "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()"); |
355 "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()"); |
390 // Keep Phone in the foreground |
|
391 TPhoneCmdParamBoolean booleanParam; |
356 TPhoneCmdParamBoolean booleanParam; |
392 booleanParam.SetBoolean( EFalse ); |
357 booleanParam.SetBoolean( EFalse ); |
393 iViewCommandHandle->ExecuteCommandL( |
358 iViewCommandHandle->ExecuteCommandL( |
394 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
359 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
395 |
360 |
396 // Show bubble |
|
397 TPhoneCmdParamCallHeaderData callHeaderParam; |
361 TPhoneCmdParamCallHeaderData callHeaderParam; |
398 callHeaderParam.SetCallState( EPEStateConnected ); |
362 callHeaderParam.SetCallState( EPEStateConnected ); |
399 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
363 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
400 &callHeaderParam ); |
364 &callHeaderParam ); |
401 |
365 |
402 // Capturing keys and number entry must be removed because some |
|
403 // networks jump over connecting state directly to connected state. |
|
404 CaptureKeysDuringCallNotificationL( EFalse ); |
|
405 |
|
406 // Remove the number entry if it isn't DTMF dialer |
366 // Remove the number entry if it isn't DTMF dialer |
407 if ( !iOnScreenDialer || !IsNumberEntryVisibleL() ) |
367 if ( !IsNumberEntryVisibleL() ) |
408 { |
368 { |
409 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
369 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
410 } |
370 } |
411 |
371 |
412 if ( aCallId != iWaitingCallId ) |
372 if ( aCallId != iWaitingCallId ) // Alerting call is connected |
413 { |
373 { |
414 // Alerting call is connected |
|
415 StateChangeToTwoSinglesAndWaitingL( aCallId ); |
374 StateChangeToTwoSinglesAndWaitingL( aCallId ); |
416 } |
375 } |
417 else |
376 else |
418 { |
377 { |
419 // Waiting call is connected while alerting call is disconnecting |
378 // Waiting call is connected while alerting call is disconnecting |
420 // (manual control sequence '1' + Send). |
379 // (manual control sequence '1' + Send). |
421 StateChangeToTwoSinglesL( aCallId ); |
380 StateChangeToTwoSinglesL( aCallId ); |
422 } |
381 } |
423 } |
382 } |
424 |
383 |
425 // ----------------------------------------------------------- |
384 // ----------------------------------------------------------- |
426 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToCallSetupAndWaitingL |
385 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToCallSetupAndWaitingL |
427 // ----------------------------------------------------------- |
386 // ----------------------------------------------------------- |
428 // |
387 // |
429 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId ) |
388 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId ) |
430 { |
389 { |
431 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() "); |
390 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() "); |
432 // Remove call |
|
433 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
391 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
434 |
392 |
435 // Reset Hold flag to view |
|
436 TPhoneCmdParamBoolean holdFlag; |
393 TPhoneCmdParamBoolean holdFlag; |
437 holdFlag.SetBoolean( EFalse ); |
394 holdFlag.SetBoolean( EFalse ); |
438 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
395 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
439 |
396 |
440 BeginUiUpdateLC(); |
397 BeginUiUpdateLC(); |
441 |
398 |
442 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
399 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
443 SetToolbarButtonLoudspeakerEnabled(); |
400 SetToolbarButtonLoudspeakerEnabled(); |
444 |
401 |
445 EndUiUpdate(); |
402 EndUiUpdate(); |
446 |
|
447 // Go to Call Setup And Waiting state |
|
448 // No need to update cbas |
|
449 iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting ); |
403 iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting ); |
450 } |
404 } |
451 |
405 |
452 // ----------------------------------------------------------- |
406 // ----------------------------------------------------------- |
453 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndWaitingL |
407 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndWaitingL |
454 // ----------------------------------------------------------- |
408 // ----------------------------------------------------------- |
455 // |
409 // |
456 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId ) |
410 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId ) |
457 { |
411 { |
458 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() "); |
412 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() "); |
459 // Remove call |
|
460 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
413 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
461 |
|
462 CheckIfRestoreNEContentAfterDtmfDialer(); |
|
463 |
|
464 if ( CPhoneState::IsNumberEntryUsedL() ) |
414 if ( CPhoneState::IsNumberEntryUsedL() ) |
465 { |
415 { |
466 // Show number entry |
|
467 TPhoneCmdParamBoolean booleanParam; |
416 TPhoneCmdParamBoolean booleanParam; |
468 booleanParam.SetBoolean( ETrue ); |
417 booleanParam.SetBoolean( ETrue ); |
469 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam ); |
418 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam ); |
470 } |
419 } |
471 |
420 |
472 // Set Hold flag to view |
|
473 TPhoneCmdParamBoolean holdFlag; |
421 TPhoneCmdParamBoolean holdFlag; |
474 holdFlag.SetBoolean( ETrue ); |
422 holdFlag.SetBoolean( ETrue ); |
475 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
423 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
476 |
424 |
477 BeginUiUpdateLC(); |
425 BeginUiUpdateLC(); |
478 |
426 |
479 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
427 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
480 |
428 |
481 EndUiUpdate(); |
429 EndUiUpdate(); |
482 // Go to Single And Waiting state |
|
483 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
430 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
484 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
431 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
485 } |
432 } |
486 |
433 |
487 // ----------------------------------------------------------- |
434 // ----------------------------------------------------------- |
488 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndAlertingL |
435 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndAlertingL |
489 // ----------------------------------------------------------- |
436 // ----------------------------------------------------------- |
490 // |
437 // |
491 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId ) |
438 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId ) |
492 { |
439 { |
493 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() "); |
440 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() "); |
494 // Remove call |
|
495 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
441 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
496 |
442 |
497 // Remove the number entry if it isn't DTMF dialer |
443 // Remove the number entry if it isn't DTMF dialer |
498 if ( !iOnScreenDialer || !IsNumberEntryVisibleL() ) |
444 if ( !IsNumberEntryVisibleL() ) |
499 { |
445 { |
500 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
446 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
501 } |
447 } |
502 |
448 |
503 // Set Hold flag to view EFalse that dtmf menu item not delete |
449 // Set Hold flag to view EFalse that dtmf menu item not delete |
504 TPhoneCmdParamBoolean holdFlag; |
450 TPhoneCmdParamBoolean holdFlag; |
505 holdFlag.SetBoolean( EFalse ); |
451 holdFlag.SetBoolean( EFalse ); |
506 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
452 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
507 |
453 |
508 BeginUiUpdateLC(); |
454 BeginUiUpdateLC(); |
509 |
|
510 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
455 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
511 |
|
512 EndUiUpdate(); |
456 EndUiUpdate(); |
513 // Go to Single And Alerting state |
457 |
514 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
458 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
515 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); |
459 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); |
516 } |
460 } |
517 |
461 |
518 // ----------------------------------------------------------- |
462 // ----------------------------------------------------------- |