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 CPhoneConferenceAndSingleAndWaiting class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <StringLoader.h>
|
|
21 |
#include <cpephonemodelif.h>
|
|
22 |
#include "cphoneconferenceandsingleandwaiting.h"
|
|
23 |
#include "mphonestatemachine.h"
|
|
24 |
#include "phoneviewcommanddefinitions.h"
|
|
25 |
#include "tphonecmdparamcallheaderdata.h"
|
|
26 |
#include "phonestatedefinitionsgsm.h"
|
|
27 |
#include "phonelogger.h"
|
|
28 |
#include "tphonecmdparamboolean.h"
|
|
29 |
#include "tphonecmdparaminteger.h"
|
|
30 |
#include "tphonecmdparamcallstatedata.h"
|
|
31 |
#include "cphonemainresourceresolver.h"
|
|
32 |
#include "phonerssbase.h"
|
|
33 |
#include "tphonecmdparamglobalnote.h"
|
|
34 |
#include "phoneui.hrh"
|
|
35 |
#include "mphonestorage.h"
|
|
36 |
#include "cphonecenrepproxy.h"
|
|
37 |
#include <telephonyvariant.hrh>
|
|
38 |
|
|
39 |
// ================= MEMBER FUNCTIONS =======================
|
|
40 |
|
|
41 |
// C++ default constructor can NOT contain any code, that
|
|
42 |
// might leave.
|
|
43 |
//
|
|
44 |
CPhoneConferenceAndSingleAndWaiting::CPhoneConferenceAndSingleAndWaiting(
|
|
45 |
MPhoneStateMachine* aStateMachine,
|
|
46 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
47 |
MPhoneCustomization* aPhoneCustomization ) :
|
|
48 |
CPhoneConferenceAndSingle( aStateMachine, aViewCommandHandle, aPhoneCustomization )
|
|
49 |
{
|
|
50 |
}
|
|
51 |
|
|
52 |
// -----------------------------------------------------------
|
|
53 |
// CPhoneConferenceAndSingleAndWaiting::~CPhoneConferenceAndSingleAndWaiting()
|
|
54 |
// Destructor
|
|
55 |
// (other items were commented in a header).
|
|
56 |
// -----------------------------------------------------------
|
|
57 |
//
|
|
58 |
CPhoneConferenceAndSingleAndWaiting::~CPhoneConferenceAndSingleAndWaiting()
|
|
59 |
{
|
|
60 |
// Reset flag
|
|
61 |
if ( iViewCommandHandle )
|
|
62 |
{
|
|
63 |
TPhoneCmdParamBoolean dtmfSendFlag;
|
|
64 |
dtmfSendFlag.SetBoolean( EFalse );
|
|
65 |
iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag,
|
|
66 |
&dtmfSendFlag );
|
|
67 |
}
|
|
68 |
}
|
|
69 |
|
|
70 |
// -----------------------------------------------------------
|
|
71 |
// CPhoneConferenceAndSingleAndWaiting::ConstructL()
|
|
72 |
// Constructor
|
|
73 |
// (other items were commented in a header).
|
|
74 |
// -----------------------------------------------------------
|
|
75 |
//
|
|
76 |
void CPhoneConferenceAndSingleAndWaiting::ConstructL()
|
|
77 |
{
|
|
78 |
CPhoneConferenceAndSingle::ConstructL();
|
|
79 |
}
|
|
80 |
|
|
81 |
// -----------------------------------------------------------
|
|
82 |
// CPhoneConferenceAndSingleAndWaiting::NewL()
|
|
83 |
// Constructor
|
|
84 |
// (other items were commented in a header).
|
|
85 |
// -----------------------------------------------------------
|
|
86 |
//
|
|
87 |
CPhoneConferenceAndSingleAndWaiting* CPhoneConferenceAndSingleAndWaiting::NewL(
|
|
88 |
MPhoneStateMachine* aStateMachine,
|
|
89 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
90 |
MPhoneCustomization* aPhoneCustomization )
|
|
91 |
{
|
|
92 |
CPhoneConferenceAndSingleAndWaiting* self = new( ELeave ) CPhoneConferenceAndSingleAndWaiting(
|
|
93 |
aStateMachine, aViewCommandHandle, aPhoneCustomization );
|
|
94 |
|
|
95 |
CleanupStack::PushL( self );
|
|
96 |
self->ConstructL();
|
|
97 |
CleanupStack::Pop( self );
|
|
98 |
|
|
99 |
return self;
|
|
100 |
}
|
|
101 |
|
|
102 |
// -----------------------------------------------------------
|
|
103 |
// CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL
|
|
104 |
// -----------------------------------------------------------
|
|
105 |
//
|
|
106 |
void CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL(
|
|
107 |
const TInt aMessage,
|
|
108 |
TInt aCallId )
|
|
109 |
{
|
|
110 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL()");
|
|
111 |
switch ( aMessage )
|
|
112 |
{
|
|
113 |
case MEngineMonitor::EPEMessageAddedConferenceMember:
|
|
114 |
HandleAddedConferenceMemberL( aCallId );
|
|
115 |
break;
|
|
116 |
|
|
117 |
case MEngineMonitor::EPEMessageIdle:
|
|
118 |
HandleIdleL( aCallId );
|
|
119 |
break;
|
|
120 |
|
|
121 |
default:
|
|
122 |
CPhoneConferenceAndSingle::HandlePhoneEngineMessageL( aMessage,
|
|
123 |
aCallId );
|
|
124 |
break;
|
|
125 |
}
|
|
126 |
}
|
|
127 |
|
|
128 |
// -----------------------------------------------------------
|
|
129 |
// CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL
|
|
130 |
// -----------------------------------------------------------
|
|
131 |
//
|
|
132 |
void CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL()
|
|
133 |
{
|
|
134 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
135 |
"CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL()");
|
|
136 |
TInt resourceId = NULL;
|
|
137 |
|
|
138 |
// Set specific flag to view so that DTMF menu item available
|
|
139 |
TPhoneCmdParamBoolean dtmfSendFlag;
|
|
140 |
dtmfSendFlag.SetBoolean( ETrue );
|
|
141 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag,
|
|
142 |
&dtmfSendFlag );
|
|
143 |
|
|
144 |
|
|
145 |
TPhoneCmdParamCallStateData callStateData;
|
|
146 |
callStateData.SetCallState( EPEStateHeld );
|
|
147 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
|
|
148 |
&callStateData );
|
|
149 |
if( callStateData.CallId() == KConferenceCallId )
|
|
150 |
{
|
|
151 |
// Conference call is on hold and single is active
|
|
152 |
if ( IsNumberEntryVisibleL() )
|
|
153 |
{
|
|
154 |
resourceId = EPhoneCallActiveHeldConfAndWaitingMenubarWithNumberEntry;
|
|
155 |
}
|
|
156 |
else if ( IsConferenceBubbleInSelectionMode() )
|
|
157 |
{
|
|
158 |
resourceId = EPhoneConfCallParticipantsDropMenubar;
|
|
159 |
}
|
|
160 |
else
|
|
161 |
{
|
|
162 |
resourceId = EPhoneCallActiveHeldConfAndWaitingMenubar;
|
|
163 |
}
|
|
164 |
}
|
|
165 |
else if( callStateData.CallId() >= 0 )
|
|
166 |
{
|
|
167 |
// Single call is on hold and conference is active
|
|
168 |
if ( IsNumberEntryVisibleL() )
|
|
169 |
{
|
|
170 |
resourceId = EPhoneConfCallActiveHeldAndWaitingMenubarWithNumberEntry;
|
|
171 |
}
|
|
172 |
else if ( IsConferenceBubbleInSelectionMode() )
|
|
173 |
{
|
|
174 |
resourceId = EPhoneConfCallParticipantsDropMenubar;
|
|
175 |
}
|
|
176 |
else
|
|
177 |
{
|
|
178 |
resourceId = EPhoneConfCallActiveHeldAndWaitingMenubar;
|
|
179 |
}
|
|
180 |
}
|
|
181 |
else
|
|
182 |
{
|
|
183 |
return; // negative call id, don't do anything
|
|
184 |
}
|
|
185 |
|
|
186 |
TPhoneCmdParamInteger integerParam;
|
|
187 |
integerParam.SetInteger(
|
|
188 |
CPhoneMainResourceResolver::Instance()->
|
|
189 |
ResolveResourceID( resourceId ) );
|
|
190 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
|
|
191 |
&integerParam );
|
|
192 |
}
|
|
193 |
|
|
194 |
// -----------------------------------------------------------
|
|
195 |
// CPhoneConferenceAndSingleAndWaiting::HandleIdleL
|
|
196 |
// -----------------------------------------------------------
|
|
197 |
//
|
|
198 |
void CPhoneConferenceAndSingleAndWaiting::HandleIdleL( TInt aCallId )
|
|
199 |
{
|
|
200 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
201 |
"CPhoneConferenceAndSingleAndWaiting::HandleIdleL()");
|
|
202 |
|
|
203 |
// Effect is shown when dialer exist.
|
|
204 |
TBool effectStarted ( EFalse );
|
|
205 |
if ( !NeedToSendToBackgroundL() )
|
|
206 |
{
|
|
207 |
BeginTransEffectLC( ENumberEntryOpen );
|
|
208 |
effectStarted = ETrue;
|
|
209 |
}
|
|
210 |
|
|
211 |
BeginUiUpdateLC();
|
|
212 |
// Set touch controls
|
|
213 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
|
|
214 |
SetTouchPaneButtons( EPhoneWaitingCallButtons );
|
|
215 |
|
|
216 |
|
|
217 |
TPhoneCmdParamBoolean conferenceExistsForCallId;
|
|
218 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
|
|
219 |
aCallId, &conferenceExistsForCallId );
|
|
220 |
|
|
221 |
if( conferenceExistsForCallId.Boolean() )
|
|
222 |
{
|
|
223 |
// Remove conference member from conference bubble
|
|
224 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference,
|
|
225 |
aCallId );
|
|
226 |
}
|
|
227 |
else
|
|
228 |
{
|
|
229 |
// Remove call
|
|
230 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
|
|
231 |
|
|
232 |
TPhoneCmdParamBoolean conferenceBubbleExists;
|
|
233 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference,
|
|
234 |
&conferenceBubbleExists );
|
|
235 |
if( !conferenceBubbleExists.Boolean() )
|
|
236 |
{
|
|
237 |
// Idle message came for conference member.
|
|
238 |
MakeTransitionAccordingToActiveCallsL();
|
|
239 |
}
|
|
240 |
else
|
|
241 |
{
|
|
242 |
TPhoneCmdParamCallStateData callStateData;
|
|
243 |
callStateData.SetCallState( EPEStateRinging );
|
|
244 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
|
|
245 |
&callStateData );
|
|
246 |
if( callStateData.CallId() >= 0 )
|
|
247 |
{
|
|
248 |
// We have Conference and Waiting calls left
|
|
249 |
MakeStateTransitionToConferenceAndWaitingL( aCallId );
|
|
250 |
}
|
|
251 |
else
|
|
252 |
{
|
|
253 |
// We have Conference and Single calls left
|
|
254 |
MakeStateTransitionToConferenceAndSingleL( aCallId );
|
|
255 |
}
|
|
256 |
}
|
|
257 |
}
|
|
258 |
EndUiUpdate();
|
|
259 |
if ( effectStarted )
|
|
260 |
{
|
|
261 |
EndTransEffect();
|
|
262 |
}
|
|
263 |
}
|
|
264 |
|
|
265 |
// -----------------------------------------------------------
|
|
266 |
// CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL
|
|
267 |
// -----------------------------------------------------------
|
|
268 |
//
|
|
269 |
void CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL( TInt aCallId )
|
|
270 |
{
|
|
271 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL");
|
|
272 |
// Update conference bubble
|
|
273 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference );
|
|
274 |
|
|
275 |
UpdateConferenceSecurityStatusL( aCallId );
|
|
276 |
|
|
277 |
MakeStateTransitionToConferenceAndWaitingL( KConferenceCallId );
|
|
278 |
}
|
|
279 |
|
|
280 |
// -----------------------------------------------------------
|
|
281 |
// CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL
|
|
282 |
// -----------------------------------------------------------
|
|
283 |
//
|
|
284 |
void CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL( TInt /*aCallId*/ )
|
|
285 |
{
|
|
286 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
287 |
"CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL()");
|
|
288 |
if ( !IsNumberEntryUsedL() )
|
|
289 |
{
|
|
290 |
// Close menu bar, if number entry isnt open.
|
|
291 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
|
|
292 |
}
|
|
293 |
|
|
294 |
SetTouchPaneButtons( EPhoneWaitingCallButtons );
|
|
295 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
|
|
296 |
|
|
297 |
// Check if HW Keys or Call UI should be disabled
|
|
298 |
CheckDisableHWKeysAndCallUIL();
|
|
299 |
|
|
300 |
// Go to Conference And Waiting state
|
|
301 |
UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
|
|
302 |
iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );
|
|
303 |
}
|
|
304 |
|
|
305 |
// -----------------------------------------------------------
|
|
306 |
// CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL
|
|
307 |
// -----------------------------------------------------------
|
|
308 |
//
|
|
309 |
void CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL( TInt /*aCallId*/ )
|
|
310 |
{
|
|
311 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
312 |
"CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL()");
|
|
313 |
|
|
314 |
if( /*FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
|
|
315 |
*/ 1 && iStateMachine->PhoneStorage()->IsScreenLocked() )
|
|
316 |
{
|
|
317 |
EnableCallUIL();
|
|
318 |
}
|
|
319 |
|
|
320 |
// Reset blocked keys list
|
|
321 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList();
|
|
322 |
|
|
323 |
if ( !IsNumberEntryUsedL() )
|
|
324 |
{
|
|
325 |
// Close menu bar, if number entry isnt open.
|
|
326 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
|
|
327 |
}
|
|
328 |
|
|
329 |
if ( IsNumberEntryUsedL() )
|
|
330 |
{
|
|
331 |
if ( NeedToSendToBackgroundL() )
|
|
332 |
{
|
|
333 |
// Return phone to the background if send to background is needed.
|
|
334 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
|
|
335 |
|
|
336 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
|
|
337 |
|
|
338 |
UpdateCbaL( EPhoneCallHandlingInCallCBA );
|
|
339 |
}
|
|
340 |
else
|
|
341 |
{
|
|
342 |
// Show the number entry if it exists
|
|
343 |
SetNumberEntryVisibilityL(ETrue);
|
|
344 |
}
|
|
345 |
}
|
|
346 |
else
|
|
347 |
{
|
|
348 |
UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
|
|
349 |
// If numberentry is not open just check NeedToSendToBackgroundL and
|
|
350 |
// sendbackround if needed.
|
|
351 |
if ( NeedToSendToBackgroundL() )
|
|
352 |
{
|
|
353 |
// Return phone to the background if send to background is needed.
|
|
354 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
|
|
355 |
}
|
|
356 |
}
|
|
357 |
|
|
358 |
SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
|
|
359 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
|
|
360 |
SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
|
|
361 |
// Go to conference and single state
|
|
362 |
// CBA updates in above if-else conditions
|
|
363 |
iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );
|
|
364 |
}
|
|
365 |
|
|
366 |
// -----------------------------------------------------------
|
|
367 |
// CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL
|
|
368 |
// -----------------------------------------------------------
|
|
369 |
//
|
|
370 |
void CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL()
|
|
371 |
{
|
|
372 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
373 |
"CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL()");
|
|
374 |
|
|
375 |
BeginUiUpdateLC();
|
|
376 |
|
|
377 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
|
|
378 |
|
|
379 |
// Close menu bar, if it is displayed
|
|
380 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
|
|
381 |
|
|
382 |
// Remove any phone dialogs if they are displayed
|
|
383 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
|
|
384 |
|
|
385 |
MakeTransitionAccordingToActiveCallsL();
|
|
386 |
|
|
387 |
EndUiUpdate();
|
|
388 |
}
|
|
389 |
|
|
390 |
// --------------------------------------------------------------
|
|
391 |
// CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL
|
|
392 |
// --------------------------------------------------------------
|
|
393 |
//
|
|
394 |
void CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL(
|
|
395 |
TPhoneKeyEventMessages aMessage,
|
|
396 |
TKeyCode aCode )
|
|
397 |
{
|
|
398 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
399 |
"CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL()");
|
|
400 |
switch ( aCode )
|
|
401 |
{
|
|
402 |
// send-key
|
|
403 |
case EKeyYes:
|
|
404 |
if( IsNumberEntryVisibleL() )
|
|
405 |
{
|
|
406 |
CallFromNumberEntryL();
|
|
407 |
}
|
|
408 |
else
|
|
409 |
{
|
|
410 |
// Not allowed to answer
|
|
411 |
SendGlobalWarningNoteL(
|
|
412 |
EPhoneNoteTextCallNotAllowed );
|
|
413 |
}
|
|
414 |
break;
|
|
415 |
|
|
416 |
default:
|
|
417 |
// do base operation
|
|
418 |
CPhoneConferenceAndSingle::HandleKeyMessageL( aMessage, aCode );
|
|
419 |
break;
|
|
420 |
}
|
|
421 |
}
|
|
422 |
|
|
423 |
// -----------------------------------------------------------
|
|
424 |
// CPhoneConferenceAndSingleAndWaiting::HandleKeyEventL
|
|
425 |
// -----------------------------------------------------------
|
|
426 |
//
|
|
427 |
void CPhoneConferenceAndSingleAndWaiting::HandleKeyEventL(
|
|
428 |
const TKeyEvent& aKeyEvent,
|
|
429 |
TEventCode /*aEventCode*/ )
|
|
430 |
{
|
|
431 |
if( EKeyDeviceF == aKeyEvent.iCode )
|
|
432 |
{
|
|
433 |
__PHONELOG( EBasic, EPhoneUIStates,
|
|
434 |
"CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL-deviceF" );
|
|
435 |
HandleHoldSwitchL();
|
|
436 |
}
|
|
437 |
}
|
|
438 |
|
|
439 |
// -----------------------------------------------------------
|
|
440 |
// CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL
|
|
441 |
// -----------------------------------------------------------
|
|
442 |
//
|
|
443 |
void CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL()
|
|
444 |
{
|
|
445 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL() ");
|
|
446 |
|
|
447 |
UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA );
|
|
448 |
}
|
|
449 |
|
|
450 |
// -----------------------------------------------------------
|
|
451 |
// CPhoneConferenceAndSingleAndWaiting::MakeTransitionAccordingToActiveCallsL
|
|
452 |
// -----------------------------------------------------------
|
|
453 |
//
|
|
454 |
void CPhoneConferenceAndSingleAndWaiting::MakeTransitionAccordingToActiveCallsL()
|
|
455 |
{
|
|
456 |
TPhoneCmdParamInteger activeCallCount;
|
|
457 |
iViewCommandHandle->ExecuteCommandL(
|
|
458 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount );
|
|
459 |
|
|
460 |
switch( activeCallCount.Integer() )
|
|
461 |
{
|
|
462 |
case ENoActiveCalls: // Go to incoming state
|
|
463 |
{
|
|
464 |
// Get Waiting call's Call Id
|
|
465 |
TPhoneCmdParamCallStateData callStateData;
|
|
466 |
callStateData.SetCallState( EPEStateRinging );
|
|
467 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
|
|
468 |
&callStateData );
|
|
469 |
|
|
470 |
if ( callStateData.CallId() != KErrNotFound )
|
|
471 |
{
|
|
472 |
// Display ringing bubble
|
|
473 |
TPhoneCmdParamCallHeaderData callHeaderParam;
|
|
474 |
callHeaderParam.SetCallState( EPEStateRinging );
|
|
475 |
|
|
476 |
SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
|
|
477 |
|
|
478 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
|
|
479 |
callStateData.CallId(),
|
|
480 |
&callHeaderParam );
|
|
481 |
|
|
482 |
// Capture keys when there is an incoming call
|
|
483 |
CaptureKeysDuringCallNotificationL( ETrue );
|
|
484 |
|
|
485 |
// Go to Incoming state
|
|
486 |
iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
|
|
487 |
|
|
488 |
// Check if HW Keys or Call UI should be disabled
|
|
489 |
CheckDisableHWKeysAndCallUIL();
|
|
490 |
|
|
491 |
SetTouchPaneButtons( EPhoneIncomingCallButtons );
|
|
492 |
UpdateSilenceButtonDimming();
|
|
493 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
|
|
494 |
SetRingingTonePlaybackL( callStateData.CallId() );
|
|
495 |
SetToolbarDimming( ETrue );
|
|
496 |
SetBackButtonActive(EFalse);
|
|
497 |
iStateMachine->ChangeState( EPhoneStateIncoming );
|
|
498 |
}
|
|
499 |
else
|
|
500 |
{
|
|
501 |
SetDefaultFlagsL();
|
|
502 |
UpdateCbaL( EPhoneEmptyCBA );
|
|
503 |
iStateMachine->ChangeState( EPhoneStateIdle );
|
|
504 |
}
|
|
505 |
}
|
|
506 |
break;
|
|
507 |
case EOneActiveCall:
|
|
508 |
{
|
|
509 |
// Go to Single And Waiting state
|
|
510 |
UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
|
|
511 |
SetTouchPaneButtons( EPhoneWaitingCallButtons );
|
|
512 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
|
|
513 |
|
|
514 |
// Check if HW Keys or Call UI should be disabled
|
|
515 |
CheckDisableHWKeysAndCallUIL();
|
|
516 |
|
|
517 |
iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
|
|
518 |
}
|
|
519 |
break;
|
|
520 |
case ETwoActiveCalls:
|
|
521 |
{
|
|
522 |
// Go to Two Singles And Waiting state
|
|
523 |
UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
|
|
524 |
|
|
525 |
// Check if HW Keys or Call UI should be disabled
|
|
526 |
CheckDisableHWKeysAndCallUIL();
|
|
527 |
|
|
528 |
SetTouchPaneButtons( EPhoneWaitingCallButtons );
|
|
529 |
iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
|
|
530 |
}
|
|
531 |
break;
|
|
532 |
default:
|
|
533 |
// Too many active calls to handle reliable state change now.
|
|
534 |
// Waiting for all conference member idles
|
|
535 |
// This case may happen when 'End all calls' because conferenceIdle may
|
|
536 |
// come earlier than idle for conference member
|
|
537 |
break;
|
|
538 |
}
|
|
539 |
|
|
540 |
}
|
|
541 |
|
|
542 |
// End of File
|