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