author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 23 Jun 2010 18:12:20 +0300 | |
changeset 45 | 6b911d05207e |
parent 37 | ba76fc04e6c2 |
child 46 | bc5a64e5bc3c |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005 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 CPhoneEmergency class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <eikmenub.h> |
|
21 |
#include <StringLoader.h> |
|
22 |
#include <ccpdefs.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include <cpephonemodelif.h> |
|
25 |
#include <mpeengineinfo.h> |
|
26 |
#include <AknUtils.h> |
|
27 |
||
28 |
#include "cphoneemergency.h" |
|
29 |
#include "tphonecmdparamstring.h" |
|
30 |
#include "tphonecmdparaminteger.h" |
|
31 |
#include "tphonecmdparamboolean.h" |
|
32 |
#include "tphonecmdparamemergencycallheaderdata.h" |
|
33 |
#include "tphonecmdparamcallheaderdata.h" |
|
34 |
#include "mphonestatemachine.h" |
|
35 |
#include "phonestatedefinitionsgsm.h" |
|
36 |
#include "phoneviewcommanddefinitions.h" |
|
37 |
#include "phoneui.hrh" |
|
38 |
#include "phonerssbase.h" |
|
39 |
#include "cphonemainresourceresolver.h" |
|
40 |
#include "phonelogger.h" |
|
41 |
#include "cphonepubsubproxy.h" |
|
42 |
#include "cphonekeys.h" |
|
43 |
#include "tphonecmdparamaudiooutput.h" |
|
44 |
#include "phoneresourceids.h" |
|
45 |
||
46 |
// ================= MEMBER FUNCTIONS ======================= |
|
47 |
||
48 |
// C++ default constructor can NOT contain any code, that |
|
49 |
// might leave. |
|
50 |
// |
|
51 |
CPhoneEmergency::CPhoneEmergency( |
|
52 |
MPhoneStateMachine* aStateMachine, |
|
53 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
54 |
MPhoneCustomization* aPhoneCustomization ) : |
|
55 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ), |
|
56 |
iCallSetup( ETrue ) |
|
57 |
{ |
|
58 |
} |
|
59 |
||
60 |
// ----------------------------------------------------------- |
|
61 |
// CPhoneEmergency::~CPhoneEmergency() |
|
62 |
// Destructor |
|
63 |
// (other items were commented in a header). |
|
64 |
// ----------------------------------------------------------- |
|
65 |
||
66 |
CPhoneEmergency::~CPhoneEmergency() |
|
67 |
{ |
|
68 |
} |
|
69 |
||
70 |
// ----------------------------------------------------------- |
|
71 |
// CPhoneEmergency::ConstructL() |
|
72 |
// Constructor |
|
73 |
// (other items were commented in a header). |
|
74 |
// ----------------------------------------------------------- |
|
75 |
// |
|
76 |
void CPhoneEmergency::ConstructL() |
|
77 |
{ |
|
78 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::ConstructL()"); |
|
79 |
CPhoneGsmInCall::ConstructL(); |
|
80 |
} |
|
81 |
||
82 |
// ----------------------------------------------------------- |
|
83 |
// CPhoneEmergency::NewL() |
|
84 |
// Constructor |
|
85 |
// (other items were commented in a header). |
|
86 |
// ----------------------------------------------------------- |
|
87 |
// |
|
88 |
CPhoneEmergency* CPhoneEmergency::NewL( |
|
89 |
MPhoneStateMachine* aStateMachine, |
|
90 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
91 |
MPhoneCustomization* aPhoneCustomization ) |
|
92 |
{ |
|
93 |
CPhoneEmergency* self = new (ELeave) |
|
94 |
CPhoneEmergency( aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
95 |
||
96 |
CleanupStack::PushL( self ); |
|
97 |
self->ConstructL(); |
|
98 |
CleanupStack::Pop( self ); |
|
99 |
||
100 |
return self; |
|
101 |
} |
|
102 |
||
103 |
// ----------------------------------------------------------- |
|
104 |
// CPhoneEmergency::HandleNumberEntryClearedL() |
|
105 |
// ----------------------------------------------------------- |
|
106 |
// |
|
107 |
void CPhoneEmergency::HandleNumberEntryClearedL() |
|
108 |
{ |
|
109 |
__LOGMETHODSTARTEND(EPhoneUIStates, |
|
110 |
"CPhoneEmergency::HandleNumberEntryClearedL()"); |
|
111 |
UpdateInCallCbaL(); |
|
112 |
} |
|
113 |
||
114 |
// ----------------------------------------------------------- |
|
115 |
// CPhoneEmergency::HandlePhoneEngineMessageL |
|
116 |
// ----------------------------------------------------------- |
|
117 |
// |
|
118 |
void CPhoneEmergency::HandlePhoneEngineMessageL( |
|
119 |
const TInt aMessage, |
|
120 |
TInt aCallId ) |
|
121 |
{ |
|
122 |
__LOGMETHODSTARTEND(EPhoneUIStates, |
|
123 |
"CPhoneEmergency::HandlePhoneEngineMessageL() "); |
|
124 |
switch ( aMessage ) |
|
125 |
{ |
|
126 |
case MEngineMonitor::EPEMessageIdle: |
|
127 |
iCallSetup = ETrue; |
|
128 |
HandleIdleL( aCallId ); |
|
129 |
iConnected = EFalse; |
|
130 |
break; |
|
131 |
||
132 |
case MEngineMonitor::EPEMessageDialing: |
|
133 |
HandleDialingL( aCallId ); |
|
134 |
break; |
|
135 |
||
136 |
case MEngineMonitor::EPEMessageConnected: |
|
137 |
if( iCallSetup ) |
|
138 |
{ |
|
139 |
HandleConnectingL( aCallId ); |
|
140 |
iCallSetup = EFalse; |
|
141 |
} |
|
142 |
HandleConnectedL( aCallId ); |
|
143 |
iConnected = ETrue; |
|
144 |
break; |
|
145 |
||
146 |
case MEngineMonitor::EPEMessageConnecting: |
|
147 |
HandleConnectingL( aCallId ); |
|
148 |
iCallSetup = EFalse; |
|
149 |
break; |
|
150 |
||
151 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
152 |
// Explicitly override this handling from CPhoneStateInCall |
|
153 |
// where DTMF sending is cancelled and that causes emergency |
|
154 |
// progress bar destroyed |
|
155 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
156 |
break; |
|
157 |
||
158 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
159 |
if ( iCallSetup ) |
|
160 |
{ |
|
161 |
HandleAudioOutputChangedL(); |
|
162 |
} |
|
163 |
else |
|
164 |
{ |
|
165 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
166 |
} |
|
167 |
break; |
|
168 |
||
169 |
case MEngineMonitor::EPEMessageStoppedDTMF: // fall through |
|
170 |
case MEngineMonitor::EPEMessageSentDTMF: // fall through |
|
171 |
case MEngineMonitor::EPEMessageDTMFSendingAborted: |
|
172 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
173 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
174 |
{ |
|
175 |
TPhoneCmdParamBoolean isProgressNoteVisible; |
|
176 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible, |
|
177 |
&isProgressNoteVisible ); |
|
178 |
||
179 |
if ( !isProgressNoteVisible.Boolean() ) |
|
180 |
{ |
|
181 |
UpdateSetupCbaL(); |
|
182 |
} |
|
183 |
} |
|
184 |
break; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
185 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
186 |
case MEngineMonitor::EPEMessageColpNumberAvailable: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
187 |
//Don't show COLP note during emergency call. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
188 |
break; |
37 | 189 |
|
190 |
default: |
|
191 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( |
|
192 |
aMessage, aCallId ); |
|
193 |
break; |
|
194 |
} |
|
195 |
} |
|
196 |
||
197 |
// ----------------------------------------------------------- |
|
198 |
// CPhoneEmergency::HandleIdleL |
|
199 |
// ----------------------------------------------------------- |
|
200 |
// |
|
201 |
void CPhoneEmergency::HandleIdleL( TInt aCallId ) |
|
202 |
{ |
|
203 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleIdleL() "); |
|
204 |
||
205 |
// Re-enable global notes, this enables secui (if needed) to come on top |
|
206 |
// if call creation was rejected by user |
|
207 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
208 |
globalNotifierParam.SetBoolean( EFalse ); |
|
209 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
210 |
&globalNotifierParam ); |
|
211 |
||
212 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
213 |
{ |
|
214 |
CloseDTMFEditorL(); |
|
215 |
} |
|
216 |
||
217 |
if ( aCallId == KEmergencyCallId ) |
|
218 |
{ |
|
219 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
220 |
// Remove emergency connecting note if still there |
|
221 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
222 |
// Close menu bar, if it is displayed |
|
223 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
224 |
||
225 |
const TBool isSimStateNotPresentWithSecurityMode = IsSimStateNotPresentWithSecurityModeEnabled(); |
|
226 |
||
227 |
// Sim IS not ok when making emergency call from Pin query, no note |
|
228 |
if ( (!IsSimOk() && !iStartupInterrupted) || isSimStateNotPresentWithSecurityMode ) |
|
229 |
{ |
|
230 |
StartShowSecurityNoteL(); |
|
231 |
} |
|
232 |
else |
|
233 |
{ |
|
234 |
if ( !TopAppIsDisplayedL() || iDeviceLockOn ) |
|
235 |
{ |
|
236 |
// Continue displaying current app but set up the |
|
237 |
// idle screen in the background |
|
238 |
SetupIdleScreenInBackgroundL(); |
|
239 |
||
240 |
// Update toolbar |
|
241 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar ); |
|
242 |
} |
|
243 |
||
244 |
else if ( iOnScreenDialer && IsNumberEntryContentStored() ) |
|
245 |
{ |
|
246 |
if ( !IsNumberEntryUsedL() ) |
|
247 |
{ |
|
248 |
CreateNumberEntryL(); |
|
249 |
} |
|
250 |
// Restore the number entry content from cache |
|
251 |
RestoreNumberEntryContentL(); |
|
252 |
SetNumberEntryVisibilityL(ETrue); |
|
253 |
} |
|
254 |
||
255 |
else if ( IsNumberEntryUsedL() ) |
|
256 |
{ |
|
257 |
// Show the number entry if it exists |
|
258 |
SetNumberEntryVisibilityL(ETrue); |
|
259 |
// Update toolbar |
|
260 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar ); |
|
261 |
} |
|
262 |
||
263 |
else |
|
264 |
{ |
|
265 |
// Display idle screen |
|
266 |
DisplayIdleScreenL(); |
|
267 |
} |
|
268 |
||
269 |
// Display call termination note, if necessary |
|
270 |
if ( iConnected ) |
|
271 |
{ |
|
272 |
DisplayCallTerminationNoteL(); |
|
273 |
} |
|
274 |
} |
|
275 |
||
276 |
// Go to emergency idle state or to startup state if emergency call |
|
277 |
// initiated from PIN query |
|
278 |
if ( iStartupInterrupted ) |
|
279 |
{ |
|
280 |
iStartupInterrupted = EFalse; |
|
281 |
iStateMachine->ChangeState( EPhoneStateStartup ); |
|
282 |
} |
|
283 |
else |
|
284 |
{ |
|
285 |
if ( !isSimStateNotPresentWithSecurityMode ) |
|
286 |
{ |
|
287 |
SetDefaultFlagsL(); |
|
288 |
} |
|
289 |
||
290 |
// As long as security note is not shown with feature flag |
|
291 |
// KFeatureIdFfSimlessOfflineSupport undef it is ok to do SetupIdleScreenInBackgroundL. |
|
292 |
if ( ( !IsNumberEntryUsedL() ) && |
|
293 |
!( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
294 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
295 |
{ |
|
296 |
UpdateCbaL( EPhoneEmptyCBA ); |
|
297 |
||
298 |
TPhoneCmdParamBoolean securityMode; |
|
299 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &securityMode ); |
|
300 |
if ( !securityMode.Boolean() ) |
|
301 |
{ |
|
302 |
// Setup idle as next active app. |
|
303 |
SetupIdleScreenInBackgroundL(); |
|
304 |
} |
|
305 |
} |
|
306 |
||
307 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
308 |
} |
|
309 |
} |
|
310 |
else |
|
311 |
{ |
|
312 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
|
313 |
} |
|
314 |
} |
|
315 |
||
316 |
||
317 |
// ----------------------------------------------------------- |
|
318 |
// CPhoneEmergency::HandleDialingL |
|
319 |
// ----------------------------------------------------------- |
|
320 |
// |
|
321 |
void CPhoneEmergency::HandleDialingL( TInt aCallId ) |
|
322 |
{ |
|
323 |
// Discard all messages related to other calls than the emergency call |
|
324 |
// We trust that the ISA call server has taken care of them. However, |
|
325 |
// there could be a race condition between returning to Normal |
|
326 |
// mode (receiving a network registration status message from PE) |
|
327 |
// and receiving an EPEMessageDialling message. This can occur |
|
328 |
// because PE messages are processed asynchronously. |
|
329 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() "); |
|
330 |
||
331 |
if ( aCallId == KPEEmergencyCallId ) |
|
332 |
{ |
|
333 |
if ( !IsSimOk() ) |
|
334 |
{ |
|
335 |
TPhoneCmdParamBoolean visibleMode; |
|
336 |
visibleMode.SetBoolean( ETrue ); |
|
337 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode ); |
|
338 |
} |
|
339 |
||
340 |
iDeviceLockOn = IsAutoLockOn(); |
|
341 |
||
342 |
// Close menu bar, if it is displayed |
|
343 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
344 |
||
345 |
// Disable global notes when the phone is dialling |
|
346 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
347 |
globalNotifierParam.SetBoolean( ETrue ); |
|
348 |
iViewCommandHandle->ExecuteCommandL( |
|
349 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
350 |
&globalNotifierParam ); |
|
351 |
||
352 |
// Capture keys when the phone is dialling |
|
353 |
CaptureKeysDuringCallNotificationL( ETrue ); |
|
354 |
||
355 |
// Indicate that the Phone needs to be sent to the background if |
|
356 |
// an application other than the top application is in the foreground |
|
357 |
TPhoneCmdParamBoolean booleanParam; |
|
358 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
359 |
iViewCommandHandle->ExecuteCommandL( |
|
360 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
361 |
&booleanParam ); |
|
362 |
||
363 |
// Bring Phone app in the foreground |
|
364 |
TPhoneCmdParamInteger uidParam; |
|
365 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
366 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
367 |
&uidParam ); |
|
368 |
||
369 |
// Set Phone as the top application |
|
370 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
371 |
&uidParam ); |
|
372 |
||
373 |
// Hide the number entry if it is visible |
|
374 |
if ( IsNumberEntryUsedL() ) |
|
375 |
{ |
|
376 |
// Remove number entry |
|
377 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
378 |
} |
|
379 |
||
380 |
// Remove exit emergency mode query, if it exists |
|
381 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
382 |
||
383 |
// Enable the volume display |
|
384 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume ); |
|
385 |
||
386 |
BeginUiUpdateLC(); |
|
387 |
||
388 |
TPhoneCmdParamEmergencyCallHeaderData emergencyHeaderParam; |
|
389 |
// Set call header |
|
390 |
TBuf<KPhoneCallHeaderLabelMaxLength> headerText( KNullDesC ); |
|
391 |
StringLoader::Load( |
|
392 |
headerText, |
|
393 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
394 |
EPhoneEmergencyCallHeader ), |
|
395 |
CCoeEnv::Static() ); |
|
396 |
emergencyHeaderParam.SetHeaderText( headerText ); |
|
397 |
||
398 |
// Set call header ciphering status |
|
399 |
emergencyHeaderParam.SetCiphering( |
|
400 |
iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) ); |
|
401 |
emergencyHeaderParam.SetCipheringIndicatorAllowed( |
|
402 |
iStateMachine->PhoneEngineInfo()->SecureSpecified() ); |
|
403 |
||
404 |
// Notify the view |
|
405 |
iViewCommandHandle->ExecuteCommandL( |
|
406 |
EPhoneViewCreateEmergencyCallHeader, |
|
407 |
aCallId, |
|
408 |
&emergencyHeaderParam ); |
|
409 |
||
410 |
TPhoneCmdParamCallHeaderData headerParam; |
|
411 |
headerParam.SetCallState( EPEStateDialing ); |
|
412 |
||
413 |
StringLoader::Load( |
|
414 |
headerText, |
|
415 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
416 |
EPhoneAttemptingEmergencyText ), |
|
417 |
CCoeEnv::Static() ); |
|
418 |
headerParam.SetLabelText( headerText ); |
|
419 |
||
420 |
iViewCommandHandle->ExecuteCommandL( |
|
421 |
EPhoneViewUpdateBubble, |
|
422 |
aCallId, |
|
423 |
&headerParam ); |
|
424 |
||
425 |
SetTouchPaneButtons( EPhoneEmergencyCallButtons ); |
|
426 |
SetBackButtonActive(EFalse); |
|
427 |
||
428 |
EndUiUpdate(); |
|
429 |
||
430 |
// ShowNoteL( EPhoneEmergencyConnectWaitNote ); |
|
431 |
UpdateSetupCbaL(); |
|
432 |
} |
|
433 |
} |
|
434 |
// ----------------------------------------------------------- |
|
435 |
// CPhoneEmergency::HandleConnectingL |
|
436 |
// ----------------------------------------------------------- |
|
437 |
// |
|
438 |
void CPhoneEmergency::HandleConnectingL( TInt aCallId ) |
|
439 |
{ |
|
440 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectingL() "); |
|
441 |
||
442 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
443 |
||
444 |
// Re-enable global notes |
|
445 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
446 |
globalNotifierParam.SetBoolean( EFalse ); |
|
447 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
448 |
&globalNotifierParam ); |
|
449 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
450 |
&globalNotifierParam ); |
|
451 |
||
452 |
if( TouchCallHandlingSupported() ) |
|
453 |
{ |
|
454 |
if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
455 |
{ |
|
456 |
// Stop capturing keys |
|
457 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
458 |
} |
|
459 |
} |
|
460 |
else if ( !iDeviceLockOn && SimState() == EPESimUsable ) |
|
461 |
{ |
|
462 |
// Stop capturing keys |
|
463 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
464 |
} |
|
465 |
||
466 |
// Keep Phone in the foreground |
|
467 |
TPhoneCmdParamBoolean booleanParam; |
|
468 |
booleanParam.SetBoolean( EFalse ); |
|
469 |
iViewCommandHandle->ExecuteCommandL( |
|
470 |
EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
471 |
||
472 |
// Remove emergency connecting note |
|
473 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
474 |
||
475 |
TPhoneCmdParamCallHeaderData headerParam; |
|
476 |
headerParam.SetCallState( EPEStateConnecting ); |
|
477 |
// Notify the view |
|
478 |
iViewCommandHandle->ExecuteCommandL( |
|
479 |
EPhoneViewUpdateBubble, |
|
480 |
aCallId, |
|
481 |
&headerParam ); |
|
482 |
||
483 |
SetToolbarButtonLoudspeakerEnabled(); |
|
484 |
||
485 |
UpdateInCallCbaL(); |
|
486 |
} |
|
487 |
||
488 |
// ----------------------------------------------------------- |
|
489 |
// CPhoneEmergency::HandleConnectedL |
|
490 |
// ----------------------------------------------------------- |
|
491 |
// |
|
492 |
void CPhoneEmergency::HandleConnectedL( TInt aCallId ) |
|
493 |
{ |
|
494 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectedL() "); |
|
495 |
||
496 |
BeginUiUpdateLC(); |
|
497 |
||
498 |
TPhoneCmdParamCallHeaderData emergencyHeaderParam; |
|
499 |
emergencyHeaderParam.SetCallState( EPEStateConnected ); |
|
500 |
// Notify the view |
|
501 |
iViewCommandHandle->ExecuteCommandL( |
|
502 |
EPhoneViewUpdateBubble, |
|
503 |
aCallId, |
|
504 |
&emergencyHeaderParam ); |
|
505 |
||
506 |
SetBackButtonActive(ETrue); |
|
507 |
||
508 |
EndUiUpdate(); |
|
509 |
SetToolbarDimming( ETrue ); |
|
510 |
UpdateInCallCbaL(); |
|
511 |
} |
|
512 |
||
513 |
// ----------------------------------------------------------- |
|
514 |
// CPhoneEmergency::OpenMenuBarL |
|
515 |
// ----------------------------------------------------------- |
|
516 |
// |
|
517 |
void CPhoneEmergency::OpenMenuBarL() |
|
518 |
{ |
|
519 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::OpenMenuBarL() "); |
|
520 |
TInt resourceId; |
|
521 |
||
522 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
523 |
{ |
|
524 |
resourceId = EPhoneDtmfDialerMenubar; |
|
525 |
} |
|
526 |
else if ( IsNumberEntryVisibleL() ) |
|
527 |
{ |
|
528 |
resourceId = EPhoneCallHandlingEmergencyMenubarWithNumberEntry; |
|
529 |
} |
|
530 |
else |
|
531 |
{ |
|
532 |
resourceId = EPhoneCallHandlingEmergencyMenubar; |
|
533 |
} |
|
534 |
||
535 |
TPhoneCmdParamInteger integerParam; |
|
536 |
integerParam.SetInteger( |
|
537 |
CPhoneMainResourceResolver::Instance()-> |
|
538 |
ResolveResourceID( resourceId ) ); |
|
539 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
540 |
&integerParam ); |
|
541 |
} |
|
542 |
||
543 |
||
544 |
// ----------------------------------------------------------- |
|
545 |
// CPhoneEmergency::UpdateInCallCbaL |
|
546 |
// ----------------------------------------------------------- |
|
547 |
// |
|
548 |
void CPhoneEmergency::UpdateInCallCbaL() |
|
549 |
{ |
|
550 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateInCallCbaL() "); |
|
551 |
TInt resourceId = EPhoneCallHandlingEmergencyCBA; |
|
552 |
iCbaManager->SetCbaL( resourceId ); |
|
553 |
} |
|
554 |
||
555 |
// -------------------------------------------------------------- |
|
556 |
// CPhoneEmergency::HandleKeyMessageL |
|
557 |
// -------------------------------------------------------------- |
|
558 |
// |
|
559 |
void CPhoneEmergency::HandleKeyMessageL( |
|
560 |
TPhoneKeyEventMessages aMessage, |
|
561 |
TKeyCode aCode ) |
|
562 |
{ |
|
563 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyMessageL()"); |
|
564 |
||
565 |
switch ( aCode ) |
|
566 |
{ |
|
567 |
// end-key |
|
568 |
case EKeyNo: |
|
569 |
// handle end key |
|
570 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
571 |
{ |
|
572 |
CloseDTMFEditorL(); |
|
573 |
} |
|
574 |
DisconnectEmergencyCallL(); |
|
575 |
break; |
|
576 |
||
577 |
// send-key |
|
578 |
case EKeyYes: |
|
579 |
if( iOnScreenDialer && IsNumberEntryVisibleL() ) |
|
580 |
{ |
|
581 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
582 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
583 |
&numberEntryCountParam ); |
|
584 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
585 |
if ( neLength ) |
|
586 |
{ |
|
587 |
// Show not allowed note |
|
588 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed ); |
|
589 |
} |
|
590 |
else |
|
591 |
{ |
|
592 |
// Logs to open |
|
593 |
CallFromNumberEntryL(); |
|
594 |
} |
|
595 |
} |
|
596 |
else |
|
597 |
{ |
|
598 |
// Show not allowed note |
|
599 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed ); |
|
600 |
} |
|
601 |
break; |
|
602 |
||
603 |
default: |
|
604 |
{ |
|
605 |
if ( TouchCallHandlingSupported() ) |
|
606 |
{ |
|
607 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
608 |
} |
|
609 |
else if ( !iDeviceLockOn && SimState() == EPESimUsable ) |
|
610 |
{ |
|
611 |
// do base operation |
|
612 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
613 |
} |
|
614 |
break; |
|
615 |
} |
|
616 |
} |
|
617 |
} |
|
618 |
||
619 |
// ----------------------------------------------------------- |
|
620 |
// CPhoneEmergency::HandleCommandL |
|
621 |
// ----------------------------------------------------------- |
|
622 |
// |
|
623 |
TBool CPhoneEmergency::HandleCommandL( TInt aCommand ) |
|
624 |
{ |
|
625 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleCommandL()"); |
|
626 |
TBool commandStatus = ETrue; |
|
627 |
||
628 |
switch( aCommand ) |
|
629 |
{ |
|
630 |
case EPhoneInCallCmdDtmfManualQuery: |
|
631 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
632 |
{ |
|
633 |
// Remove emergency connecting note |
|
634 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
635 |
} |
|
636 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
637 |
break; |
|
638 |
||
639 |
case EPhoneDtmfDialerExit: // fall through |
|
640 |
case EPhoneDtmfDialerCancel: |
|
641 |
{ |
|
642 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
643 |
{ |
|
644 |
CloseDTMFEditorL(); |
|
645 |
||
646 |
TPhoneCmdParamBoolean isProgressNoteVisible; |
|
647 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible, |
|
648 |
&isProgressNoteVisible ); |
|
649 |
||
650 |
if ( !isProgressNoteVisible.Boolean() ) |
|
651 |
{ |
|
652 |
UpdateSetupCbaL(); |
|
653 |
} |
|
654 |
} |
|
655 |
else |
|
656 |
{ |
|
657 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
658 |
} |
|
659 |
} |
|
660 |
break; |
|
661 |
||
662 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
663 |
case EPhoneInCallCmdEndThisActiveCall: |
|
664 |
DisconnectEmergencyCallL(); |
|
665 |
break; |
|
666 |
||
667 |
default: |
|
668 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
669 |
break; |
|
670 |
} |
|
671 |
||
672 |
return commandStatus; |
|
673 |
} |
|
674 |
||
675 |
// ----------------------------------------------------------- |
|
676 |
// CPhoneEmergency::DisconnectEmergencyCallL |
|
677 |
// ----------------------------------------------------------- |
|
678 |
// |
|
679 |
void CPhoneEmergency::DisconnectEmergencyCallL() |
|
680 |
{ |
|
681 |
__LOGMETHODSTARTEND(EPhoneUIStates, |
|
682 |
"CPhoneEmergency::DisconnectEmergencyCallL()"); |
|
683 |
// Release the call |
|
684 |
iStateMachine->SetCallId( |
|
685 |
KEmergencyCallId ); |
|
686 |
iStateMachine->SendPhoneEngineMessage( |
|
687 |
CPEPhoneModelIF::EPEMessageRelease ); |
|
688 |
} |
|
689 |
||
690 |
// ----------------------------------------------------------- |
|
691 |
// CPhoneEmergency::HandleErrorL |
|
692 |
// Emergency handling for HandleError message |
|
693 |
// (other items were commented in a header). |
|
694 |
// ----------------------------------------------------------- |
|
695 |
// |
|
696 |
void CPhoneEmergency::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
697 |
{ |
|
698 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleError()"); |
|
699 |
||
700 |
switch( aErrorInfo.iErrorCode ) |
|
701 |
{ |
|
702 |
case ECCPErrorCCNoRouteToDestination: |
|
703 |
case ECCPErrorUnacceptableChannel: |
|
704 |
case ECCPErrorCCDestinationOutOfOrder: |
|
705 |
case ECCPErrorNetworkOutOfOrder: |
|
706 |
case ECCPErrorAccessInformationDiscarded: |
|
707 |
case ECCPErrorCCResourceNotAvailable: |
|
708 |
case ECCPErrorQualityOfServiceNotAvailable: |
|
709 |
case ECCPErrorInvalidCallReferenceValue: |
|
710 |
case ECCPErrorBadRequest: |
|
711 |
case ECCPErrorConnectionError: |
|
712 |
case ECCPErrorCCIncompatibleMessageInProtocolState: |
|
713 |
case ECCPErrorCCNoChannelAvailable: |
|
714 |
case ECCPErrorNetworkBusy: |
|
715 |
case ECCPEmergencyFailed: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
716 |
SendGlobalErrorNoteL( EPhoneNoteNoNetworkCallEmergency, ETrue ); |
37 | 717 |
break; |
718 |
||
719 |
default: |
|
720 |
__PHONELOG1( |
|
721 |
EOnlyFatal, |
|
722 |
EPhoneUIStates, |
|
723 |
"PHONEUI_ERROR: CPhoneEmergency::HandleError - Error send to PhoneState (err=%d)", |
|
724 |
aErrorInfo.iErrorCode); |
|
725 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
726 |
break; |
|
727 |
} |
|
728 |
} |
|
729 |
||
730 |
// ----------------------------------------------------------- |
|
731 |
// CPhoneEmergency::HandleKeyEventL |
|
732 |
// ----------------------------------------------------------- |
|
733 |
// |
|
734 |
void CPhoneEmergency::HandleKeyEventL( |
|
735 |
const TKeyEvent& aKeyEvent, |
|
736 |
TEventCode aEventCode ) |
|
737 |
{ |
|
738 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) "); |
|
739 |
||
740 |
if ( TouchCallHandlingSupported() ) |
|
741 |
{ |
|
742 |
CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
|
743 |
} |
|
744 |
else |
|
745 |
{ |
|
746 |
if ( iDeviceLockOn && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) ) |
|
747 |
{ |
|
748 |
// Send the key event to the phone engine |
|
749 |
SendKeyEventL( aKeyEvent, aEventCode ); |
|
750 |
} |
|
751 |
else |
|
752 |
{ |
|
753 |
// Handle numeric keys when key events are received in idle state |
|
754 |
CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
|
755 |
} |
|
756 |
} |
|
757 |
} |
|
758 |
||
759 |
// ----------------------------------------------------------- |
|
760 |
// CPhoneEmergency::SendKeyEventL |
|
761 |
// ----------------------------------------------------------- |
|
762 |
// |
|
763 |
void CPhoneEmergency::SendKeyEventL( |
|
764 |
const TKeyEvent& aKeyEvent, |
|
765 |
TEventCode aEventCode ) |
|
766 |
{ |
|
767 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::SendKeyEventL( ) "); |
|
768 |
switch( aEventCode ) |
|
769 |
{ |
|
770 |
// EEventKey |
|
771 |
case EEventKey: |
|
772 |
{ |
|
773 |
// Convert key code to western. |
|
774 |
TBuf<1> buffer; // one character |
|
775 |
buffer.Append( aKeyEvent.iCode ); |
|
776 |
__PHONELOG1( EBasic, EPhoneControl, |
|
777 |
"CPhoneEmergency::SendKeyEventL(%S)", |
|
778 |
&buffer ); |
|
779 |
AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
780 |
__PHONELOG1( EBasic, EPhoneControl, |
|
781 |
"CPhoneEmergency::SendKeyEventL(%S)", |
|
782 |
&buffer ); |
|
783 |
TLex code( buffer ); |
|
784 |
// Save the key code |
|
785 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
786 |
// Plays a DTMF tone if active call |
|
787 |
iStateMachine->SendPhoneEngineMessage( |
|
788 |
CPEPhoneModelIF::EPEMessagePlayDTMF ); |
|
789 |
} |
|
790 |
break; |
|
791 |
// EEventKeyUp |
|
792 |
case EEventKeyUp: |
|
793 |
// Send a key up event for the last key code sent to |
|
794 |
// the phone engine |
|
795 |
iStateMachine->SendPhoneEngineMessage( |
|
796 |
CPEPhoneModelIF::EPEMessageEndDTMF ); |
|
797 |
break; |
|
798 |
default: |
|
799 |
break; |
|
800 |
} |
|
801 |
} |
|
802 |
||
803 |
// ----------------------------------------------------------------------------- |
|
804 |
// CPhoneEmergency::HandleAudioOutputChangedL |
|
805 |
// for setup |
|
806 |
// ----------------------------------------------------------------------------- |
|
807 |
// |
|
808 |
void CPhoneEmergency::HandleAudioOutputChangedL() |
|
809 |
{ |
|
810 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::HandleAudioOutputChangedL( ) "); |
|
811 |
||
812 |
// Audio Output |
|
813 |
TPhoneCmdParamAudioOutput outputParam; |
|
814 |
||
815 |
// Output |
|
816 |
const TPEAudioOutput audioOutput = |
|
817 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
|
818 |
||
819 |
UpdateSetupCbaL(); |
|
820 |
||
821 |
// view update |
|
822 |
outputParam.SetAudioOutput( audioOutput ); |
|
823 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioPathUIChanges, |
|
824 |
&outputParam ); |
|
825 |
||
826 |
} |
|
827 |
||
828 |
// ----------------------------------------------------------------------------- |
|
829 |
// CPhoneEmergency::SetStartupInterrupted |
|
830 |
// ----------------------------------------------------------------------------- |
|
831 |
// |
|
832 |
void CPhoneEmergency::SetStartupInterrupted( const TBool aStartupInterrupted ) |
|
833 |
{ |
|
834 |
iStartupInterrupted = aStartupInterrupted; |
|
835 |
} |
|
836 |
||
837 |
// ----------------------------------------------------------- |
|
838 |
// CPhoneEmergency::UpdateSetupCbaL |
|
839 |
// ----------------------------------------------------------- |
|
840 |
// |
|
841 |
void CPhoneEmergency::UpdateSetupCbaL() |
|
842 |
{ |
|
843 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() "); |
|
844 |
TInt resourceId = EPhoneCallHandlingEmergencyCBA; |
|
845 |
iCbaManager->SetCbaL( resourceId ); |
|
846 |
} |
|
847 |
||
848 |
// --------------------------------------------------------- |
|
849 |
// CPhoneEmergency::HandleCreateNumberEntryL |
|
850 |
// |
|
851 |
// --------------------------------------------------------- |
|
852 |
// |
|
853 |
void CPhoneEmergency::HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent, |
|
854 |
TEventCode aEventCode ) |
|
855 |
{ |
|
856 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneEmergency::HandleCreateNumberEntryL() "); |
|
857 |
if ( !iCallSetup && !iStartupInterrupted ) |
|
858 |
{ |
|
859 |
CPhoneGsmInCall::HandleCreateNumberEntryL( aKeyEvent, aEventCode ); |
|
860 |
} |
|
861 |
||
862 |
} |
|
863 |
||
864 |
// ----------------------------------------------------------------------------- |
|
865 |
// CPhoneEmergency::HandleRemConCommandL |
|
866 |
// ----------------------------------------------------------------------------- |
|
867 |
// |
|
868 |
EXPORT_C TBool CPhoneEmergency::HandleRemConCommandL( |
|
869 |
TRemConCoreApiOperationId aOperationId, |
|
870 |
TRemConCoreApiButtonAction aButtonAct ) |
|
871 |
{ |
|
872 |
TBool handled = EFalse; |
|
873 |
||
874 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::MrccatoCommand() "); |
|
875 |
||
876 |
switch ( aOperationId ) |
|
877 |
{ |
|
878 |
case ERemConCoreApiMute: |
|
879 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneEmergency::MrccatoCommand emerg. call no muting" ); |
|
880 |
// Not Allowed |
|
881 |
break; |
|
882 |
default: |
|
883 |
handled = CPhoneState::HandleRemConCommandL( aOperationId, aButtonAct ); |
|
884 |
break; |
|
885 |
} |
|
886 |
return handled; |
|
887 |
} |
|
888 |
||
889 |
// -------------------------------------------------------------- |
|
890 |
// CPhoneEmergency::TouchCallHandlingSupported |
|
891 |
// -------------------------------------------------------------- |
|
892 |
// |
|
893 |
TBool CPhoneEmergency::TouchCallHandlingSupported () const |
|
894 |
{ |
|
895 |
if ( FeatureManager::FeatureSupported ( KFeatureIdTouchCallHandling ) ) |
|
896 |
{ |
|
897 |
return ETrue; |
|
898 |
} |
|
899 |
else |
|
900 |
{ |
|
901 |
return EFalse; |
|
902 |
} |
|
903 |
} |
|
904 |
||
905 |
// -------------------------------------------------------------- |
|
906 |
// CPhoneEmergency::UseEmergencyNoIhfCBA |
|
907 |
// -------------------------------------------------------------- |
|
908 |
// |
|
909 |
TBool CPhoneEmergency::UseEmergencyNoIhfCBA( const TPEAudioOutput& aAudioOutput ) const |
|
910 |
{ |
|
911 |
if ( !( TouchCallHandlingSupported() ) |
|
912 |
&& ( ( aAudioOutput == EPEWiredAudioAccessory ) || ( IsSwivelClosed() ) ) ) |
|
913 |
{ |
|
914 |
return ETrue; |
|
915 |
} |
|
916 |
else |
|
917 |
{ |
|
918 |
return EFalse; |
|
919 |
} |
|
920 |
} |
|
921 |
||
922 |
// -------------------------------------------------------------- |
|
923 |
// CPhoneEmergency::UseHandsetEmergencyCBA |
|
924 |
// -------------------------------------------------------------- |
|
925 |
// |
|
926 |
TBool CPhoneEmergency::UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const |
|
927 |
{ |
|
928 |
if ( !( TouchCallHandlingSupported() ) |
|
929 |
&& ( ( aAudioOutput == EPELoudspeaker ) || ( aAudioOutput == EPEBTAudioAccessory ) ) ) |
|
930 |
{ |
|
931 |
return ETrue; |
|
932 |
} |
|
933 |
else |
|
934 |
{ |
|
935 |
return EFalse; |
|
936 |
} |
|
937 |
} |
|
938 |
||
939 |
// End of File |