author | hgs |
Fri, 03 Sep 2010 13:33:36 +0300 | |
changeset 65 | 2a5d4ab426d3 |
parent 50 | 377c906a8701 |
child 74 | d1c62c765e48 |
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 |
// 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 |
|
216 |
const TBool isSimStateNotPresentWithSecurityMode = IsSimStateNotPresentWithSecurityModeEnabled(); |
|
217 |
// Sim IS not ok when making emergency call from Pin query, no note |
|
218 |
if ( (!IsSimOk() && !iStartupInterrupted) || isSimStateNotPresentWithSecurityMode ) |
|
219 |
{ |
|
220 |
StartShowSecurityNoteL(); |
|
221 |
} |
|
222 |
else |
|
223 |
{ |
|
224 |
if ( !TopAppIsDisplayedL() || iDeviceLockOn ) |
|
225 |
{ |
|
226 |
// Continue displaying current app but set up the |
|
227 |
// idle screen in the background |
|
228 |
SetupIdleScreenInBackgroundL(); |
|
229 |
} |
|
230 |
||
65 | 231 |
else if ( IsNumberEntryContentStored() || IsNumberEntryUsedL() ) |
37 | 232 |
{ |
233 |
SetNumberEntryVisibilityL(ETrue); |
|
234 |
} |
|
65 | 235 |
|
37 | 236 |
else |
237 |
{ |
|
238 |
DisplayIdleScreenL(); |
|
239 |
} |
|
240 |
||
241 |
if ( iConnected ) |
|
242 |
{ |
|
243 |
DisplayCallTerminationNoteL(); |
|
244 |
} |
|
245 |
} |
|
246 |
||
247 |
// Go to emergency idle state or to startup state if emergency call |
|
248 |
// initiated from PIN query |
|
249 |
if ( iStartupInterrupted ) |
|
250 |
{ |
|
251 |
iStartupInterrupted = EFalse; |
|
252 |
iStateMachine->ChangeState( EPhoneStateStartup ); |
|
253 |
} |
|
254 |
else |
|
255 |
{ |
|
256 |
if ( !isSimStateNotPresentWithSecurityMode ) |
|
257 |
{ |
|
258 |
SetDefaultFlagsL(); |
|
259 |
} |
|
260 |
||
261 |
// As long as security note is not shown with feature flag |
|
262 |
// KFeatureIdFfSimlessOfflineSupport undef it is ok to do SetupIdleScreenInBackgroundL. |
|
263 |
if ( ( !IsNumberEntryUsedL() ) && |
|
264 |
!( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
265 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
266 |
{ |
|
267 |
UpdateCbaL( EPhoneEmptyCBA ); |
|
268 |
TPhoneCmdParamBoolean securityMode; |
|
269 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &securityMode ); |
|
270 |
if ( !securityMode.Boolean() ) |
|
271 |
{ |
|
272 |
SetupIdleScreenInBackgroundL(); |
|
273 |
} |
|
274 |
} |
|
275 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
276 |
} |
|
277 |
} |
|
278 |
else |
|
279 |
{ |
|
280 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
// ----------------------------------------------------------- |
|
285 |
// CPhoneEmergency::HandleDialingL |
|
286 |
// ----------------------------------------------------------- |
|
287 |
// |
|
288 |
void CPhoneEmergency::HandleDialingL( TInt aCallId ) |
|
289 |
{ |
|
290 |
// Discard all messages related to other calls than the emergency call |
|
291 |
// We trust that the ISA call server has taken care of them. However, |
|
292 |
// there could be a race condition between returning to Normal |
|
293 |
// mode (receiving a network registration status message from PE) |
|
294 |
// and receiving an EPEMessageDialling message. This can occur |
|
295 |
// because PE messages are processed asynchronously. |
|
296 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() "); |
|
297 |
if ( aCallId == KPEEmergencyCallId ) |
|
298 |
{ |
|
299 |
iDeviceLockOn = IsAutoLockOn(); |
|
300 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
301 |
globalNotifierParam.SetBoolean( ETrue ); |
|
302 |
iViewCommandHandle->ExecuteCommandL( |
|
303 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
304 |
&globalNotifierParam ); |
|
305 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
306 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
307 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
308 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
309 |
|
37 | 310 |
// Indicate that the Phone needs to be sent to the background if |
311 |
// an application other than the top application is in the foreground |
|
312 |
TPhoneCmdParamBoolean booleanParam; |
|
313 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
314 |
iViewCommandHandle->ExecuteCommandL( |
|
315 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
316 |
&booleanParam ); |
|
65 | 317 |
|
37 | 318 |
TPhoneCmdParamInteger uidParam; |
319 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
320 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
321 |
&uidParam ); |
|
322 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
323 |
&uidParam ); |
|
324 |
if ( IsNumberEntryUsedL() ) |
|
325 |
{ |
|
326 |
// Remove number entry |
|
327 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
328 |
} |
|
329 |
||
330 |
// Remove exit emergency mode query, if it exists |
|
331 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
332 |
||
333 |
BeginUiUpdateLC(); |
|
334 |
||
335 |
TPhoneCmdParamEmergencyCallHeaderData emergencyHeaderParam; |
|
336 |
TBuf<KPhoneCallHeaderLabelMaxLength> headerText( KNullDesC ); |
|
337 |
StringLoader::Load( |
|
338 |
headerText, |
|
339 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
340 |
EPhoneEmergencyCallHeader ), |
|
341 |
CCoeEnv::Static() ); |
|
342 |
emergencyHeaderParam.SetHeaderText( headerText ); |
|
343 |
||
344 |
// Set call header ciphering status |
|
345 |
emergencyHeaderParam.SetCiphering( |
|
346 |
iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) ); |
|
347 |
emergencyHeaderParam.SetCipheringIndicatorAllowed( |
|
348 |
iStateMachine->PhoneEngineInfo()->SecureSpecified() ); |
|
349 |
||
350 |
// Notify the view |
|
351 |
iViewCommandHandle->ExecuteCommandL( |
|
352 |
EPhoneViewCreateEmergencyCallHeader, |
|
353 |
aCallId, |
|
354 |
&emergencyHeaderParam ); |
|
355 |
||
356 |
TPhoneCmdParamCallHeaderData headerParam; |
|
357 |
headerParam.SetCallState( EPEStateDialing ); |
|
358 |
||
359 |
StringLoader::Load( |
|
360 |
headerText, |
|
361 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
362 |
EPhoneAttemptingEmergencyText ), |
|
363 |
CCoeEnv::Static() ); |
|
364 |
headerParam.SetLabelText( headerText ); |
|
365 |
||
366 |
iViewCommandHandle->ExecuteCommandL( |
|
367 |
EPhoneViewUpdateBubble, |
|
368 |
aCallId, |
|
369 |
&headerParam ); |
|
370 |
||
371 |
SetTouchPaneButtons( EPhoneEmergencyCallButtons ); |
|
372 |
SetBackButtonActive(EFalse); |
|
65 | 373 |
EndUiUpdate(); |
37 | 374 |
UpdateSetupCbaL(); |
375 |
} |
|
376 |
} |
|
377 |
// ----------------------------------------------------------- |
|
378 |
// CPhoneEmergency::HandleConnectingL |
|
379 |
// ----------------------------------------------------------- |
|
380 |
// |
|
381 |
void CPhoneEmergency::HandleConnectingL( TInt aCallId ) |
|
382 |
{ |
|
383 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectingL() "); |
|
384 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
385 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
386 |
globalNotifierParam.SetBoolean( EFalse ); |
|
387 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
388 |
&globalNotifierParam ); |
|
389 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
390 |
&globalNotifierParam ); |
|
65 | 391 |
|
37 | 392 |
TPhoneCmdParamBoolean booleanParam; |
393 |
booleanParam.SetBoolean( EFalse ); |
|
394 |
iViewCommandHandle->ExecuteCommandL( |
|
395 |
EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
65 | 396 |
|
37 | 397 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
398 |
||
399 |
TPhoneCmdParamCallHeaderData headerParam; |
|
400 |
headerParam.SetCallState( EPEStateConnecting ); |
|
401 |
// Notify the view |
|
402 |
iViewCommandHandle->ExecuteCommandL( |
|
403 |
EPhoneViewUpdateBubble, |
|
404 |
aCallId, |
|
405 |
&headerParam ); |
|
406 |
||
407 |
SetToolbarButtonLoudspeakerEnabled(); |
|
408 |
UpdateInCallCbaL(); |
|
409 |
} |
|
410 |
||
411 |
// ----------------------------------------------------------- |
|
412 |
// CPhoneEmergency::HandleConnectedL |
|
413 |
// ----------------------------------------------------------- |
|
414 |
// |
|
415 |
void CPhoneEmergency::HandleConnectedL( TInt aCallId ) |
|
416 |
{ |
|
417 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectedL() "); |
|
418 |
BeginUiUpdateLC(); |
|
419 |
TPhoneCmdParamCallHeaderData emergencyHeaderParam; |
|
420 |
emergencyHeaderParam.SetCallState( EPEStateConnected ); |
|
421 |
iViewCommandHandle->ExecuteCommandL( |
|
422 |
EPhoneViewUpdateBubble, |
|
423 |
aCallId, |
|
424 |
&emergencyHeaderParam ); |
|
425 |
SetBackButtonActive(ETrue); |
|
426 |
EndUiUpdate(); |
|
427 |
UpdateInCallCbaL(); |
|
428 |
} |
|
429 |
||
430 |
// ----------------------------------------------------------- |
|
431 |
// CPhoneEmergency::UpdateInCallCbaL |
|
432 |
// ----------------------------------------------------------- |
|
433 |
// |
|
434 |
void CPhoneEmergency::UpdateInCallCbaL() |
|
435 |
{ |
|
436 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateInCallCbaL() "); |
|
65 | 437 |
iCbaManager->SetCbaL( EPhoneCallHandlingEmergencyCBA ); |
37 | 438 |
} |
439 |
||
440 |
// -------------------------------------------------------------- |
|
441 |
// CPhoneEmergency::HandleKeyMessageL |
|
442 |
// -------------------------------------------------------------- |
|
443 |
// |
|
444 |
void CPhoneEmergency::HandleKeyMessageL( |
|
445 |
TPhoneKeyEventMessages aMessage, |
|
446 |
TKeyCode aCode ) |
|
447 |
{ |
|
448 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyMessageL()"); |
|
449 |
switch ( aCode ) |
|
450 |
{ |
|
65 | 451 |
case EKeyNo: // end-key |
37 | 452 |
DisconnectEmergencyCallL(); |
453 |
break; |
|
454 |
||
65 | 455 |
case EKeyYes: // send-key |
456 |
if( IsNumberEntryVisibleL() ) |
|
37 | 457 |
{ |
458 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
65 | 459 |
iViewCommandHandle->ExecuteCommandL( |
460 |
EPhoneViewGetNumberEntryCount, |
|
37 | 461 |
&numberEntryCountParam ); |
65 | 462 |
TInt neLength( numberEntryCountParam.Integer() ); |
37 | 463 |
if ( neLength ) |
464 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
465 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 466 |
} |
467 |
else |
|
468 |
{ |
|
469 |
CallFromNumberEntryL(); |
|
470 |
} |
|
471 |
} |
|
472 |
else |
|
473 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
474 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 475 |
} |
476 |
break; |
|
477 |
||
478 |
default: |
|
479 |
{ |
|
65 | 480 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
37 | 481 |
break; |
482 |
} |
|
483 |
} |
|
484 |
} |
|
485 |
||
486 |
// ----------------------------------------------------------- |
|
487 |
// CPhoneEmergency::HandleCommandL |
|
488 |
// ----------------------------------------------------------- |
|
489 |
// |
|
490 |
TBool CPhoneEmergency::HandleCommandL( TInt aCommand ) |
|
491 |
{ |
|
492 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleCommandL()"); |
|
493 |
TBool commandStatus = ETrue; |
|
494 |
switch( aCommand ) |
|
495 |
{ |
|
496 |
case EPhoneInCallCmdDtmfManualQuery: |
|
497 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
498 |
{ |
|
499 |
// Remove emergency connecting note |
|
500 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
501 |
} |
|
502 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
503 |
break; |
|
504 |
||
505 |
case EPhoneDtmfDialerExit: // fall through |
|
506 |
case EPhoneDtmfDialerCancel: |
|
507 |
{ |
|
508 |
if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing ) |
|
509 |
{ |
|
50 | 510 |
UpdateSetupCbaL(); |
37 | 511 |
} |
512 |
else |
|
513 |
{ |
|
514 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
515 |
} |
|
516 |
} |
|
517 |
break; |
|
518 |
||
519 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
520 |
case EPhoneInCallCmdEndThisActiveCall: |
|
521 |
DisconnectEmergencyCallL(); |
|
522 |
break; |
|
523 |
||
524 |
default: |
|
525 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
526 |
break; |
|
527 |
} |
|
528 |
return commandStatus; |
|
529 |
} |
|
530 |
||
531 |
// ----------------------------------------------------------- |
|
532 |
// CPhoneEmergency::DisconnectEmergencyCallL |
|
533 |
// ----------------------------------------------------------- |
|
534 |
// |
|
535 |
void CPhoneEmergency::DisconnectEmergencyCallL() |
|
536 |
{ |
|
537 |
__LOGMETHODSTARTEND(EPhoneUIStates, |
|
538 |
"CPhoneEmergency::DisconnectEmergencyCallL()"); |
|
65 | 539 |
iStateMachine->SetCallId( KEmergencyCallId ); |
37 | 540 |
iStateMachine->SendPhoneEngineMessage( |
541 |
CPEPhoneModelIF::EPEMessageRelease ); |
|
542 |
} |
|
543 |
||
544 |
// ----------------------------------------------------------- |
|
545 |
// CPhoneEmergency::HandleErrorL |
|
546 |
// Emergency handling for HandleError message |
|
547 |
// (other items were commented in a header). |
|
548 |
// ----------------------------------------------------------- |
|
549 |
// |
|
550 |
void CPhoneEmergency::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
551 |
{ |
|
552 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleError()"); |
|
553 |
||
554 |
switch( aErrorInfo.iErrorCode ) |
|
555 |
{ |
|
556 |
case ECCPErrorCCNoRouteToDestination: |
|
557 |
case ECCPErrorUnacceptableChannel: |
|
558 |
case ECCPErrorCCDestinationOutOfOrder: |
|
559 |
case ECCPErrorNetworkOutOfOrder: |
|
560 |
case ECCPErrorAccessInformationDiscarded: |
|
561 |
case ECCPErrorCCResourceNotAvailable: |
|
562 |
case ECCPErrorQualityOfServiceNotAvailable: |
|
563 |
case ECCPErrorInvalidCallReferenceValue: |
|
564 |
case ECCPErrorBadRequest: |
|
565 |
case ECCPErrorConnectionError: |
|
566 |
case ECCPErrorCCIncompatibleMessageInProtocolState: |
|
567 |
case ECCPErrorCCNoChannelAvailable: |
|
568 |
case ECCPErrorNetworkBusy: |
|
569 |
case ECCPEmergencyFailed: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
570 |
SendGlobalErrorNoteL( EPhoneNoteNoNetworkCallEmergency, ETrue ); |
37 | 571 |
break; |
572 |
||
573 |
default: |
|
574 |
__PHONELOG1( |
|
575 |
EOnlyFatal, |
|
576 |
EPhoneUIStates, |
|
577 |
"PHONEUI_ERROR: CPhoneEmergency::HandleError - Error send to PhoneState (err=%d)", |
|
578 |
aErrorInfo.iErrorCode); |
|
579 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
580 |
break; |
|
581 |
} |
|
582 |
} |
|
583 |
||
584 |
// ----------------------------------------------------------- |
|
585 |
// CPhoneEmergency::HandleKeyEventL |
|
586 |
// ----------------------------------------------------------- |
|
587 |
// |
|
588 |
void CPhoneEmergency::HandleKeyEventL( |
|
589 |
const TKeyEvent& aKeyEvent, |
|
590 |
TEventCode aEventCode ) |
|
591 |
{ |
|
592 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) "); |
|
65 | 593 |
CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
37 | 594 |
} |
595 |
||
596 |
// ----------------------------------------------------------- |
|
597 |
// CPhoneEmergency::SendKeyEventL |
|
598 |
// ----------------------------------------------------------- |
|
599 |
// |
|
600 |
void CPhoneEmergency::SendKeyEventL( |
|
601 |
const TKeyEvent& aKeyEvent, |
|
602 |
TEventCode aEventCode ) |
|
603 |
{ |
|
604 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::SendKeyEventL( ) "); |
|
605 |
switch( aEventCode ) |
|
606 |
{ |
|
607 |
case EEventKey: |
|
608 |
{ |
|
609 |
// Convert key code to western. |
|
610 |
TBuf<1> buffer; // one character |
|
611 |
buffer.Append( aKeyEvent.iCode ); |
|
612 |
__PHONELOG1( EBasic, EPhoneControl, |
|
613 |
"CPhoneEmergency::SendKeyEventL(%S)", |
|
614 |
&buffer ); |
|
615 |
AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
616 |
__PHONELOG1( EBasic, EPhoneControl, |
|
617 |
"CPhoneEmergency::SendKeyEventL(%S)", |
|
618 |
&buffer ); |
|
619 |
TLex code( buffer ); |
|
620 |
// Save the key code |
|
621 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
622 |
iStateMachine->SendPhoneEngineMessage( |
|
623 |
CPEPhoneModelIF::EPEMessagePlayDTMF ); |
|
624 |
} |
|
625 |
break; |
|
626 |
case EEventKeyUp: |
|
627 |
// Send a key up event for the last key code sent to |
|
628 |
// the phone engine |
|
629 |
iStateMachine->SendPhoneEngineMessage( |
|
630 |
CPEPhoneModelIF::EPEMessageEndDTMF ); |
|
631 |
break; |
|
632 |
default: |
|
633 |
break; |
|
634 |
} |
|
635 |
} |
|
636 |
||
637 |
// ----------------------------------------------------------------------------- |
|
638 |
// CPhoneEmergency::HandleAudioOutputChangedL |
|
639 |
// for setup |
|
640 |
// ----------------------------------------------------------------------------- |
|
641 |
// |
|
642 |
void CPhoneEmergency::HandleAudioOutputChangedL() |
|
643 |
{ |
|
644 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::HandleAudioOutputChangedL( ) "); |
|
645 |
UpdateSetupCbaL(); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
646 |
SetTouchPaneButtons(0); |
65 | 647 |
TPhoneCmdParamAudioOutput outputParam; |
648 |
outputParam.SetAudioOutput( |
|
649 |
iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
650 |
iViewCommandHandle->ExecuteCommandL( |
|
651 |
EPhoneViewActivateAudioPathUIChanges, |
|
652 |
&outputParam ); |
|
37 | 653 |
} |
654 |
||
655 |
// ----------------------------------------------------------------------------- |
|
656 |
// CPhoneEmergency::SetStartupInterrupted |
|
657 |
// ----------------------------------------------------------------------------- |
|
658 |
// |
|
659 |
void CPhoneEmergency::SetStartupInterrupted( const TBool aStartupInterrupted ) |
|
660 |
{ |
|
661 |
iStartupInterrupted = aStartupInterrupted; |
|
662 |
} |
|
663 |
||
664 |
// ----------------------------------------------------------- |
|
665 |
// CPhoneEmergency::UpdateSetupCbaL |
|
666 |
// ----------------------------------------------------------- |
|
667 |
// |
|
668 |
void CPhoneEmergency::UpdateSetupCbaL() |
|
669 |
{ |
|
670 |
__LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() "); |
|
65 | 671 |
iCbaManager->SetCbaL( EPhoneCallHandlingEmergencyCBA ); |
37 | 672 |
} |
673 |
||
674 |
// ----------------------------------------------------------------------------- |
|
675 |
// CPhoneEmergency::HandleRemConCommandL |
|
676 |
// ----------------------------------------------------------------------------- |
|
677 |
// |
|
678 |
EXPORT_C TBool CPhoneEmergency::HandleRemConCommandL( |
|
679 |
TRemConCoreApiOperationId aOperationId, |
|
680 |
TRemConCoreApiButtonAction aButtonAct ) |
|
681 |
{ |
|
65 | 682 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::MrccatoCommand() "); |
37 | 683 |
TBool handled = EFalse; |
684 |
switch ( aOperationId ) |
|
685 |
{ |
|
686 |
case ERemConCoreApiMute: |
|
687 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneEmergency::MrccatoCommand emerg. call no muting" ); |
|
688 |
// Not Allowed |
|
689 |
break; |
|
690 |
default: |
|
691 |
handled = CPhoneState::HandleRemConCommandL( aOperationId, aButtonAct ); |
|
692 |
break; |
|
693 |
} |
|
694 |
return handled; |
|
695 |
} |
|
696 |
||
697 |
// End of File |