author | hgs |
Fri, 15 Oct 2010 12:58:46 +0300 | |
changeset 78 | baacf668fe89 |
parent 76 | cfea66083b62 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005-2009 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 CPhoneStateIdle class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <eikenv.h> |
|
21 |
#include <e32property.h> |
|
22 |
#include <connect/sbdefs.h> |
|
23 |
#include <w32std.h> |
|
24 |
#include <StringLoader.h> |
|
25 |
#include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone |
|
26 |
#include <apgcli.h> |
|
27 |
#include <telephonyvariant.hrh> |
|
28 |
#include <featmgr.h> |
|
29 |
#include <settingsinternalcrkeys.h> |
|
30 |
#include <mpeengineinfo.h> |
|
31 |
#include <mpeclientinformation.h> |
|
32 |
#include <bldvariant.hrh> |
|
78 | 33 |
#include <apaid.h> |
37 | 34 |
|
35 |
#include "cphonepubsubproxy.h" |
|
36 |
#include "cphonecenrepproxy.h" |
|
37 |
#include "cphonestateidle.h" |
|
38 |
#include "tphonecmdparaminteger.h" |
|
39 |
#include "tphonecmdparamboolean.h" |
|
40 |
#include "tphonecmdparamglobalnote.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
41 |
#include "tphonecmdparamkeycapture.h" |
37 | 42 |
#include "tphonecmdparamstring.h" |
43 |
#include "tphonecmdparamboolean.h" |
|
44 |
#include "mphonestatemachine.h" |
|
45 |
#include "phonestatedefinitions.h" |
|
46 |
#include "tphonecmdparamappinfo.h" |
|
47 |
#include "cphonekeys.h" |
|
48 |
||
49 |
#include "phoneviewcommanddefinitions.h" |
|
50 |
#include "phoneui.hrh" |
|
51 |
#include "phonerssbase.h" |
|
52 |
#include "cphonemainresourceresolver.h" |
|
53 |
#include "phonelogger.h" |
|
54 |
#include "phoneui.pan" |
|
55 |
#include "mphonecustomization.h" |
|
56 |
||
78 | 57 |
const TUid KNetworkHandlingStarterUid = { 0x2002E67A }; |
37 | 58 |
|
59 |
// ================= MEMBER FUNCTIONS ======================= |
|
60 |
||
61 |
// C++ default constructor can NOT contain any code, that |
|
62 |
// might leave. |
|
63 |
// |
|
64 |
EXPORT_C CPhoneStateIdle::CPhoneStateIdle( |
|
65 |
MPhoneStateMachine* aStateMachine, |
|
66 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
67 |
MPhoneCustomization* aCustomization ) : |
|
68 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ) |
|
69 |
{ |
|
70 |
} |
|
71 |
||
72 |
// Destructor |
|
73 |
EXPORT_C CPhoneStateIdle::~CPhoneStateIdle() |
|
74 |
{ |
|
78 | 75 |
__LOGMETHODSTARTEND( |
76 |
EPhoneControl, "CPhoneStateIdle::~CPhoneStateIdle()" ); |
|
77 |
CloseQtProcess(KNetworkHandlingStarterUid); |
|
37 | 78 |
} |
79 |
||
80 |
// ----------------------------------------------------------- |
|
81 |
// CPhoneStateIdle::ConstructL() |
|
82 |
// ----------------------------------------------------------- |
|
83 |
// |
|
84 |
EXPORT_C void CPhoneStateIdle::ConstructL() |
|
85 |
{ |
|
86 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() "); |
|
87 |
CPhoneState::BaseConstructL(); |
|
78 | 88 |
|
89 |
LaunchQtProcessL(KNetworkHandlingStarterUid); |
|
37 | 90 |
} |
91 |
||
92 |
// ----------------------------------------------------------- |
|
93 |
// CPhoneStateIdle::NewL() |
|
94 |
// ----------------------------------------------------------- |
|
95 |
// |
|
96 |
CPhoneStateIdle* CPhoneStateIdle::NewL( |
|
97 |
MPhoneStateMachine* aStateMachine, |
|
98 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
99 |
MPhoneCustomization* aPhoneCustomization ) |
|
100 |
{ |
|
101 |
CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( |
|
102 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
103 |
CleanupStack::PushL( self ); |
|
104 |
self->ConstructL(); |
|
105 |
CleanupStack::Pop( self ); |
|
106 |
return self; |
|
107 |
} |
|
108 |
||
109 |
// ----------------------------------------------------------- |
|
110 |
// CPhoneStateIdle::HandleKeyEventL |
|
111 |
// ----------------------------------------------------------- |
|
112 |
// |
|
113 |
EXPORT_C void CPhoneStateIdle::HandleKeyEventL( |
|
114 |
const TKeyEvent& aKeyEvent, |
|
115 |
TEventCode aEventCode ) |
|
116 |
{ |
|
117 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) "); |
|
65 | 118 |
TPhoneCmdParamBoolean isSecurityMode; |
119 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
120 |
if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( |
|
37 | 121 |
aKeyEvent, aEventCode ) ) |
122 |
{ |
|
123 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
124 |
} |
|
125 |
else if ( aEventCode == EEventKeyUp ) |
|
126 |
{ |
|
127 |
// Provide up event to engine. |
|
128 |
// Otherwise DTMF tone keeps playing. |
|
129 |
iStateMachine->SendPhoneEngineMessage( |
|
130 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
131 |
__PHONELOG( EBasic, EPhoneControl, |
|
132 |
"PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" ); |
|
133 |
} |
|
134 |
} |
|
135 |
||
136 |
// ----------------------------------------------------------- |
|
137 |
// CPhoneStateIdle::HandleNumberEntryClearedL() |
|
138 |
// ----------------------------------------------------------- |
|
139 |
// |
|
140 |
EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL() |
|
141 |
{ |
|
142 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) "); |
|
143 |
if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
144 |
{ |
|
145 |
// if still idle ( f.e not incoming call arrived when rfs ) |
|
146 |
if ( iStateMachine->State() == this ) |
|
147 |
{ |
|
74 | 148 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 149 |
} |
150 |
} |
|
151 |
else |
|
152 |
{ |
|
153 |
StartShowSecurityNoteL(); |
|
154 |
} |
|
155 |
} |
|
156 |
||
157 |
// ----------------------------------------------------------- |
|
158 |
// CPhoneStateIdle::HandleKeyMessageL |
|
159 |
// ----------------------------------------------------------- |
|
160 |
// |
|
161 |
EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( |
|
162 |
TPhoneKeyEventMessages aMessage, |
|
163 |
TKeyCode aCode ) |
|
164 |
{ |
|
165 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) "); |
|
166 |
switch ( aCode ) |
|
167 |
{ |
|
168 |
case EKeyEnd: |
|
169 |
// This key even occur only in idle state, behaviour for this should |
|
170 |
// be same as long end-key press. (Bug in window server) |
|
171 |
HandleEndKeyPressL( EPhoneKeyLongPress ); |
|
172 |
break; |
|
173 |
||
174 |
// end-key |
|
175 |
case EKeyNo: |
|
65 | 176 |
HandleEndKeyPressL( aMessage ); |
37 | 177 |
break; |
178 |
// send-key |
|
179 |
case EKeyYes: |
|
74 | 180 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 181 |
{ |
65 | 182 |
TPhoneCmdParamBoolean isSecurityMode; |
183 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
184 |
||
185 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
186 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
187 |
&numberEntryCountParam ); |
|
188 |
||
189 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
74 | 190 |
if ( neLength == 0 && !isSecurityMode.Boolean()) |
37 | 191 |
{ |
65 | 192 |
// start logs |
193 |
iViewCommandHandle->HandleCommandL( |
|
194 |
EPhoneDialerCmdLog ); |
|
195 |
return; |
|
37 | 196 |
} |
65 | 197 |
HandleSendCommandL(); |
198 |
} |
|
199 |
// If dialer is not open but phone is in foreground and phone receives |
|
200 |
// send-key event we have to check if security mode is true and if it |
|
201 |
// is then open emergency dialer. |
|
74 | 202 |
else |
65 | 203 |
{ |
204 |
TPhoneCmdParamBoolean isSecurityMode; |
|
205 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
206 |
if ( isSecurityMode.Boolean()) |
|
37 | 207 |
{ |
65 | 208 |
// launch dialer. |
209 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
210 |
} |
|
37 | 211 |
} |
212 |
break; |
|
213 |
||
214 |
case EKeyApplication0: |
|
215 |
{ |
|
216 |
// If dialer is not open but phone is in foreground and phone receives |
|
217 |
// applicaion-key event we have to open emergency dialer. No need own |
|
218 |
// securitymode check because Applicationkey only captured in securitymode. |
|
74 | 219 |
if ( !iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 220 |
{ |
221 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
65 | 222 |
} |
37 | 223 |
} |
224 |
break; |
|
65 | 225 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
37 | 226 |
case EKeyEnter: |
74 | 227 |
if ( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 228 |
{ |
229 |
HandleCommandL( EPhoneCmdOptions ); |
|
230 |
} |
|
231 |
break; |
|
232 |
#endif |
|
233 |
default: |
|
234 |
break; |
|
235 |
} |
|
236 |
} |
|
237 |
||
238 |
// ----------------------------------------------------------- |
|
239 |
// CPhoneStateIdle::HandlePhoneEngineMessageL |
|
240 |
// ----------------------------------------------------------- |
|
241 |
// |
|
242 |
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( |
|
243 |
const TInt aMessage, |
|
244 |
TInt aCallId ) |
|
245 |
{ |
|
246 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) "); |
|
247 |
switch ( aMessage ) |
|
248 |
{ |
|
249 |
case MEngineMonitor::EPEMessageIncoming: |
|
250 |
HandleIncomingL( aCallId ); |
|
251 |
break; |
|
252 |
||
253 |
case MEngineMonitor::EPEMessageDialing: |
|
254 |
HandleDialingL( aCallId ); |
|
255 |
break; |
|
256 |
||
257 |
case MEngineMonitor::EPEMessageConnected: |
|
258 |
HandleConnectedL( aCallId ); |
|
259 |
break; |
|
260 |
||
261 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
262 |
// Note that after the sending of SS |
|
263 |
// strings the view stays in Dialer. |
|
74 | 264 |
if ( !iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue ) ) |
37 | 265 |
{ |
74 | 266 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 267 |
} |
268 |
break; |
|
269 |
||
270 |
case MEngineMonitor::EPEMessageIdle: |
|
271 |
HandleIdleL( aCallId ); |
|
272 |
break; |
|
273 |
||
65 | 274 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
275 |
SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue ); |
|
37 | 276 |
break; |
277 |
||
278 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
279 |
DialVoiceCallL(); |
|
280 |
break; |
|
281 |
||
282 |
default: |
|
283 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
284 |
break; |
|
285 |
} |
|
286 |
} |
|
287 |
||
288 |
// ----------------------------------------------------------- |
|
289 |
// CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
290 |
// Default handling for incoming message |
|
291 |
// (other items were commented in a header). |
|
292 |
// ----------------------------------------------------------- |
|
293 |
// |
|
294 |
void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
295 |
{ |
|
296 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
|
297 |
HandleAudioAvailableOutputChangedL(); |
|
78 | 298 |
|
299 |
TPhoneCmdParamBoolean ringingParam; |
|
300 |
ringingParam.SetBoolean( ETrue ); |
|
301 |
iViewCommandHandle->ExecuteCommand( |
|
302 |
EPhoneViewSetRingingFlag,&ringingParam); |
|
74 | 303 |
|
37 | 304 |
BeginUiUpdateLC(); |
74 | 305 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse); |
37 | 306 |
DisplayIncomingCallL( aCallId ); |
307 |
SetBackButtonActive(EFalse); |
|
74 | 308 |
UpdateUiCommands(); |
37 | 309 |
EndUiUpdate(); |
310 |
||
78 | 311 |
SetRingingTonePlaybackL( aCallId ); |
312 |
||
74 | 313 |
ChangeTo( EPhoneStateIncoming ); |
37 | 314 |
} |
315 |
||
316 |
// ----------------------------------------------------------- |
|
74 | 317 |
// CPhoneStateIdle::HandleDialingL |
37 | 318 |
// Default handling for dialling message |
319 |
// (other items were commented in a header). |
|
320 |
// ----------------------------------------------------------- |
|
321 |
// |
|
322 |
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
|
323 |
{ |
|
74 | 324 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
325 |
TPhoneCmdParamKeyCapture captureParam; |
|
326 |
captureParam.SetKeyCode( EKeyNo ); |
|
327 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
328 |
DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
|
329 |
SetToolbarButtonLoudspeakerEnabled(); |
|
330 |
ChangeTo( EPhoneStateCallSetup ); |
|
37 | 331 |
} |
332 |
||
333 |
// ----------------------------------------------------------- |
|
334 |
// CPhoneStateIdle::HandleConnectedL |
|
335 |
// Message Handling function for message EPEMessageConnected |
|
336 |
// This could happen during transaction from Emergency mode |
|
337 |
// to Normal mode where a network status change is received |
|
338 |
// from PE after PE initiates an MO call. Since PE messages |
|
339 |
// are asynchronous, this sequence can occur in any order. |
|
340 |
// (other items were commented in a header). |
|
341 |
// ----------------------------------------------------------- |
|
342 |
// |
|
343 |
void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
|
344 |
{ |
|
345 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
|
346 |
BeginUiUpdateLC(); |
|
347 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
74 | 348 |
DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
37 | 349 |
UpdateSingleActiveCallL( aCallId ); |
74 | 350 |
UpdateUiCommands(); |
65 | 351 |
EndUiUpdate(); |
74 | 352 |
ChangeTo( EPhoneStateSingle ); |
37 | 353 |
} |
354 |
||
355 |
// ----------------------------------------------------------- |
|
356 |
// CPhoneStateIdle::HandleCommandL |
|
357 |
// ----------------------------------------------------------- |
|
358 |
// |
|
359 |
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand ) |
|
360 |
{ |
|
361 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) "); |
|
362 |
TBool commandStatus = ETrue; |
|
363 |
switch( aCommand ) |
|
364 |
{ |
|
365 |
case EPhoneCmdOptions: |
|
65 | 366 |
case EPhoneCmdBack: |
37 | 367 |
break; |
368 |
||
369 |
case EPhoneNumberAcqCmdCall: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
370 |
HandleVoiceCallCommandL(); |
37 | 371 |
break; |
65 | 372 |
|
37 | 373 |
case EPhoneNumberAcqCmdSendCommand: |
374 |
HandleSendCommandL(); |
|
375 |
break; |
|
376 |
||
377 |
case EPhoneNumberAcqCmdVideoCall: |
|
378 |
DialVideoCallL(); |
|
379 |
break; |
|
380 |
||
381 |
default: |
|
382 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
383 |
break; |
|
384 |
} |
|
385 |
return commandStatus; |
|
386 |
} |
|
387 |
||
388 |
// ----------------------------------------------------------------------------- |
|
389 |
// CPhoneStateIdle::ProcessCommandL |
|
390 |
// ----------------------------------------------------------------------------- |
|
391 |
// |
|
392 |
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand ) |
|
393 |
{ |
|
394 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) "); |
|
395 |
TBool commandStatus = EFalse; |
|
396 |
switch( aCommand ) |
|
397 |
{ |
|
398 |
case EAknSoftkeyContextOptions: |
|
65 | 399 |
break; |
37 | 400 |
|
401 |
default: |
|
402 |
commandStatus = CPhoneState::ProcessCommandL( aCommand ); |
|
403 |
break; |
|
404 |
} |
|
405 |
return commandStatus; |
|
406 |
} |
|
407 |
||
408 |
// ----------------------------------------------------------------------------- |
|
409 |
// CPhoneStateIdle::HandleRemConCommandL |
|
410 |
// ----------------------------------------------------------------------------- |
|
411 |
// |
|
412 |
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL( |
|
413 |
TRemConCoreApiOperationId /*aOperationId */, |
|
414 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
415 |
{ |
|
416 |
return EFalse; |
|
417 |
} |
|
418 |
||
419 |
// ----------------------------------------------------------- |
|
420 |
// CPhoneStateIdle::DialL |
|
421 |
// ----------------------------------------------------------- |
|
422 |
// |
|
423 |
EXPORT_C void CPhoneStateIdle::DialL( |
|
424 |
const TDesC& aNumber, |
|
425 |
TPhoneNumberType aNumberType, |
|
426 |
TDialInitiationMethod /*aDialMethod*/ ) |
|
427 |
{ |
|
428 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber ); |
|
429 |
if ( aNumberType == EPhoneNumberTypeVideo && |
|
430 |
FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
431 |
{ |
|
432 |
DialMultimediaCallL(); |
|
433 |
} |
|
434 |
else if ( EPhoneNumberTypeVoip == aNumberType && |
|
435 |
iCustomization ) |
|
436 |
{ |
|
437 |
iCustomization->HandleDialL( aNumber ); |
|
438 |
} |
|
439 |
else |
|
440 |
{ |
|
65 | 441 |
DialVoiceCallL(); |
37 | 442 |
} |
443 |
} |
|
444 |
||
445 |
// ----------------------------------------------------------- |
|
446 |
// CPhoneStateIdle::DialVideoCallL |
|
447 |
// ----------------------------------------------------------- |
|
448 |
// |
|
449 |
void CPhoneStateIdle::DialVideoCallL() |
|
450 |
{ |
|
451 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) "); |
|
74 | 452 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 453 |
{ |
454 |
// get the number entry contents |
|
74 | 455 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 456 |
#ifdef _DEBUG |
457 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
458 |
{ |
|
459 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
460 |
SendExitCommandL(); |
|
461 |
} |
|
462 |
else |
|
463 |
#endif // _DEBUG |
|
464 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
465 |
// call the number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
466 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
78 | 467 |
DialMultimediaCall(); |
37 | 468 |
CleanupStack::PopAndDestroy( phoneNumber ); |
469 |
} |
|
65 | 470 |
} |
37 | 471 |
} |
472 |
||
473 |
// ----------------------------------------------------------- |
|
474 |
// CPhoneStateIdle::DisplayIncomingCallL |
|
475 |
// ----------------------------------------------------------- |
|
476 |
// |
|
477 |
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
|
478 |
{ |
|
479 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
|
480 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
|
481 |
Panic( EPhoneCtrlInvariant ) ); |
|
65 | 482 |
|
37 | 483 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
484 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
485 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
486 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
74 | 487 |
|
488 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
|
489 |
||
37 | 490 |
// Disable global notes when there is an incoming call |
491 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
492 |
globalNotifierParam.SetBoolean( ETrue ); |
|
493 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
494 |
&globalNotifierParam ); |
|
74 | 495 |
iViewCommandHandle->ExecuteCommandL(EPhoneViewCreateCallHeader, aCallId); |
37 | 496 |
} |
497 |
||
498 |
// ----------------------------------------------------------- |
|
499 |
// CPhoneStateIdle::HandlePhoneFocusLostEventL |
|
500 |
// ----------------------------------------------------------- |
|
501 |
// |
|
502 |
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL() |
|
503 |
{ |
|
504 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) "); |
|
74 | 505 |
if ( !iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 506 |
{ |
65 | 507 |
// If dialer is open add icon to FSW list. |
37 | 508 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
509 |
} |
|
510 |
} |
|
511 |
||
512 |
// ----------------------------------------------------------- |
|
513 |
// CPhoneStateIdle::HandleIdleL |
|
514 |
// ----------------------------------------------------------- |
|
515 |
// |
|
516 |
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
|
517 |
{ |
|
65 | 518 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
37 | 519 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
65 | 520 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
521 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
37 | 522 |
} |
523 |
||
524 |
// ----------------------------------------------------------- |
|
525 |
// CPhoneStateIdle::HandleSendCommandL() |
|
526 |
// ----------------------------------------------------------- |
|
527 |
// |
|
528 |
EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
|
529 |
{ |
|
530 |
__LOGMETHODSTARTEND( |
|
531 |
EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
532 |
HandleVoiceCallCommandL(); |
37 | 533 |
} |
534 |
||
535 |
// ----------------------------------------------------------- |
|
536 |
// CPhoneStateIdle:SendExitCommandL |
|
537 |
// ----------------------------------------------------------- |
|
538 |
// |
|
539 |
void CPhoneStateIdle::SendExitCommandL() |
|
540 |
{ |
|
541 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
|
74 | 542 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
543 |
// Simulate exit command |
|
544 |
RWsSession& wsSession = EikonEnv()->WsSession(); |
|
545 |
TKeyEvent keyEvent; |
|
546 |
keyEvent.iCode = EEikCmdExit; |
|
547 |
keyEvent.iScanCode = EEikCmdExit; |
|
548 |
keyEvent.iModifiers = 0; |
|
549 |
keyEvent.iRepeats = 0; |
|
550 |
wsSession.SimulateKeyEvent( keyEvent ); |
|
551 |
wsSession.Flush(); |
|
37 | 552 |
|
553 |
iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
|
554 |
} |
|
555 |
||
556 |
// ----------------------------------------------------------- |
|
557 |
// CPhoneStateIdle::HandleEndKeyPressL |
|
558 |
// ----------------------------------------------------------- |
|
559 |
// |
|
560 |
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
561 |
{ |
|
562 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
|
563 |
// End key not handled also in phone startup when pressed during country/time/date query |
|
564 |
RWsSession sess = CCoeEnv::Static()->WsSession(); |
|
565 |
TApaTaskList appList( sess ); |
|
566 |
TApaTask startup = appList.FindApp( KUidStartupApplication ); |
|
74 | 567 |
if ( !IsAutoLockOn() && !startup.Exists() ) |
37 | 568 |
{ |
569 |
//Cancels e.g. USB notifier and Audio notifier. |
|
570 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
|
571 |
// If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
|
572 |
// remove security note from screen. |
|
573 |
if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
574 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
575 |
{ |
|
576 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
577 |
} |
|
578 |
||
579 |
if ( IsSimOk() ) |
|
580 |
{ |
|
581 |
if ( aMessage == EPhoneKeyLongPress ) |
|
582 |
{ |
|
583 |
iStateMachine->SendPhoneEngineMessage( |
|
65 | 584 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
74 | 585 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 586 |
{ |
65 | 587 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 588 |
// Do state-specific operation when number entry is cleared |
589 |
HandleNumberEntryClearedL(); |
|
590 |
// If long end key event occures then all calls are terminated and |
|
591 |
// dialer is closed, therefore tel.icon must be removed from FSW. |
|
592 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
593 |
} |
|
594 |
} |
|
74 | 595 |
else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 596 |
{ |
65 | 597 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 598 |
// Do state-specific operation when number entry is cleared |
599 |
HandleNumberEntryClearedL(); |
|
600 |
} |
|
601 |
} |
|
74 | 602 |
else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 603 |
{ |
65 | 604 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
605 |
StartShowSecurityNoteL(); |
|
37 | 606 |
} |
607 |
} |
|
608 |
} |
|
609 |
||
610 |
// ----------------------------------------------------------- |
|
611 |
// CPhoneStateIdle::DialMultimediaCallL |
|
612 |
// ----------------------------------------------------------- |
|
613 |
// |
|
614 |
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL() |
|
615 |
{ |
|
616 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() "); |
|
65 | 617 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 618 |
if ( RestoreOngoing() ) |
619 |
{ |
|
620 |
CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote ); |
|
621 |
} |
|
622 |
else |
|
623 |
{ |
|
78 | 624 |
CPhoneState::DialMultimediaCall(); |
37 | 625 |
} |
626 |
} |
|
627 |
||
628 |
// ----------------------------------------------------------- |
|
629 |
// CPhoneStateIdle::DialVoiceCallL |
|
630 |
// ----------------------------------------------------------- |
|
631 |
// |
|
632 |
EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
|
633 |
{ |
|
634 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
|
65 | 635 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 636 |
TPhoneCmdParamBoolean globalNotifierParam; |
637 |
globalNotifierParam.SetBoolean( ETrue ); |
|
638 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
639 |
&globalNotifierParam ); |
|
640 |
CPhoneState::DialVoiceCallL(); |
|
641 |
} |
|
642 |
||
643 |
// ----------------------------------------------------------------------------- |
|
644 |
// CPhoneStateIdle::RestoreOngoing |
|
645 |
// ----------------------------------------------------------------------------- |
|
646 |
// |
|
647 |
TBool CPhoneStateIdle::RestoreOngoing() |
|
648 |
{ |
|
649 |
TInt restoreValue; |
|
650 |
RProperty::Get( KUidSystemCategory, |
|
651 |
conn::KUidBackupRestoreKey, |
|
652 |
restoreValue ); |
|
653 |
return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
|
654 |
} |
|
655 |
||
656 |
// ----------------------------------------------------------- |
|
657 |
// CPhoneStateIdle::HandleVoiceCallCommandL() |
|
658 |
// ----------------------------------------------------------- |
|
659 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
660 |
void CPhoneStateIdle::HandleVoiceCallCommandL() |
37 | 661 |
{ |
662 |
__LOGMETHODSTARTEND( |
|
663 |
EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
|
74 | 664 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 665 |
{ |
74 | 666 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 667 |
if ( !IsSimOk() ) |
668 |
{ |
|
669 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ; |
|
670 |
iStateMachine->SendPhoneEngineMessage( |
|
671 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
672 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
673 |
return; |
|
674 |
} |
|
675 |
||
676 |
#ifdef _DEBUG |
|
677 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
678 |
{ |
|
679 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
680 |
SendExitCommandL(); |
|
681 |
} |
|
682 |
else |
|
683 |
#endif // _DEBUG |
|
684 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
685 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
686 |
DialVoiceCallL(); |
37 | 687 |
CleanupStack::PopAndDestroy( phoneNumber ); |
688 |
} |
|
689 |
} |
|
690 |
} |
|
691 |
||
74 | 692 |
// ----------------------------------------------------------- |
693 |
// CPhoneStateIdle::ChangeTo |
|
694 |
// ----------------------------------------------------------- |
|
695 |
// |
|
696 |
void CPhoneStateIdle::ChangeTo( TInt aState ) |
|
697 |
{ |
|
698 |
__PHONELOG1( EBasic, EPhoneControl, |
|
699 |
"PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ", |
|
700 |
aState ); |
|
701 |
iStateMachine->ChangeState( aState ); |
|
702 |
} |
|
78 | 703 |
|
704 |
// ----------------------------------------------------------- |
|
705 |
// CPhoneStateIdle::LaunchQtProcessL |
|
706 |
// ----------------------------------------------------------- |
|
707 |
// |
|
708 |
void CPhoneStateIdle::LaunchQtProcessL(TUid aUid) |
|
709 |
{ |
|
710 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchQtProcessL()" ); |
|
711 |
TApaAppInfo appInfo; |
|
712 |
RApaLsSession lsSession; |
|
713 |
User::LeaveIfError( lsSession.Connect() ); |
|
714 |
CleanupClosePushL( lsSession ); |
|
715 |
User::LeaveIfError( lsSession.GetAppInfo( appInfo, aUid ) ); |
|
716 |
CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); |
|
717 |
cmdLine->SetExecutableNameL( appInfo.iFullName ); |
|
718 |
cmdLine->SetCommandL( EApaCommandRun ); |
|
719 |
User::LeaveIfError( lsSession.StartApp( *cmdLine ) ); |
|
720 |
CleanupStack::PopAndDestroy( 2 ); |
|
721 |
} |
|
74 | 722 |
|
78 | 723 |
// ----------------------------------------------------------- |
724 |
// CPhoneStateIdle::CloseQtProcess |
|
725 |
// ----------------------------------------------------------- |
|
726 |
// |
|
727 |
void CPhoneStateIdle::CloseQtProcess(TUid aUid) |
|
728 |
{ |
|
729 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::CloseQtProcess()" ); |
|
730 |
TApaTaskList appList( iEnv->WsSession() ); |
|
731 |
TApaTask task = appList.FindApp( aUid ); |
|
732 |
if ( task.Exists() ) |
|
733 |
{ |
|
734 |
task.KillTask(); |
|
735 |
} |
|
736 |
} |
|
737 |
||
37 | 738 |
// End of File |