author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:48:26 +0300 | |
changeset 56 | 5bcb308bd24d |
parent 37 | ba76fc04e6c2 |
child 65 | 2a5d4ab426d3 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Implementation of CPhoneSingleAndWaiting class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <eikmenub.h> |
|
21 |
#include <eikenv.h> |
|
22 |
#include <StringLoader.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include <pevirtualengine.h> |
|
25 |
#include <mpeengineinfo.h> |
|
26 |
#include <telephonyvariant.hrh> |
|
27 |
#include <cpephonemodelif.h> |
|
28 |
#include "cphonesingleandwaiting.h" |
|
29 |
#include "mphonestatemachine.h" |
|
30 |
#include "phoneviewcommanddefinitions.h" |
|
31 |
#include "phoneui.hrh" |
|
32 |
#include "cphonemainresourceresolver.h" |
|
33 |
#include "phonerssbase.h" |
|
34 |
#include "cphonegsmincall.h" |
|
35 |
#include "tphonecmdparaminteger.h" |
|
36 |
#include "tphonecmdparamboolean.h" |
|
37 |
#include "tphonecmdparamstring.h" |
|
38 |
#include "tphonecmdparamcallheaderdata.h" |
|
39 |
#include "tphonecmdparamglobalnote.h" |
|
40 |
#include "tphonecmdparamcallstatedata.h" |
|
41 |
#include "phonestatedefinitionsgsm.h" |
|
42 |
#include "phonelogger.h" |
|
43 |
#include "cphonecenrepproxy.h" |
|
44 |
#include "cphonepubsubproxy.h" |
|
45 |
#include "mphonestorage.h" |
|
46 |
||
47 |
// ================= MEMBER FUNCTIONS ======================= |
|
48 |
||
49 |
// C++ default constructor can NOT contain any code, that |
|
50 |
// might leave. |
|
51 |
// |
|
52 |
CPhoneSingleAndWaiting::CPhoneSingleAndWaiting( |
|
53 |
MPhoneStateMachine* aStateMachine, |
|
54 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
55 |
MPhoneCustomization* aPhoneCustomization ) : |
|
56 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ), |
|
57 |
iSingleCallId ( KErrNotFound ) |
|
58 |
{ |
|
59 |
} |
|
60 |
||
61 |
// ----------------------------------------------------------- |
|
62 |
// CPhoneSingleAndWaiting::~CPhoneSingleAndWaiting() |
|
63 |
// Destructor |
|
64 |
// (other items were commented in a header). |
|
65 |
// ----------------------------------------------------------- |
|
66 |
// |
|
67 |
CPhoneSingleAndWaiting::~CPhoneSingleAndWaiting() |
|
68 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
69 |
|
37 | 70 |
} |
71 |
||
72 |
// ----------------------------------------------------------- |
|
73 |
// CPhoneSingleAndWaiting::ConstructL() |
|
74 |
// Constructor |
|
75 |
// (other items were commented in a header). |
|
76 |
// ----------------------------------------------------------- |
|
77 |
// |
|
78 |
void CPhoneSingleAndWaiting::ConstructL() |
|
79 |
{ |
|
80 |
CPhoneGsmInCall::ConstructL(); |
|
81 |
||
82 |
TPhoneCmdParamCallStateData callStateData; |
|
83 |
callStateData.SetCallState( EPEStateConnected ); |
|
84 |
||
85 |
iViewCommandHandle->HandleCommandL( |
|
86 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
87 |
||
88 |
if ( callStateData.CallId() == KErrNotFound ) |
|
89 |
{ |
|
90 |
callStateData.SetCallState( EPEStateHeld ); |
|
91 |
iViewCommandHandle->HandleCommandL( |
|
92 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
93 |
} |
|
94 |
iSingleCallId = callStateData.CallId(); |
|
95 |
||
96 |
__PHONELOG1( EBasic, EPhoneUIStates, |
|
97 |
"CPhoneSingleAndWaiting::ConstructL() (iSingleCallId=%d)", iSingleCallId); |
|
98 |
} |
|
99 |
||
100 |
// ----------------------------------------------------------- |
|
101 |
// CPhoneSingleAndWaiting::NewL() |
|
102 |
// Constructor |
|
103 |
// (other items were commented in a header). |
|
104 |
// ----------------------------------------------------------- |
|
105 |
// |
|
106 |
CPhoneSingleAndWaiting* CPhoneSingleAndWaiting::NewL( |
|
107 |
MPhoneStateMachine* aStateMachine, |
|
108 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
109 |
MPhoneCustomization* aPhoneCustomization ) |
|
110 |
{ |
|
111 |
CPhoneSingleAndWaiting* self = new( ELeave ) CPhoneSingleAndWaiting( |
|
112 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
113 |
||
114 |
CleanupStack::PushL( self ); |
|
115 |
self->ConstructL(); |
|
116 |
CleanupStack::Pop( self ); |
|
117 |
||
118 |
return self; |
|
119 |
} |
|
120 |
||
121 |
// ----------------------------------------------------------- |
|
122 |
// CPhoneSingleAndWaiting::HandlePhoneEngineMessageL |
|
123 |
// ----------------------------------------------------------- |
|
124 |
// |
|
125 |
void CPhoneSingleAndWaiting::HandlePhoneEngineMessageL( |
|
126 |
const TInt aMessage, |
|
127 |
TInt aCallId ) |
|
128 |
{ |
|
129 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
130 |
"CPhoneSingleAndWaiting::HandlePhoneEngineMessageL() "); |
|
131 |
switch ( aMessage ) |
|
132 |
{ |
|
133 |
case MEngineMonitor::EPEMessageIdle: |
|
134 |
HandleIdleL( aCallId ); |
|
135 |
break; |
|
136 |
||
137 |
case MEngineMonitor::EPEMessageHeld: |
|
138 |
HandleHeldL( aCallId ); |
|
139 |
break; |
|
140 |
||
141 |
case MEngineMonitor::EPEMessageConnected: |
|
142 |
HandleConnectedL( aCallId ); |
|
143 |
break; |
|
144 |
||
145 |
case MEngineMonitor::EPEMessageDialing: |
|
146 |
HandleDiallingL( aCallId ); |
|
147 |
break; |
|
148 |
||
149 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
150 |
HandleDisconnectingL( aCallId ); |
|
151 |
/* Flow through */ |
|
152 |
||
153 |
default: |
|
154 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
155 |
break; |
|
156 |
} |
|
157 |
} |
|
158 |
||
159 |
// ----------------------------------------------------------- |
|
160 |
// CPhoneSingleAndWaiting:HandleCommandL |
|
161 |
// ----------------------------------------------------------- |
|
162 |
// |
|
163 |
TBool CPhoneSingleAndWaiting::HandleCommandL( TInt aCommand ) |
|
164 |
{ |
|
165 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
166 |
"CPhoneSingleAndWaiting::HandleCommandL() "); |
|
167 |
TBool commandStatus = ETrue; |
|
168 |
||
169 |
switch( aCommand ) |
|
170 |
{ |
|
171 |
case EPhoneInCallCmdHold: |
|
172 |
{ |
|
173 |
iStateMachine->SetCallId( iSingleCallId ); |
|
174 |
iStateMachine->SendPhoneEngineMessage( |
|
175 |
CPEPhoneModelIF::EPEMessageHold ); |
|
176 |
break; |
|
177 |
} |
|
178 |
||
179 |
case EPhoneInCallCmdUnhold: |
|
180 |
{ |
|
181 |
iStateMachine->SetCallId( iSingleCallId ); |
|
182 |
iStateMachine->SendPhoneEngineMessage( |
|
183 |
CPEPhoneModelIF::EPEMessageResume ); |
|
184 |
break; |
|
185 |
} |
|
186 |
||
187 |
case EPhoneInCallCmdNewCall: |
|
188 |
break; |
|
189 |
||
190 |
case EPhoneInCallCmdNewCallCall: |
|
191 |
break; |
|
192 |
||
193 |
case EPhoneCallComingCmdReject: // fall through |
|
194 |
{ |
|
195 |
// Get waiting callid |
|
196 |
TPhoneCmdParamCallStateData callStateData; |
|
197 |
callStateData.SetCallState( EPEStateRinging ); |
|
198 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
|
199 |
&callStateData ); |
|
200 |
iStateMachine->SetCallId( callStateData.CallId() ); |
|
201 |
iStateMachine->SendPhoneEngineMessage( |
|
202 |
MPEPhoneModel::EPEMessageReject ); |
|
203 |
break; |
|
204 |
} |
|
205 |
||
206 |
||
207 |
case EPhoneInCallCmdReject: |
|
208 |
iStateMachine->SetCallId( iSingleCallId ); |
|
209 |
iStateMachine->SendPhoneEngineMessage( |
|
210 |
MPEPhoneModel::EPEMessageReject ); |
|
211 |
break; |
|
212 |
||
213 |
case EPhoneCmdUpdateUiControls: |
|
214 |
UpdateUiControlsL(); |
|
215 |
break; |
|
216 |
||
217 |
default: |
|
218 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
219 |
break; |
|
220 |
} |
|
221 |
||
222 |
return commandStatus; |
|
223 |
} |
|
224 |
||
225 |
// -------------------------------------------------------------- |
|
226 |
// CPhoneSingleAndWaiting::HandleKeyMessageL |
|
227 |
// -------------------------------------------------------------- |
|
228 |
// |
|
229 |
void CPhoneSingleAndWaiting::HandleKeyMessageL( |
|
230 |
TPhoneKeyEventMessages aMessage, |
|
231 |
TKeyCode aCode ) |
|
232 |
{ |
|
233 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
234 |
"CPhoneSingleAndWaiting::HandleKeyMessageL() "); |
|
235 |
switch ( aCode ) |
|
236 |
{ |
|
237 |
// send-key |
|
238 |
case EKeyYes: |
|
239 |
{ |
|
240 |
if( IsNumberEntryVisibleL() ) |
|
241 |
{ |
|
242 |
// Send a manual control sequence by providing number |
|
243 |
// information with Dial command |
|
244 |
CallFromNumberEntryL(); |
|
245 |
} |
|
246 |
else |
|
247 |
{ |
|
248 |
// Close DTMF sending note if it exists |
|
249 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
250 |
||
251 |
// Number entry is below incoming call bubble so |
|
252 |
// answer the call |
|
253 |
iStateMachine->SendPhoneEngineMessage( |
|
254 |
CPEPhoneModelIF::EPEMessageAnswer ); |
|
255 |
} |
|
256 |
break; |
|
257 |
} |
|
258 |
||
259 |
default: |
|
260 |
// do base operation |
|
261 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
262 |
break; |
|
263 |
} |
|
264 |
} |
|
265 |
||
266 |
// ----------------------------------------------------------- |
|
267 |
// CPhoneSingleAndWaiting::HandleKeyEventL |
|
268 |
// ----------------------------------------------------------- |
|
269 |
// |
|
270 |
void CPhoneSingleAndWaiting::HandleKeyEventL( |
|
271 |
const TKeyEvent& aKeyEvent, |
|
272 |
TEventCode /*aEventCode*/ ) |
|
273 |
{ |
|
274 |
if( EKeyDeviceF == aKeyEvent.iCode ) |
|
275 |
{ |
|
276 |
__PHONELOG( EBasic, EPhoneUIStates, |
|
277 |
"CPhoneSingleAndWaiting::HandleKeyMessageL-deviceF" ); |
|
278 |
HandleHoldSwitchL(); |
|
279 |
} |
|
280 |
} |
|
281 |
||
282 |
// ----------------------------------------------------------- |
|
283 |
// CPhoneSingleAndWaiting::HandleIdleL |
|
284 |
// ----------------------------------------------------------- |
|
285 |
// |
|
286 |
void CPhoneSingleAndWaiting::HandleIdleL( TInt aCallId ) |
|
287 |
{ |
|
288 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
289 |
"CPhoneSingleAndWaiting::HandleIdleL() "); |
|
290 |
||
291 |
if ( iSingleCallId == KErrNotFound ) |
|
292 |
{ |
|
293 |
TPhoneCmdParamCallStateData callStateData; |
|
294 |
callStateData.SetCallState( EPEStateDisconnecting ); |
|
295 |
||
296 |
iViewCommandHandle->HandleCommandL( |
|
297 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
298 |
||
299 |
if ( callStateData.CallId() == KErrNotFound ) |
|
300 |
{ |
|
301 |
callStateData.SetCallState( EPEStateConnected ); |
|
302 |
iViewCommandHandle->HandleCommandL( |
|
303 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
304 |
||
305 |
if ( callStateData.CallId() == KErrNotFound ) |
|
306 |
{ |
|
307 |
callStateData.SetCallState( EPEStateHeld ); |
|
308 |
iViewCommandHandle->HandleCommandL( |
|
309 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
310 |
} |
|
311 |
} |
|
312 |
||
313 |
iSingleCallId = callStateData.CallId(); |
|
314 |
} |
|
315 |
||
316 |
__PHONELOG1( EBasic, EPhoneControl, |
|
317 |
"CPhoneSingleAndWaiting::HandleIdleL iSingleCallId(%d)", |
|
318 |
iSingleCallId ); |
|
319 |
__PHONELOG1( EBasic, EPhoneControl, |
|
320 |
"CPhoneSingleAndWaiting::HandleIdleL aCallId(%d)", |
|
321 |
aCallId ); |
|
322 |
||
323 |
if( iSingleCallId == aCallId ) |
|
324 |
{ |
|
325 |
// Idle message came for active call |
|
326 |
BeginUiUpdateLC(); |
|
327 |
||
328 |
// Remove call |
|
329 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
330 |
||
331 |
// Get waiting callId |
|
332 |
TPhoneCmdParamCallStateData callStateData; |
|
333 |
callStateData.SetCallState( EPEStateRinging ); |
|
334 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
|
335 |
&callStateData ); |
|
336 |
||
337 |
__PHONELOG1( EBasic, EPhoneControl, |
|
338 |
"CPhoneSingleAndWaiting::HandleIdleL EPEStateRinging CallId(%d)", |
|
339 |
callStateData.CallId() ); |
|
340 |
||
341 |
if ( callStateData.CallId() > KErrNotFound ) |
|
342 |
{ |
|
343 |
// Display ringing bubble |
|
344 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
345 |
callHeaderParam.SetCallState( EPEStateRinging ); |
|
346 |
||
347 |
// Set Hold flag to view |
|
348 |
TPhoneCmdParamBoolean holdFlag; |
|
349 |
holdFlag.SetBoolean( EFalse ); |
|
350 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
351 |
||
352 |
SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam ); |
|
353 |
||
354 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, |
|
355 |
callStateData.CallId(), |
|
356 |
&callHeaderParam ); |
|
357 |
||
358 |
// Hide number entry if visible |
|
359 |
if ( IsNumberEntryVisibleL() ) |
|
360 |
{ |
|
361 |
SetNumberEntryVisibilityL(EFalse); |
|
362 |
} |
|
363 |
||
364 |
// Check if HW Keys or Call UI should be disabled |
|
365 |
CheckDisableHWKeysAndCallUIL(); |
|
366 |
||
367 |
SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
368 |
||
369 |
// Bring up callhandling view |
|
370 |
BringIncomingToForegroundL(); |
|
371 |
||
372 |
//Set incoming cba |
|
373 |
iCbaManager->UpdateIncomingCbaL( callStateData.CallId() ); |
|
374 |
||
375 |
// Play ringtone |
|
376 |
SetRingingTonePlaybackL( callStateData.CallId() ); |
|
377 |
} |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
378 |
|
37 | 379 |
SetBackButtonActive(EFalse); |
380 |
EndUiUpdate(); |
|
381 |
||
382 |
iStateMachine->ChangeState( EPhoneStateIncoming ); |
|
383 |
} |
|
384 |
else |
|
385 |
{ |
|
386 |
||
387 |
BeginUiUpdateLC(); |
|
388 |
||
389 |
// Remove call |
|
390 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
391 |
||
392 |
// Idle message came for waiting call |
|
393 |
if ( IsNumberEntryUsedL() ) |
|
394 |
{ |
|
395 |
if ( NeedToSendToBackgroundL() ) |
|
396 |
{ |
|
397 |
// Return phone to the background if send to background is needed. |
|
398 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
399 |
||
400 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
401 |
} |
|
402 |
else |
|
403 |
{ |
|
404 |
// Show the number entry if it exists |
|
405 |
SetNumberEntryVisibilityL(ETrue); |
|
406 |
} |
|
407 |
} |
|
408 |
else |
|
409 |
{ |
|
410 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
411 |
// If numberentry is not open just check NeedToSendToBackgroundL and |
|
412 |
// sendbackround if needed. |
|
413 |
if ( NeedToSendToBackgroundL() ) |
|
414 |
{ |
|
415 |
// Return phone to the background if send to background is needed. |
|
416 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
417 |
} |
|
418 |
} |
|
419 |
||
420 |
// Enable call UI |
|
421 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
422 |
&& iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
423 |
{ |
|
424 |
EnableCallUIL(); |
|
425 |
} |
|
426 |
||
427 |
// Reset blocked keys list |
|
428 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
429 |
||
430 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
|
431 |
EndUiUpdate(); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
432 |
|
37 | 433 |
// CBA updates in above if-else conditions |
434 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
435 |
} |
|
436 |
||
437 |
} |
|
438 |
||
439 |
// ----------------------------------------------------------- |
|
440 |
// CPhoneSingleAndWaiting::HandleHeldL |
|
441 |
// ----------------------------------------------------------- |
|
442 |
// |
|
443 |
void CPhoneSingleAndWaiting::HandleHeldL( TInt aCallId ) |
|
444 |
{ |
|
445 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
446 |
"CPhoneSingleAndWaiting::HandleHeldL() "); |
|
447 |
||
448 |
// Display hold bubble |
|
449 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
450 |
callHeaderParam.SetCallState( EPEStateHeld ); |
|
451 |
||
452 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
453 |
TInt callLabelId = CPhoneMainResourceResolver::Instance()-> |
|
454 |
ResolveResourceID( EPhoneCallOnHold ); |
|
455 |
||
456 |
StringLoader::Load( labelText, callLabelId, CCoeEnv::Static() ); |
|
457 |
callHeaderParam.SetLabelText( labelText ); |
|
458 |
||
459 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
460 |
&callHeaderParam ); |
|
461 |
||
462 |
// Set Hold flag to view |
|
463 |
TPhoneCmdParamBoolean holdFlag; |
|
464 |
holdFlag.SetBoolean( ETrue ); |
|
465 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
466 |
||
467 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
468 |
{ |
|
469 |
HandleHoldNoteL( aCallId, ETrue ); |
|
470 |
} |
|
471 |
||
472 |
UpdateInCallCbaL(); |
|
473 |
||
474 |
SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
|
475 |
} |
|
476 |
||
477 |
// ----------------------------------------------------------- |
|
478 |
// CPhoneSingleAndWaiting::HandleConnectedL |
|
479 |
// ----------------------------------------------------------- |
|
480 |
// |
|
481 |
void CPhoneSingleAndWaiting::HandleConnectedL( TInt aCallId ) |
|
482 |
{ |
|
483 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
484 |
"CPhoneSingleAndWaiting::HandleConnectedL() "); |
|
485 |
||
486 |
__PHONELOG1( EBasic, EPhoneUIStates, |
|
487 |
"CPhoneSingleAndWaiting::HandleConnectedL (CallId=%d)", aCallId); |
|
488 |
||
489 |
if ( iSingleCallId == aCallId ) |
|
490 |
{ |
|
491 |
// Connected message came for the hold call, we still |
|
492 |
// have the waiting call also |
|
493 |
HandleUnholdL( aCallId ); |
|
494 |
} |
|
495 |
else |
|
496 |
{ |
|
497 |
// Connected message came for waiting call |
|
498 |
MakeStateTransitionToTwoSinglesL( aCallId ); |
|
499 |
} |
|
500 |
} |
|
501 |
||
502 |
// ----------------------------------------------------------- |
|
503 |
// CPhoneSingleAndWaiting::HandleUnholdL |
|
504 |
// ----------------------------------------------------------- |
|
505 |
// |
|
506 |
void CPhoneSingleAndWaiting::HandleUnholdL( TInt aCallId ) |
|
507 |
{ |
|
508 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
509 |
"CPhoneSingleAndWaiting::HandleUnholdL() "); |
|
510 |
||
511 |
// Show bubble |
|
512 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
513 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
514 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
515 |
&callHeaderParam ); |
|
516 |
||
517 |
// Set Hold flag to view |
|
518 |
TPhoneCmdParamBoolean holdFlag; |
|
519 |
holdFlag.SetBoolean( EFalse ); |
|
520 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
521 |
||
522 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
523 |
{ |
|
524 |
HandleHoldNoteL( aCallId, EFalse ); |
|
525 |
} |
|
526 |
||
527 |
// Set CBAs |
|
528 |
UpdateInCallCbaL(); |
|
529 |
||
530 |
SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
|
531 |
} |
|
532 |
||
533 |
// ----------------------------------------------------------- |
|
534 |
// CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL |
|
535 |
// ----------------------------------------------------------- |
|
536 |
// |
|
537 |
void CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL( TInt aCallId ) |
|
538 |
{ |
|
539 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
540 |
"CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL() "); |
|
541 |
||
542 |
// Reset blocked keys list |
|
543 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
544 |
||
545 |
BeginUiUpdateLC(); |
|
546 |
||
547 |
UpdateRemoteInfoDataL ( aCallId ); |
|
548 |
// Show bubble |
|
549 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
550 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
551 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
552 |
&callHeaderParam ); |
|
553 |
||
554 |
// Set Hold flag to view |
|
555 |
TPhoneCmdParamBoolean holdFlag; |
|
556 |
holdFlag.SetBoolean( EFalse ); |
|
557 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
558 |
||
559 |
if ( IsNumberEntryUsedL() ) |
|
560 |
{ |
|
561 |
if ( NeedToSendToBackgroundL() ) |
|
562 |
{ |
|
563 |
// Return phone to the background if send to background is needed. |
|
564 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
565 |
||
566 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
567 |
} |
|
568 |
else |
|
569 |
{ |
|
570 |
// Show the number entry if it exists. |
|
571 |
SetNumberEntryVisibilityL(ETrue); |
|
572 |
} |
|
573 |
} |
|
574 |
else |
|
575 |
{ |
|
576 |
// Set Two singles softkeys |
|
577 |
UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA ); |
|
578 |
} |
|
579 |
||
580 |
SetTouchPaneButtons( EPhoneTwoSinglesButtons ); |
|
581 |
EndUiUpdate(); |
|
582 |
||
583 |
// Go to two singles state |
|
584 |
// CBA updates in above if-else conditions |
|
585 |
iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
|
586 |
} |
|
587 |
||
588 |
// ----------------------------------------------------------- |
|
589 |
// CPhoneSingleAndWaiting::HandleDiallingL |
|
590 |
// ----------------------------------------------------------- |
|
591 |
// |
|
592 |
void CPhoneSingleAndWaiting::HandleDiallingL( TInt aCallId ) |
|
593 |
{ |
|
594 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
595 |
"CPhoneSingleAndWaiting::HandleDiallingL() "); |
|
596 |
||
597 |
BeginUiUpdateLC(); |
|
598 |
||
599 |
// Hide number entry if it exists |
|
600 |
SetNumberEntryVisibilityL(EFalse); |
|
601 |
||
602 |
// Display call setup |
|
603 |
DisplayCallSetupL( aCallId ); |
|
604 |
||
605 |
// Set Hold flag to view ( DTMF menu label have to present ) |
|
606 |
TPhoneCmdParamBoolean holdFlag; |
|
607 |
holdFlag.SetBoolean( EFalse ); |
|
608 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
609 |
||
610 |
SetTouchPaneButtons( EPhoneCallSetupButtons ); |
|
611 |
||
612 |
EndUiUpdate(); |
|
613 |
||
614 |
// Update call setup CBAs |
|
615 |
UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
616 |
||
617 |
// Go to Single And Waiting And Call Setup state |
|
618 |
iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting ); |
|
619 |
} |
|
620 |
||
621 |
// ----------------------------------------------------------- |
|
622 |
// CPhoneSingleAndWaiting::DisplayCallSetupL |
|
623 |
// ----------------------------------------------------------- |
|
624 |
// |
|
625 |
void CPhoneSingleAndWaiting::DisplayCallSetupL( TInt aCallId ) |
|
626 |
{ |
|
627 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
628 |
"CPhoneSingleAndWaiting::DisplayCallSetupL() "); |
|
629 |
||
630 |
// Remove dialogs if necessary |
|
631 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
632 |
||
633 |
// Capture keys when the phone is dialling |
|
634 |
CaptureKeysDuringCallNotificationL( ETrue ); |
|
635 |
||
636 |
// Force telephony to the foreground |
|
637 |
TPhoneCmdParamInteger uidParam; |
|
638 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
639 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
640 |
&uidParam ); |
|
641 |
||
642 |
// Display call setup header |
|
643 |
DisplayHeaderForOutgoingCallL( aCallId ); |
|
644 |
} |
|
645 |
||
646 |
// ----------------------------------------------------------- |
|
647 |
// CPhoneSingleAndWaiting::UpdateInCallCbaL |
|
648 |
// ----------------------------------------------------------- |
|
649 |
// |
|
650 |
void CPhoneSingleAndWaiting::UpdateInCallCbaL() |
|
651 |
{ |
|
652 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
653 |
"CPhoneSingleAndWaiting::UpdateInCallCbaL() "); |
|
654 |
TPhoneCmdParamInteger callIdParam; |
|
655 |
iViewCommandHandle->ExecuteCommandL( |
|
656 |
EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
|
657 |
||
658 |
if ( callIdParam.Integer()==iSingleCallId ) |
|
659 |
{ |
|
660 |
CPhoneGsmInCall::UpdateInCallCbaL(); |
|
661 |
} |
|
662 |
else |
|
663 |
{ |
|
664 |
iCbaManager->SetCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
665 |
} |
|
666 |
} |
|
667 |
||
668 |
// ----------------------------------------------------------- |
|
669 |
// CPhoneSingleAndWaiting::HandleErrorL |
|
670 |
// ----------------------------------------------------------- |
|
671 |
// |
|
672 |
EXPORT_C void CPhoneSingleAndWaiting::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
673 |
{ |
|
674 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleErrorL()"); |
|
675 |
||
676 |
if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer ) |
|
677 |
{ |
|
678 |
// Should not shown "Not Allowed" note, if active call. |
|
679 |
__PHONELOG1( EBasic, EPhoneUIStates, |
|
680 |
"PhoneUIControl: CPhoneSingleAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
681 |
aErrorInfo.iErrorCode); |
|
682 |
} |
|
683 |
else |
|
684 |
{ |
|
685 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
686 |
} |
|
687 |
} |
|
688 |
||
689 |
// ----------------------------------------------------------- |
|
690 |
// CPhoneSingleAndWaiting::HandleDisconnectingL |
|
691 |
// ----------------------------------------------------------- |
|
692 |
// |
|
693 |
void CPhoneSingleAndWaiting::HandleDisconnectingL( TInt aCallId ) |
|
694 |
{ |
|
695 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleDisconnectingL( ) "); |
|
696 |
||
697 |
if( ( iSingleCallId == aCallId ) && IsVideoCall( aCallId ) ) |
|
698 |
{ |
|
699 |
__PHONELOG( EBasic, EPhoneControl, |
|
700 |
"CPhoneSingleAndWaiting::HandleDisconnectingL EPhoneViewSetNeedToSendToBackgroundStatus" ); |
|
701 |
||
702 |
// Keep phone on the foreground |
|
703 |
TPhoneCmdParamBoolean booleanParam; |
|
704 |
booleanParam.SetBoolean( EFalse ); |
|
705 |
iViewCommandHandle->ExecuteCommandL( |
|
706 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
707 |
&booleanParam ); |
|
708 |
} |
|
709 |
} |
|
710 |
||
711 |
// ----------------------------------------------------------- |
|
712 |
// CPhoneSingleAndWaiting::UpdateUiControlsL |
|
713 |
// ----------------------------------------------------------- |
|
714 |
// |
|
715 |
void CPhoneSingleAndWaiting::UpdateUiControlsL() |
|
716 |
{ |
|
717 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) "); |
|
718 |
||
719 |
UpdateInCallCbaL(); |
|
720 |
} |
|
721 |
||
722 |
// End of File |