author | hgs |
Fri, 17 Sep 2010 17:09:12 +0300 | |
changeset 74 | d1c62c765e48 |
parent 65 | 2a5d4ab426d3 |
child 76 | cfea66083b62 |
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> |
|
74 | 26 |
|
37 | 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()"); |
|
74 | 112 |
UpdateUiCommands(); |
37 | 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 |
// Re-enable global notes, this enables secui (if needed) to come on top |
|
199 |
// if call creation was rejected by user |
|
200 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
201 |
globalNotifierParam.SetBoolean( EFalse ); |
|
202 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
203 |
&globalNotifierParam ); |
|
204 |
||
205 |
if ( aCallId == KEmergencyCallId ) |
|
206 |
{ |
|
207 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
208 |
// Remove emergency connecting note if still there |
|
209 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
210 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
211 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
212 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
213 |
iViewCommandHandle->ExecuteCommand( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
214 |
EPhoneViewStopCapturingKey, &captureParam ); |
37 | 215 |
|
74 | 216 |
SetBackButtonActive(ETrue); |
217 |
||
37 | 218 |
const TBool isSimStateNotPresentWithSecurityMode = IsSimStateNotPresentWithSecurityModeEnabled(); |
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 |
{ |
|
74 | 226 |
if ( iDeviceLockOn ) |
37 | 227 |
{ |
228 |
// Continue displaying current app but set up the |
|
229 |
// idle screen in the background |
|
74 | 230 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 231 |
} |
232 |
||
74 | 233 |
else if ( iNumberEntryManager->IsNumberEntryContentStored() || |
234 |
iNumberEntryManager->IsNumberEntryUsedL() ) |
|
37 | 235 |
{ |
74 | 236 |
iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
37 | 237 |
} |
65 | 238 |
|
37 | 239 |
else |
240 |
{ |
|
74 | 241 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 242 |
} |
243 |
||
244 |
if ( iConnected ) |
|
245 |
{ |
|
246 |
DisplayCallTerminationNoteL(); |
|
247 |
} |
|
248 |
} |
|
249 |
||
250 |
// Go to emergency idle state or to startup state if emergency call |
|
251 |
// initiated from PIN query |
|
252 |
if ( iStartupInterrupted ) |
|
253 |
{ |
|
254 |
iStartupInterrupted = EFalse; |
|
255 |
iStateMachine->ChangeState( EPhoneStateStartup ); |
|
256 |
} |
|
257 |
else |
|
258 |
{ |
|
259 |
if ( !isSimStateNotPresentWithSecurityMode ) |
|
260 |
{ |
|
261 |
SetDefaultFlagsL(); |
|
262 |
} |
|
263 |
||
264 |
// As long as security note is not shown with feature flag |
|
74 | 265 |
// KFeatureIdFfSimlessOfflineSupport undef it is ok to do RemoveDialogsAndSendPhoneToBackgroundL. |
266 |
if ( ( !iNumberEntryManager->IsNumberEntryUsedL() ) && |
|
37 | 267 |
!( IsSimStateNotPresentWithSecurityModeEnabled() && |
268 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
269 |
{ |
|
270 |
TPhoneCmdParamBoolean securityMode; |
|
271 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &securityMode ); |
|
272 |
if ( !securityMode.Boolean() ) |
|
273 |
{ |
|
74 | 274 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 275 |
} |
276 |
} |
|
277 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
278 |
} |
|
279 |
} |
|
280 |
else |
|
281 |
{ |
|
282 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
|
283 |
} |
|
284 |
} |
|
285 |
||
286 |
// ----------------------------------------------------------- |
|
287 |
// CPhoneEmergency::HandleDialingL |
|
288 |
// ----------------------------------------------------------- |
|
289 |
// |
|
290 |
void CPhoneEmergency::HandleDialingL( TInt aCallId ) |
|
291 |
{ |
|
292 |
// Discard all messages related to other calls than the emergency call |
|
293 |
// We trust that the ISA call server has taken care of them. However, |
|
294 |
// there could be a race condition between returning to Normal |
|
295 |
// mode (receiving a network registration status message from PE) |
|
296 |
// and receiving an EPEMessageDialling message. This can occur |
|
297 |
// because PE messages are processed asynchronously. |
|
298 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() "); |
|
299 |
if ( aCallId == KPEEmergencyCallId ) |
|
300 |
{ |
|
301 |
iDeviceLockOn = IsAutoLockOn(); |
|
302 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
303 |
globalNotifierParam.SetBoolean( ETrue ); |
|
304 |
iViewCommandHandle->ExecuteCommandL( |
|
305 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
306 |
&globalNotifierParam ); |
|
307 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
308 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
309 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
310 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
311 |
|
74 | 312 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
313 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
|
37 | 314 |
{ |
315 |
// Remove number entry |
|
316 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
317 |
} |
|
318 |
||
319 |
// Remove exit emergency mode query, if it exists |
|
320 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
321 |
||
322 |
BeginUiUpdateLC(); |
|
323 |
||
324 |
// Notify the view |
|
325 |
iViewCommandHandle->ExecuteCommandL( |
|
326 |
EPhoneViewCreateEmergencyCallHeader, |
|
74 | 327 |
aCallId ); |
328 |
||
37 | 329 |
SetBackButtonActive(EFalse); |
65 | 330 |
EndUiUpdate(); |
37 | 331 |
UpdateSetupCbaL(); |
332 |
} |
|
333 |
} |
|
334 |
// ----------------------------------------------------------- |
|
335 |
// CPhoneEmergency::HandleConnectingL |
|
336 |
// ----------------------------------------------------------- |
|
337 |
// |
|
338 |
void CPhoneEmergency::HandleConnectingL( TInt aCallId ) |
|
339 |
{ |
|
340 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectingL() "); |
|
341 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
342 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
343 |
globalNotifierParam.SetBoolean( EFalse ); |
|
344 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
345 |
&globalNotifierParam ); |
|
346 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
347 |
&globalNotifierParam ); |
|
65 | 348 |
|
37 | 349 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
350 |
||
351 |
// Notify the view |
|
352 |
iViewCommandHandle->ExecuteCommandL( |
|
353 |
EPhoneViewUpdateBubble, |
|
74 | 354 |
aCallId ); |
37 | 355 |
|
356 |
SetToolbarButtonLoudspeakerEnabled(); |
|
74 | 357 |
UpdateUiCommands(); |
37 | 358 |
} |
359 |
||
360 |
// ----------------------------------------------------------- |
|
361 |
// CPhoneEmergency::HandleConnectedL |
|
362 |
// ----------------------------------------------------------- |
|
363 |
// |
|
364 |
void CPhoneEmergency::HandleConnectedL( TInt aCallId ) |
|
365 |
{ |
|
366 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectedL() "); |
|
367 |
BeginUiUpdateLC(); |
|
368 |
iViewCommandHandle->ExecuteCommandL( |
|
369 |
EPhoneViewUpdateBubble, |
|
74 | 370 |
aCallId ); |
37 | 371 |
SetBackButtonActive(ETrue); |
74 | 372 |
UpdateUiCommands(); |
37 | 373 |
EndUiUpdate(); |
374 |
} |
|
375 |
||
376 |
// -------------------------------------------------------------- |
|
377 |
// CPhoneEmergency::HandleKeyMessageL |
|
378 |
// -------------------------------------------------------------- |
|
379 |
// |
|
380 |
void CPhoneEmergency::HandleKeyMessageL( |
|
381 |
TPhoneKeyEventMessages aMessage, |
|
382 |
TKeyCode aCode ) |
|
383 |
{ |
|
384 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyMessageL()"); |
|
385 |
switch ( aCode ) |
|
386 |
{ |
|
65 | 387 |
case EKeyNo: // end-key |
37 | 388 |
DisconnectEmergencyCallL(); |
389 |
break; |
|
390 |
||
65 | 391 |
case EKeyYes: // send-key |
74 | 392 |
if( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 393 |
{ |
394 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
65 | 395 |
iViewCommandHandle->ExecuteCommandL( |
396 |
EPhoneViewGetNumberEntryCount, |
|
37 | 397 |
&numberEntryCountParam ); |
65 | 398 |
TInt neLength( numberEntryCountParam.Integer() ); |
37 | 399 |
if ( neLength ) |
400 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
401 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 402 |
} |
403 |
else |
|
404 |
{ |
|
74 | 405 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 406 |
} |
407 |
} |
|
408 |
else |
|
409 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
410 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 411 |
} |
412 |
break; |
|
413 |
||
414 |
default: |
|
415 |
{ |
|
65 | 416 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
37 | 417 |
break; |
418 |
} |
|
419 |
} |
|
420 |
} |
|
421 |
||
422 |
// ----------------------------------------------------------- |
|
423 |
// CPhoneEmergency::HandleCommandL |
|
424 |
// ----------------------------------------------------------- |
|
425 |
// |
|
426 |
TBool CPhoneEmergency::HandleCommandL( TInt aCommand ) |
|
427 |
{ |
|
428 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleCommandL()"); |
|
429 |
TBool commandStatus = ETrue; |
|
430 |
switch( aCommand ) |
|
431 |
{ |
|
432 |
case EPhoneInCallCmdDtmfManualQuery: |
|
433 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
434 |
{ |
|
435 |
// Remove emergency connecting note |
|
436 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
437 |
} |
|
438 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
439 |
break; |
|
440 |
||
441 |
case EPhoneDtmfDialerExit: // fall through |
|
442 |
case EPhoneDtmfDialerCancel: |
|
443 |
{ |
|
444 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
445 |
{ |
|
50 | 446 |
UpdateSetupCbaL(); |
37 | 447 |
} |
448 |
else |
|
449 |
{ |
|
450 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
451 |
} |
|
452 |
} |
|
453 |
break; |
|
454 |
||
455 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
456 |
case EPhoneInCallCmdEndThisActiveCall: |
|
457 |
DisconnectEmergencyCallL(); |
|
458 |
break; |
|
459 |
||
460 |
default: |
|
461 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
462 |
break; |
|
463 |
} |
|
464 |
return commandStatus; |
|
465 |
} |
|
466 |
||
467 |
// ----------------------------------------------------------- |
|
468 |
// CPhoneEmergency::DisconnectEmergencyCallL |
|
469 |
// ----------------------------------------------------------- |
|
470 |
// |
|
471 |
void CPhoneEmergency::DisconnectEmergencyCallL() |
|
472 |
{ |
|
473 |
__LOGMETHODSTARTEND(EPhoneUIStates, |
|
474 |
"CPhoneEmergency::DisconnectEmergencyCallL()"); |
|
65 | 475 |
iStateMachine->SetCallId( KEmergencyCallId ); |
37 | 476 |
iStateMachine->SendPhoneEngineMessage( |
477 |
CPEPhoneModelIF::EPEMessageRelease ); |
|
478 |
} |
|
479 |
||
480 |
// ----------------------------------------------------------- |
|
481 |
// CPhoneEmergency::HandleErrorL |
|
482 |
// Emergency handling for HandleError message |
|
483 |
// (other items were commented in a header). |
|
484 |
// ----------------------------------------------------------- |
|
485 |
// |
|
486 |
void CPhoneEmergency::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
487 |
{ |
|
488 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleError()"); |
|
489 |
||
490 |
switch( aErrorInfo.iErrorCode ) |
|
491 |
{ |
|
492 |
case ECCPErrorCCNoRouteToDestination: |
|
493 |
case ECCPErrorUnacceptableChannel: |
|
494 |
case ECCPErrorCCDestinationOutOfOrder: |
|
495 |
case ECCPErrorNetworkOutOfOrder: |
|
496 |
case ECCPErrorAccessInformationDiscarded: |
|
497 |
case ECCPErrorCCResourceNotAvailable: |
|
498 |
case ECCPErrorQualityOfServiceNotAvailable: |
|
499 |
case ECCPErrorInvalidCallReferenceValue: |
|
500 |
case ECCPErrorBadRequest: |
|
501 |
case ECCPErrorConnectionError: |
|
502 |
case ECCPErrorCCIncompatibleMessageInProtocolState: |
|
503 |
case ECCPErrorCCNoChannelAvailable: |
|
504 |
case ECCPErrorNetworkBusy: |
|
505 |
case ECCPEmergencyFailed: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
506 |
SendGlobalErrorNoteL( EPhoneNoteNoNetworkCallEmergency, ETrue ); |
37 | 507 |
break; |
508 |
||
509 |
default: |
|
510 |
__PHONELOG1( |
|
511 |
EOnlyFatal, |
|
512 |
EPhoneUIStates, |
|
513 |
"PHONEUI_ERROR: CPhoneEmergency::HandleError - Error send to PhoneState (err=%d)", |
|
514 |
aErrorInfo.iErrorCode); |
|
515 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
516 |
break; |
|
517 |
} |
|
518 |
} |
|
519 |
||
520 |
// ----------------------------------------------------------- |
|
521 |
// CPhoneEmergency::HandleKeyEventL |
|
522 |
// ----------------------------------------------------------- |
|
523 |
// |
|
524 |
void CPhoneEmergency::HandleKeyEventL( |
|
525 |
const TKeyEvent& aKeyEvent, |
|
526 |
TEventCode aEventCode ) |
|
527 |
{ |
|
528 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) "); |
|
65 | 529 |
CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
37 | 530 |
} |
531 |
||
532 |
// ----------------------------------------------------------- |
|
533 |
// CPhoneEmergency::SendKeyEventL |
|
534 |
// ----------------------------------------------------------- |
|
535 |
// |
|
536 |
void CPhoneEmergency::SendKeyEventL( |
|
537 |
const TKeyEvent& aKeyEvent, |
|
538 |
TEventCode aEventCode ) |
|
539 |
{ |
|
540 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::SendKeyEventL( ) "); |
|
541 |
switch( aEventCode ) |
|
542 |
{ |
|
543 |
case EEventKey: |
|
544 |
{ |
|
545 |
// Convert key code to western. |
|
546 |
TBuf<1> buffer; // one character |
|
547 |
buffer.Append( aKeyEvent.iCode ); |
|
548 |
__PHONELOG1( EBasic, EPhoneControl, |
|
549 |
"CPhoneEmergency::SendKeyEventL(%S)", |
|
550 |
&buffer ); |
|
551 |
TLex code( buffer ); |
|
552 |
// Save the key code |
|
553 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
554 |
iStateMachine->SendPhoneEngineMessage( |
|
555 |
CPEPhoneModelIF::EPEMessagePlayDTMF ); |
|
556 |
} |
|
557 |
break; |
|
558 |
case EEventKeyUp: |
|
559 |
// Send a key up event for the last key code sent to |
|
560 |
// the phone engine |
|
561 |
iStateMachine->SendPhoneEngineMessage( |
|
562 |
CPEPhoneModelIF::EPEMessageEndDTMF ); |
|
563 |
break; |
|
564 |
default: |
|
565 |
break; |
|
566 |
} |
|
567 |
} |
|
568 |
||
569 |
// ----------------------------------------------------------------------------- |
|
570 |
// CPhoneEmergency::HandleAudioOutputChangedL |
|
571 |
// for setup |
|
572 |
// ----------------------------------------------------------------------------- |
|
573 |
// |
|
574 |
void CPhoneEmergency::HandleAudioOutputChangedL() |
|
575 |
{ |
|
74 | 576 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::HandleAudioOutputChangedL( ) "); |
65 | 577 |
TPhoneCmdParamAudioOutput outputParam; |
578 |
outputParam.SetAudioOutput( |
|
579 |
iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
580 |
iViewCommandHandle->ExecuteCommandL( |
|
581 |
EPhoneViewActivateAudioPathUIChanges, |
|
582 |
&outputParam ); |
|
74 | 583 |
UpdateUiCommands(); |
37 | 584 |
} |
585 |
||
586 |
// ----------------------------------------------------------------------------- |
|
587 |
// CPhoneEmergency::SetStartupInterrupted |
|
588 |
// ----------------------------------------------------------------------------- |
|
589 |
// |
|
590 |
void CPhoneEmergency::SetStartupInterrupted( const TBool aStartupInterrupted ) |
|
591 |
{ |
|
592 |
iStartupInterrupted = aStartupInterrupted; |
|
593 |
} |
|
594 |
||
595 |
// ----------------------------------------------------------- |
|
596 |
// CPhoneEmergency::UpdateSetupCbaL |
|
597 |
// ----------------------------------------------------------- |
|
598 |
// |
|
599 |
void CPhoneEmergency::UpdateSetupCbaL() |
|
600 |
{ |
|
601 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() "); |
|
74 | 602 |
UpdateUiCommands(); |
37 | 603 |
} |
604 |
||
605 |
// ----------------------------------------------------------------------------- |
|
606 |
// CPhoneEmergency::HandleRemConCommandL |
|
607 |
// ----------------------------------------------------------------------------- |
|
608 |
// |
|
609 |
EXPORT_C TBool CPhoneEmergency::HandleRemConCommandL( |
|
610 |
TRemConCoreApiOperationId aOperationId, |
|
611 |
TRemConCoreApiButtonAction aButtonAct ) |
|
612 |
{ |
|
65 | 613 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::MrccatoCommand() "); |
37 | 614 |
TBool handled = EFalse; |
615 |
switch ( aOperationId ) |
|
616 |
{ |
|
617 |
case ERemConCoreApiMute: |
|
618 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneEmergency::MrccatoCommand emerg. call no muting" ); |
|
619 |
// Not Allowed |
|
620 |
break; |
|
621 |
default: |
|
622 |
handled = CPhoneState::HandleRemConCommandL( aOperationId, aButtonAct ); |
|
623 |
break; |
|
624 |
} |
|
625 |
return handled; |
|
626 |
} |
|
627 |
||
628 |
// End of File |