author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:21 +0100 | |
branch | GCC_SURGE |
changeset 51 | f39ed5e045e0 |
parent 22 | 6bb1b21d2484 |
parent 46 | bc5a64e5bc3c |
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> |
|
33 |
||
34 |
#include "cphonepubsubproxy.h" |
|
35 |
#include "cphonecenrepproxy.h" |
|
36 |
#include "cphonestateidle.h" |
|
37 |
#include "tphonecmdparaminteger.h" |
|
38 |
#include "tphonecmdparamboolean.h" |
|
39 |
#include "tphonecmdparamglobalnote.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
40 |
#include "tphonecmdparamkeycapture.h" |
37 | 41 |
#include "tphonecmdparamstring.h" |
42 |
#include "tphonecmdparamboolean.h" |
|
43 |
#include "mphonestatemachine.h" |
|
44 |
#include "phonestatedefinitions.h" |
|
45 |
#include "tphonecmdparamappinfo.h" |
|
46 |
#include "cphonekeys.h" |
|
47 |
||
48 |
#include "tphonecmdparamcallstatedata.h" |
|
49 |
#include "phoneviewcommanddefinitions.h" |
|
50 |
#include "phoneui.hrh" |
|
51 |
#include "phonerssbase.h" |
|
52 |
#include "cphonemainresourceresolver.h" |
|
53 |
#include "cphonecenrepproxy.h" |
|
54 |
#include "cphonepubsubproxy.h" |
|
55 |
#include "phonelogger.h" |
|
56 |
#include "phoneui.pan" |
|
57 |
#include "mphonecustomization.h" |
|
58 |
||
59 |
//CONSTANTS |
|
60 |
const TInt KMaxParamLength = 1024; |
|
61 |
||
62 |
// ================= MEMBER FUNCTIONS ======================= |
|
63 |
||
64 |
// C++ default constructor can NOT contain any code, that |
|
65 |
// might leave. |
|
66 |
// |
|
67 |
EXPORT_C CPhoneStateIdle::CPhoneStateIdle( |
|
68 |
MPhoneStateMachine* aStateMachine, |
|
69 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
70 |
MPhoneCustomization* aCustomization ) : |
|
71 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ) |
|
72 |
{ |
|
73 |
} |
|
74 |
||
75 |
// Destructor |
|
76 |
EXPORT_C CPhoneStateIdle::~CPhoneStateIdle() |
|
77 |
{ |
|
78 |
} |
|
79 |
||
80 |
// ----------------------------------------------------------- |
|
81 |
// CPhoneStateIdle::ConstructL() |
|
82 |
// ----------------------------------------------------------- |
|
83 |
// |
|
84 |
EXPORT_C void CPhoneStateIdle::ConstructL() |
|
85 |
{ |
|
86 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() "); |
|
87 |
CPhoneState::BaseConstructL(); |
|
88 |
||
89 |
// Set send key activation on. |
|
90 |
TPhoneCmdParamBoolean boolean; |
|
91 |
boolean.SetBoolean( ETrue ); |
|
92 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, |
|
93 |
&boolean ); |
|
94 |
||
95 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreatePhoneBookServices ); |
|
96 |
} |
|
97 |
||
98 |
// ----------------------------------------------------------- |
|
99 |
// CPhoneStateIdle::NewL() |
|
100 |
// ----------------------------------------------------------- |
|
101 |
// |
|
102 |
CPhoneStateIdle* CPhoneStateIdle::NewL( |
|
103 |
MPhoneStateMachine* aStateMachine, |
|
104 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
105 |
MPhoneCustomization* aPhoneCustomization ) |
|
106 |
{ |
|
107 |
CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( |
|
108 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
109 |
||
110 |
CleanupStack::PushL( self ); |
|
111 |
self->ConstructL(); |
|
112 |
CleanupStack::Pop( self ); |
|
113 |
||
114 |
return self; |
|
115 |
} |
|
116 |
||
117 |
// ----------------------------------------------------------- |
|
118 |
// CPhoneStateIdle::HandleKeyEventL |
|
119 |
// ----------------------------------------------------------- |
|
120 |
// |
|
121 |
EXPORT_C void CPhoneStateIdle::HandleKeyEventL( |
|
122 |
const TKeyEvent& aKeyEvent, |
|
123 |
TEventCode aEventCode ) |
|
124 |
{ |
|
125 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) "); |
|
126 |
// Security mode check |
|
127 |
TPhoneCmdParamBoolean isSecurityMode; |
|
128 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
129 |
// Number entry is blocked, if active Query |
|
130 |
if ( !IsAnyQueryActiveL() ) |
|
131 |
{ |
|
132 |
// Handle numeric keys when key events are received in idle state |
|
133 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
134 |
} |
|
135 |
else if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( |
|
136 |
aKeyEvent, aEventCode ) ) |
|
137 |
{ |
|
138 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
139 |
// Handle numeric keys when key events are received in single state |
|
140 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
141 |
} |
|
142 |
else if ( aEventCode == EEventKeyUp ) |
|
143 |
{ |
|
144 |
// Provide up event to engine. |
|
145 |
// Otherwise DTMF tone keeps playing. |
|
146 |
iStateMachine->SendPhoneEngineMessage( |
|
147 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
148 |
__PHONELOG( EBasic, EPhoneControl, |
|
149 |
"PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" ); |
|
150 |
} |
|
151 |
} |
|
152 |
||
153 |
// ----------------------------------------------------------- |
|
154 |
// CPhoneStateIdle::HandleNumberEntryClearedL() |
|
155 |
// ----------------------------------------------------------- |
|
156 |
// |
|
157 |
EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL() |
|
158 |
{ |
|
159 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) "); |
|
160 |
||
161 |
if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
162 |
{ |
|
163 |
// if still idle ( f.e not incoming call arrived when rfs ) |
|
164 |
if ( iStateMachine->State() == this ) |
|
165 |
{ |
|
166 |
DisplayIdleScreenL(); |
|
167 |
} |
|
168 |
} |
|
169 |
else |
|
170 |
{ |
|
171 |
StartShowSecurityNoteL(); |
|
172 |
} |
|
173 |
} |
|
174 |
||
175 |
// ----------------------------------------------------------- |
|
176 |
// CPhoneStateIdle::HandleKeyMessageL |
|
177 |
// ----------------------------------------------------------- |
|
178 |
// |
|
179 |
EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( |
|
180 |
TPhoneKeyEventMessages aMessage, |
|
181 |
TKeyCode aCode ) |
|
182 |
{ |
|
183 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) "); |
|
184 |
||
185 |
if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) ) |
|
186 |
{ |
|
187 |
return; |
|
188 |
} |
|
189 |
||
190 |
switch ( aCode ) |
|
191 |
{ |
|
192 |
case EKeyEnd: |
|
193 |
// This key even occur only in idle state, behaviour for this should |
|
194 |
// be same as long end-key press. (Bug in window server) |
|
195 |
HandleEndKeyPressL( EPhoneKeyLongPress ); |
|
196 |
break; |
|
197 |
||
198 |
// end-key |
|
199 |
case EKeyNo: |
|
200 |
HandleEndKeyPressL( aMessage ); |
|
201 |
break; |
|
202 |
||
203 |
// send-key |
|
204 |
case EKeyYes: |
|
205 |
||
206 |
if ( iOnScreenDialer ) |
|
207 |
{ |
|
208 |
if ( IsNumberEntryUsedL() ) |
|
209 |
{ |
|
210 |
// Security mode check |
|
211 |
TPhoneCmdParamBoolean isSecurityMode; |
|
212 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
213 |
||
214 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
215 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
216 |
&numberEntryCountParam ); |
|
217 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
218 |
||
219 |
// Query on top of dialer |
|
220 |
if ( IsAnyQueryActiveL() ) |
|
221 |
{ |
|
222 |
return; |
|
223 |
} |
|
224 |
else if ( IsMenuBarVisibleL() ) |
|
225 |
{ |
|
226 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
227 |
return; |
|
228 |
} |
|
229 |
||
230 |
else if ( neLength == 0 && !isSecurityMode.Boolean()) |
|
231 |
{ |
|
232 |
// start logs |
|
233 |
iViewCommandHandle->HandleCommandL( |
|
234 |
EPhoneDialerCmdLog ); |
|
235 |
return; |
|
236 |
} |
|
237 |
HandleSendCommandL(); |
|
238 |
} |
|
239 |
// If dialer is not open but phone is in foreground and phone receives |
|
240 |
// send-key event we have to check if security mode is true and if it |
|
241 |
// is then open emergency dialer. |
|
242 |
else if ( !IsNumberEntryUsedL() ) |
|
243 |
{ |
|
244 |
// Security mode check |
|
245 |
TPhoneCmdParamBoolean isSecurityMode; |
|
246 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
247 |
||
248 |
if ( isSecurityMode.Boolean()) |
|
249 |
{ |
|
250 |
// launch dialer. |
|
251 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
252 |
} |
|
253 |
} |
|
254 |
} |
|
255 |
else // iOnScreenDialer false, non-touch. |
|
256 |
{ |
|
257 |
HandleSendCommandL(); |
|
258 |
} |
|
259 |
break; |
|
260 |
||
261 |
case EKeyApplication0: |
|
262 |
{ |
|
263 |
// If dialer is not open but phone is in foreground and phone receives |
|
264 |
// applicaion-key event we have to open emergency dialer. No need own |
|
265 |
// securitymode check because Applicationkey only captured in securitymode. |
|
266 |
if ( !IsNumberEntryUsedL() ) |
|
267 |
{ |
|
268 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
269 |
} |
|
270 |
} |
|
271 |
break; |
|
272 |
||
273 |
// "O" key |
|
274 |
case KPhoneDtmf0Character: |
|
275 |
if ( aMessage == EPhoneKeyLongPress && IsSimOk() ) |
|
276 |
{ |
|
277 |
LaunchApplicationL(); |
|
278 |
} |
|
279 |
break; |
|
280 |
||
281 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
282 |
case EKeyEnter: |
|
283 |
if ( IsNumberEntryVisibleL() ) |
|
284 |
{ |
|
285 |
HandleCommandL( EPhoneCmdOptions ); |
|
286 |
} |
|
287 |
break; |
|
288 |
#endif |
|
289 |
||
290 |
default: |
|
291 |
break; |
|
292 |
} |
|
293 |
} |
|
294 |
||
295 |
// ----------------------------------------------------------- |
|
296 |
// CPhoneStateIdle::HandlePhoneEngineMessageL |
|
297 |
// ----------------------------------------------------------- |
|
298 |
// |
|
299 |
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( |
|
300 |
const TInt aMessage, |
|
301 |
TInt aCallId ) |
|
302 |
{ |
|
303 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) "); |
|
304 |
switch ( aMessage ) |
|
305 |
{ |
|
306 |
case MEngineMonitor::EPEMessageIncoming: |
|
307 |
HandleIncomingL( aCallId ); |
|
308 |
break; |
|
309 |
||
310 |
case MEngineMonitor::EPEMessageDialing: |
|
311 |
HandleDialingL( aCallId ); |
|
312 |
break; |
|
313 |
||
314 |
case MEngineMonitor::EPEMessageConnected: |
|
315 |
HandleConnectedL( aCallId ); |
|
316 |
break; |
|
317 |
||
318 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
319 |
// Note that after the sending of SS |
|
320 |
// strings the view stays in Dialer. |
|
321 |
if ( !iOnScreenDialer ) |
|
322 |
{ |
|
323 |
if ( IsNumberEntryUsedL() ) |
|
324 |
{ |
|
325 |
// Show the number entry if it exists |
|
326 |
SetNumberEntryVisibilityL(ETrue); |
|
327 |
} |
|
328 |
else if ( NeedToSendToBackgroundL() ) |
|
329 |
{ |
|
330 |
// Continue displaying current app but set up the |
|
331 |
// idle screen in the background |
|
332 |
SetupIdleScreenInBackgroundL(); |
|
333 |
} |
|
334 |
else |
|
335 |
{ |
|
336 |
// Display idle screen |
|
337 |
DisplayIdleScreenL(); |
|
338 |
} |
|
339 |
} |
|
340 |
break; |
|
341 |
||
342 |
case MEngineMonitor::EPEMessageIdle: |
|
343 |
HandleIdleL( aCallId ); |
|
344 |
break; |
|
345 |
||
346 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
347 |
SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue ); |
37 | 348 |
break; |
349 |
||
350 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
351 |
DialVoiceCallL(); |
|
352 |
break; |
|
353 |
||
354 |
default: |
|
355 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
356 |
break; |
|
357 |
} |
|
358 |
} |
|
359 |
||
360 |
// ----------------------------------------------------------- |
|
361 |
// CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
362 |
// Default handling for incoming message |
|
363 |
// (other items were commented in a header). |
|
364 |
// ----------------------------------------------------------- |
|
365 |
// |
|
366 |
void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
367 |
{ |
|
368 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
|
369 |
||
370 |
HandleAudioAvailableOutputChangedL(); |
|
371 |
||
372 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume ); |
|
373 |
||
374 |
SetRingingTonePlaybackL( aCallId ); |
|
375 |
||
376 |
BeginTransEffectLC( ENumberEntryClose ); |
|
377 |
BeginUiUpdateLC(); |
|
378 |
||
379 |
// Hide the number entry if it exists |
|
380 |
if ( IsNumberEntryUsedL() ) |
|
381 |
{ |
|
382 |
SetNumberEntryVisibilityL(EFalse); |
|
383 |
} |
|
384 |
||
385 |
// Display incoming call |
|
386 |
DisplayIncomingCallL( aCallId ); |
|
387 |
||
388 |
// Show incoming call buttons |
|
389 |
SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
390 |
||
391 |
// Disable HW keys and Call UI if needed |
|
392 |
CheckDisableHWKeysAndCallUIL(); |
|
393 |
||
394 |
SetBackButtonActive(EFalse); |
|
395 |
||
396 |
EndUiUpdate(); |
|
397 |
||
398 |
EndTransEffect(); |
|
399 |
||
400 |
// Go to incoming state |
|
401 |
iCbaManager->UpdateIncomingCbaL( aCallId ); |
|
402 |
UpdateSilenceButtonDimming(); |
|
403 |
UpdateIncomingContextMenuL( aCallId ); |
|
404 |
//Dim toolbar items |
|
405 |
SetToolbarDimming( ETrue ); |
|
406 |
//request that dimmed toolbar is visible. |
|
407 |
iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
|
408 |
iStateMachine->ChangeState( EPhoneStateIncoming ); |
|
409 |
||
410 |
// Reset divert indication |
|
411 |
SetDivertIndication( EFalse ); |
|
412 |
} |
|
413 |
||
414 |
// ----------------------------------------------------------- |
|
415 |
// CPhoneStateIdle::HandleDiallingL |
|
416 |
// Default handling for dialling message |
|
417 |
// (other items were commented in a header). |
|
418 |
// ----------------------------------------------------------- |
|
419 |
// |
|
420 |
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
|
421 |
{ |
|
422 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
|
423 |
||
424 |
BeginTransEffectLC( ENumberEntryClose ); |
|
425 |
BeginUiUpdateLC(); |
|
426 |
||
427 |
// Display call setup |
|
428 |
DisplayCallSetupL( aCallId ); |
|
429 |
||
430 |
// Show call setup buttons |
|
431 |
SetTouchPaneButtons( EPhoneCallSetupButtons ); |
|
432 |
||
433 |
EndUiUpdate(); |
|
434 |
||
435 |
// Remove any phone dialogs if they are displayed |
|
436 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
437 |
||
438 |
// Go to call setup state |
|
439 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
440 |
||
441 |
SetToolbarDimming( ETrue ); |
|
442 |
||
443 |
EndTransEffect(); |
|
444 |
||
445 |
iStateMachine->ChangeState( EPhoneStateCallSetup ); |
|
446 |
} |
|
447 |
||
448 |
// ----------------------------------------------------------- |
|
449 |
// CPhoneStateIdle::HandleConnectedL |
|
450 |
// Message Handling function for message EPEMessageConnected |
|
451 |
// This could happen during transaction from Emergency mode |
|
452 |
// to Normal mode where a network status change is received |
|
453 |
// from PE after PE initiates an MO call. Since PE messages |
|
454 |
// are asynchronous, this sequence can occur in any order. |
|
455 |
// (other items were commented in a header). |
|
456 |
// ----------------------------------------------------------- |
|
457 |
// |
|
458 |
void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
|
459 |
{ |
|
460 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
|
461 |
// Keep Phone app in the foreground if it is external |
|
462 |
if ( !TopAppIsDisplayedL() ) |
|
463 |
{ |
|
464 |
TPhoneCmdParamInteger uidParam; |
|
465 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
466 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
467 |
&uidParam ); |
|
468 |
} |
|
469 |
||
470 |
BeginTransEffectLC( ENumberEntryClose ); |
|
471 |
BeginUiUpdateLC(); |
|
472 |
||
473 |
// Remove the number entry |
|
474 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
475 |
||
476 |
// Display call setup header |
|
477 |
DisplayCallSetupL( aCallId ); |
|
478 |
||
479 |
// Update single active call |
|
480 |
UpdateSingleActiveCallL( aCallId ); |
|
481 |
||
482 |
// Update touch buttons |
|
483 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
|
484 |
SetToolbarDimming( EFalse ); |
|
485 |
||
486 |
EndUiUpdate(); |
|
487 |
EndTransEffect(); |
|
488 |
||
489 |
// Go to single state |
|
490 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
491 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
492 |
} |
|
493 |
||
494 |
// ----------------------------------------------------------- |
|
495 |
// CPhoneStateIdle::HandleCommandL |
|
496 |
// ----------------------------------------------------------- |
|
497 |
// |
|
498 |
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand ) |
|
499 |
{ |
|
500 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) "); |
|
501 |
TBool commandStatus = ETrue; |
|
502 |
||
503 |
switch( aCommand ) |
|
504 |
{ |
|
505 |
case EPhoneCmdOptions: |
|
506 |
{ |
|
507 |
// Open number entry menubar |
|
508 |
TPhoneCmdParamInteger integerParam; |
|
509 |
||
510 |
integerParam.SetInteger( |
|
511 |
CPhoneMainResourceResolver::Instance()-> |
|
512 |
ResolveResourceID( EPhoneNumberAcqMenubar ) ); |
|
513 |
||
514 |
iViewCommandHandle->ExecuteCommandL( |
|
515 |
EPhoneViewMenuBarOpen, &integerParam ); |
|
516 |
break; |
|
517 |
} |
|
518 |
||
519 |
case EPhoneNumberAcqCmdCall: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
520 |
HandleVoiceCallCommandL(); |
37 | 521 |
break; |
522 |
case EPhoneNumberAcqCmdSendCommand: |
|
523 |
HandleSendCommandL(); |
|
524 |
break; |
|
525 |
||
526 |
case EPhoneNumberAcqCmdVideoCall: |
|
527 |
DialVideoCallL(); |
|
528 |
break; |
|
529 |
||
530 |
case EPhoneCmdBack: |
|
531 |
HandleBackCommandL(); |
|
532 |
break; |
|
533 |
||
534 |
default: |
|
535 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
536 |
break; |
|
537 |
} |
|
538 |
||
539 |
return commandStatus; |
|
540 |
||
541 |
} |
|
542 |
||
543 |
// ----------------------------------------------------------------------------- |
|
544 |
// CPhoneStateIdle::ProcessCommandL |
|
545 |
// ----------------------------------------------------------------------------- |
|
546 |
// |
|
547 |
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand ) |
|
548 |
{ |
|
549 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) "); |
|
550 |
TBool commandStatus = EFalse; |
|
551 |
switch( aCommand ) |
|
552 |
{ |
|
553 |
case EAknSoftkeyContextOptions: |
|
554 |
{ |
|
555 |
// Open number entry OK menubar |
|
556 |
TPhoneCmdParamInteger integerParam; |
|
557 |
integerParam.SetInteger( |
|
558 |
CPhoneMainResourceResolver::Instance()-> |
|
559 |
ResolveResourceID( EPhoneNumberAcqOkMenubar ) ); |
|
560 |
iViewCommandHandle->ExecuteCommandL( |
|
561 |
EPhoneViewMenuBarOpen, &integerParam ); |
|
562 |
commandStatus = ETrue; |
|
563 |
} |
|
564 |
break; |
|
565 |
||
566 |
default: |
|
567 |
commandStatus = CPhoneState::ProcessCommandL( aCommand ); |
|
568 |
break; |
|
569 |
} |
|
570 |
return commandStatus; |
|
571 |
} |
|
572 |
||
573 |
// ----------------------------------------------------------------------------- |
|
574 |
// CPhoneStateIdle::HandleRemConCommandL |
|
575 |
// ----------------------------------------------------------------------------- |
|
576 |
// |
|
577 |
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL( |
|
578 |
TRemConCoreApiOperationId /*aOperationId */, |
|
579 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
580 |
{ |
|
581 |
return EFalse; |
|
582 |
} |
|
583 |
||
584 |
// ----------------------------------------------------------- |
|
585 |
// CPhoneStateIdle::DialL |
|
586 |
// ----------------------------------------------------------- |
|
587 |
// |
|
588 |
EXPORT_C void CPhoneStateIdle::DialL( |
|
589 |
const TDesC& aNumber, |
|
590 |
TPhoneNumberType aNumberType, |
|
591 |
TDialInitiationMethod /*aDialMethod*/ ) |
|
592 |
{ |
|
593 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber ); |
|
594 |
||
595 |
if ( aNumberType == EPhoneNumberTypeVideo && |
|
596 |
FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
597 |
{ |
|
598 |
DialMultimediaCallL(); |
|
599 |
} |
|
600 |
else if ( EPhoneNumberTypeVoip == aNumberType && |
|
601 |
iCustomization ) |
|
602 |
{ |
|
603 |
iCustomization->HandleDialL( aNumber ); |
|
604 |
} |
|
605 |
else |
|
606 |
{ |
|
607 |
DialVoiceCallL(); |
|
608 |
} |
|
609 |
} |
|
610 |
||
611 |
// ----------------------------------------------------------- |
|
612 |
// CPhoneStateIdle::HandleBackCommandL |
|
613 |
// ----------------------------------------------------------- |
|
614 |
// |
|
615 |
void CPhoneStateIdle::HandleBackCommandL() |
|
616 |
{ |
|
617 |
TBool previousApp(EFalse); |
|
618 |
// If previous app activation is true then open |
|
619 |
// previous application. |
|
620 |
if ( iOnScreenDialer && |
|
621 |
IsSimOk() ) |
|
622 |
{ |
|
623 |
TPhoneCmdParamBoolean booleanParam; |
|
624 |
iViewCommandHandle->ExecuteCommandL( |
|
625 |
EPhoneViewGetActivatePreviousApp, &booleanParam ); |
|
626 |
||
627 |
if ( booleanParam.Boolean() ) |
|
628 |
{ |
|
629 |
// Open previous app. |
|
630 |
iViewCommandHandle->ExecuteCommandL( |
|
631 |
EPhoneViewActivatePreviousApp ); |
|
632 |
||
633 |
// Remove number entry from screen |
|
634 |
iViewCommandHandle->ExecuteCommandL( |
|
635 |
EPhoneViewRemoveNumberEntry ); |
|
636 |
||
637 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
638 |
previousApp = ETrue; |
|
639 |
} |
|
640 |
} |
|
641 |
||
642 |
if ( !previousApp ) |
|
643 |
{ |
|
644 |
// Remove number entry from screen |
|
645 |
iViewCommandHandle->ExecuteCommandL( |
|
646 |
EPhoneViewRemoveNumberEntry ); |
|
647 |
// Do state-specific operation when number entry is cleared |
|
648 |
HandleNumberEntryClearedL(); |
|
649 |
} |
|
650 |
} |
|
651 |
||
652 |
// ----------------------------------------------------------- |
|
653 |
// CPhoneStateIdle::DialVideoCallL |
|
654 |
// ----------------------------------------------------------- |
|
655 |
// |
|
656 |
void CPhoneStateIdle::DialVideoCallL() |
|
657 |
{ |
|
658 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) "); |
|
659 |
if ( IsNumberEntryUsedL() ) |
|
660 |
{ |
|
661 |
// get the number entry contents |
|
662 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
663 |
#ifdef _DEBUG |
|
664 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
665 |
{ |
|
666 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
667 |
SendExitCommandL(); |
|
668 |
} |
|
669 |
else |
|
670 |
#endif // _DEBUG |
|
671 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
672 |
// call the number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
673 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
674 |
DialMultimediaCallL(); |
37 | 675 |
|
676 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
677 |
} |
|
678 |
} |
|
679 |
} |
|
680 |
||
681 |
// ----------------------------------------------------------- |
|
682 |
// CPhoneStateIdle::DisplayIncomingCallL |
|
683 |
// ----------------------------------------------------------- |
|
684 |
// |
|
685 |
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
|
686 |
{ |
|
687 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
|
688 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
|
689 |
Panic( EPhoneCtrlInvariant ) ); |
|
690 |
// Close menu bar, if it is displayed |
|
691 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
692 |
||
693 |
// Remove any phone dialogs if they are displayed |
|
694 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
695 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
696 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
697 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
698 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
699 |
|
37 | 700 |
// Capture keys when there is an incoming call |
701 |
CaptureKeysDuringCallNotificationL( ETrue ); |
|
702 |
||
703 |
// Indicate that the Phone needs to be sent to the background if |
|
704 |
// an application other than the top application is in the foreground |
|
705 |
TPhoneCmdParamBoolean booleanParam; |
|
706 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
707 |
iViewCommandHandle->ExecuteCommandL( |
|
708 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
709 |
&booleanParam ); |
|
710 |
||
711 |
// Bring Phone app in the foreground |
|
712 |
TPhoneCmdParamInteger uidParam; |
|
713 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
714 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
715 |
&uidParam ); |
|
716 |
||
717 |
// Set Phone as the top application |
|
718 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
719 |
&uidParam ); |
|
720 |
||
721 |
// Disable global notes when there is an incoming call |
|
722 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
723 |
globalNotifierParam.SetBoolean( ETrue ); |
|
724 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
725 |
&globalNotifierParam ); |
|
726 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
727 |
&globalNotifierParam ); |
|
728 |
||
729 |
DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
|
730 |
} |
|
731 |
||
732 |
// ----------------------------------------------------------- |
|
733 |
// CPhoneStateIdle::DisplayCallSetupL |
|
734 |
// ----------------------------------------------------------- |
|
735 |
// |
|
736 |
EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId ) |
|
737 |
{ |
|
738 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) "); |
|
739 |
__ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
740 |
||
741 |
// Close menu bar, if it is displayed |
|
742 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
743 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
744 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
745 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
746 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
747 |
|
37 | 748 |
// Capture keys when the phone is dialling |
749 |
CaptureKeysDuringCallNotificationL( ETrue ); |
|
750 |
||
751 |
// Indicate that the Phone needs to be sent to the background if |
|
752 |
// an application other than the top application is in the foreground |
|
753 |
TPhoneCmdParamBoolean booleanParam; |
|
754 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
755 |
||
756 |
iViewCommandHandle->ExecuteCommandL( |
|
757 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
758 |
&booleanParam ); |
|
759 |
||
760 |
// Bring Phone app in the foreground |
|
761 |
TPhoneCmdParamInteger uidParam; |
|
762 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
763 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
764 |
&uidParam ); |
|
765 |
||
766 |
// Set Phone as the top application |
|
767 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
768 |
&uidParam ); |
|
769 |
||
770 |
// Display call setup header |
|
771 |
DisplayHeaderForOutgoingCallL( aCallId ); |
|
772 |
} |
|
773 |
||
774 |
// ----------------------------------------------------------- |
|
775 |
// CPhoneStateIdle::HandleIdleForegroundEventL |
|
776 |
// ----------------------------------------------------------- |
|
777 |
// |
|
778 |
EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
|
779 |
{ |
|
780 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
|
781 |
||
782 |
if ( IsNumberEntryUsedL() ) |
|
783 |
{ |
|
784 |
// If numberentry is used then we need to call EPhoneViewSetDialerControlVisible |
|
785 |
// to ensure that numberentry/dialler is drawn to UI. |
|
786 |
TPhoneViewResponseId respond = |
|
787 |
iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible ); |
|
788 |
||
789 |
if ( respond && IsNumberEntryVisibleL() ) |
|
790 |
{ |
|
791 |
// Set Number Entry CBA |
|
792 |
iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
|
793 |
} |
|
794 |
} |
|
795 |
else if ( !IsAnyQueryActiveL() ) |
|
796 |
{ |
|
797 |
// Set idle as top application |
|
798 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
799 |
} |
|
800 |
} |
|
801 |
||
802 |
// ----------------------------------------------------------- |
|
803 |
// CPhoneStateIdle::HandlePhoneForegroundEventL |
|
804 |
// ----------------------------------------------------------- |
|
805 |
||
806 |
EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL() |
|
807 |
{ |
|
808 |
} |
|
809 |
||
810 |
// ----------------------------------------------------------- |
|
811 |
// CPhoneStateIdle::HandlePhoneFocusLostEventL |
|
812 |
// ----------------------------------------------------------- |
|
813 |
// |
|
814 |
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL() |
|
815 |
{ |
|
816 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) "); |
|
817 |
if ( !IsNumberEntryUsedL() ) |
|
818 |
{ |
|
819 |
// If NE/dialer is open add icon to FSW list. |
|
820 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
821 |
} |
|
822 |
} |
|
823 |
||
824 |
// ----------------------------------------------------------- |
|
825 |
// CPhoneStateIdle::HandleIdleL |
|
826 |
// ----------------------------------------------------------- |
|
827 |
// |
|
828 |
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
|
829 |
{ |
|
830 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
831 |
"CPhoneStateIdle::HandleIdleL()" ); |
|
832 |
||
833 |
// Remove all call headers |
|
834 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
|
835 |
||
836 |
// Close number entry |
|
837 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
838 |
||
839 |
// Remove all notes and dialogs |
|
840 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
841 |
} |
|
842 |
||
843 |
// ----------------------------------------------------------- |
|
844 |
// CPhoneStateIdle::HandleSendCommandL() |
|
845 |
// ----------------------------------------------------------- |
|
846 |
// |
|
847 |
EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
|
848 |
{ |
|
849 |
__LOGMETHODSTARTEND( |
|
850 |
EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
|
851 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
852 |
HandleVoiceCallCommandL(); |
37 | 853 |
} |
854 |
||
855 |
// ----------------------------------------------------------- |
|
856 |
// CPhoneStateIdle::LaunchApplicationL() |
|
857 |
// ----------------------------------------------------------- |
|
858 |
// |
|
859 |
void CPhoneStateIdle::LaunchApplicationL() |
|
860 |
{ |
|
861 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchApplicationL( ) "); |
|
862 |
// Check if only one number exists in the number |
|
863 |
// entry |
|
864 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
865 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
866 |
&numberEntryCountParam ); |
|
867 |
||
868 |
if ( numberEntryCountParam.Integer() == 1 ) |
|
869 |
{ |
|
870 |
// Remove the number entry window |
|
871 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
872 |
||
873 |
iStateMachine->SendPhoneEngineMessage( |
|
874 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
875 |
||
876 |
// Launch application. |
|
877 |
iViewCommandHandle->ExecuteCommandL( |
|
878 |
EPhoneViewLaunchApplication ); |
|
879 |
||
880 |
// Continue displaying current app but set up the |
|
881 |
// idle screen in the background |
|
882 |
SetupIdleScreenInBackgroundL(); |
|
883 |
} |
|
884 |
} |
|
885 |
||
886 |
// ----------------------------------------------------------- |
|
887 |
// CPhoneStateIdle:SendExitCommandL |
|
888 |
// ----------------------------------------------------------- |
|
889 |
// |
|
890 |
void CPhoneStateIdle::SendExitCommandL() |
|
891 |
{ |
|
892 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
|
893 |
// Remove number entry from screen |
|
894 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
895 |
||
896 |
// Simulate exit command |
|
897 |
CEikonEnv& eikEnv = *CEikonEnv::Static(); |
|
898 |
CCoeEnv& coeEnv = eikEnv; |
|
899 |
RWsSession& wsSession=coeEnv.WsSession(); |
|
900 |
TKeyEvent keyEvent; |
|
901 |
keyEvent.iCode = EEikCmdExit; |
|
902 |
keyEvent.iScanCode = EEikCmdExit; |
|
903 |
keyEvent.iModifiers = 0; |
|
904 |
keyEvent.iRepeats = 0; |
|
905 |
wsSession.SimulateKeyEvent( keyEvent ); |
|
906 |
wsSession.Flush(); |
|
907 |
||
908 |
iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
|
909 |
} |
|
910 |
||
911 |
// ----------------------------------------------------------- |
|
912 |
// CPhoneStateIdle::HandleEndKeyPressL |
|
913 |
// ----------------------------------------------------------- |
|
914 |
// |
|
915 |
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
916 |
{ |
|
917 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
|
918 |
||
919 |
// End key not handled also in phone startup when pressed during country/time/date query |
|
920 |
RWsSession sess = CCoeEnv::Static()->WsSession(); |
|
921 |
TApaTaskList appList( sess ); |
|
922 |
TApaTask startup = appList.FindApp( KUidStartupApplication ); |
|
923 |
||
924 |
if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() ) |
|
925 |
{ |
|
926 |
//Cancels e.g. USB notifier and Audio notifier. |
|
927 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
|
928 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewExitApplications ); |
|
929 |
// If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
|
930 |
// remove security note from screen. |
|
931 |
if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
932 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
933 |
{ |
|
934 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
935 |
} |
|
936 |
||
937 |
if ( IsSimOk() ) |
|
938 |
{ |
|
939 |
if ( aMessage == EPhoneKeyLongPress ) |
|
940 |
{ |
|
941 |
// Close all connections |
|
942 |
iStateMachine->SendPhoneEngineMessage( |
|
943 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
944 |
||
945 |
if ( IsNumberEntryUsedL() ) |
|
946 |
{ |
|
947 |
// Remove number entry from screen |
|
948 |
iViewCommandHandle->ExecuteCommandL( |
|
949 |
EPhoneViewRemoveNumberEntry ); |
|
950 |
// Do state-specific operation when number entry is cleared |
|
951 |
HandleNumberEntryClearedL(); |
|
952 |
||
953 |
// If long end key event occures then all calls are terminated and |
|
954 |
// dialer is closed, therefore tel.icon must be removed from FSW. |
|
955 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
956 |
} |
|
957 |
if ( !TopAppIsDisplayedL() ) |
|
958 |
{ |
|
959 |
// Display idle screen |
|
960 |
DisplayIdleScreenL(); |
|
961 |
} |
|
962 |
} |
|
963 |
else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
|
964 |
{ |
|
965 |
// Remove number entry from screen |
|
966 |
iViewCommandHandle->ExecuteCommandL( |
|
967 |
EPhoneViewRemoveNumberEntry ); |
|
968 |
// Do state-specific operation when number entry is cleared |
|
969 |
HandleNumberEntryClearedL(); |
|
970 |
} |
|
971 |
else if ( !TopAppIsDisplayedL() ) |
|
972 |
{ |
|
973 |
// Phone might not be the topmost app since it has |
|
974 |
// some dialog/query open therefore we need to check this |
|
975 |
// and remove dialog/phone. |
|
976 |
if ( IsAnyQueryActiveL() ) |
|
977 |
{ |
|
978 |
if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
979 |
{ |
|
980 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
981 |
} |
|
982 |
||
983 |
// Remove number entry from screen |
|
984 |
iViewCommandHandle->ExecuteCommandL( |
|
985 |
EPhoneViewRemoveNumberEntry ); |
|
986 |
} |
|
987 |
// Bring Idle app to the foreground |
|
988 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
989 |
} |
|
990 |
} |
|
991 |
else if ( IsNumberEntryUsedL() ) |
|
992 |
{ |
|
993 |
// Remove number entry from screen |
|
994 |
iViewCommandHandle->ExecuteCommandL( |
|
995 |
EPhoneViewRemoveNumberEntry ); |
|
996 |
StartShowSecurityNoteL(); |
|
997 |
} |
|
998 |
} |
|
999 |
} |
|
1000 |
||
1001 |
// --------------------------------------------------------- |
|
1002 |
// CPhoneStateIdle::OnlyHashInNumberEntryL |
|
1003 |
// --------------------------------------------------------- |
|
1004 |
// |
|
1005 |
EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL() |
|
1006 |
{ |
|
1007 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) "); |
|
1008 |
||
1009 |
if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( |
|
1010 |
KTelephonyLVFlagMannerMode ) ) |
|
1011 |
{ |
|
1012 |
ChangeMannerModeL(); |
|
1013 |
} |
|
1014 |
else |
|
1015 |
{ |
|
1016 |
StartAlsLineChangeTimerL(); |
|
1017 |
} |
|
1018 |
||
1019 |
// Check if any application launch functionality |
|
1020 |
// is configured for pressing hash for a long time |
|
1021 |
// the return value of CheckAppLaunchingL ignored. |
|
1022 |
CheckAppLaunchingL( TKeyCode( KPhoneDtmfHashCharacter ) ); |
|
1023 |
} |
|
1024 |
||
1025 |
// --------------------------------------------------------- |
|
1026 |
// CPhoneStateIdle::ChangeMannerModeL |
|
1027 |
// --------------------------------------------------------- |
|
1028 |
// |
|
1029 |
void CPhoneStateIdle::ChangeMannerModeL() |
|
1030 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1031 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) "); |
37 | 1032 |
} |
1033 |
||
1034 |
// ----------------------------------------------------------- |
|
1035 |
// CPhoneStateIdle::DialMultimediaCallL |
|
1036 |
// ----------------------------------------------------------- |
|
1037 |
// |
|
1038 |
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL() |
|
1039 |
{ |
|
1040 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() "); |
|
1041 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1042 |
Panic( EPhoneCtrlInvariant ) ); |
|
1043 |
||
1044 |
if ( RestoreOngoing() ) |
|
1045 |
{ |
|
1046 |
CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote ); |
|
1047 |
} |
|
1048 |
else |
|
1049 |
{ |
|
1050 |
CPhoneState::DialMultimediaCallL(); |
|
1051 |
} |
|
1052 |
} |
|
1053 |
||
1054 |
// ----------------------------------------------------------- |
|
1055 |
// CPhoneStateIdle::DialVoiceCallL |
|
1056 |
// ----------------------------------------------------------- |
|
1057 |
// |
|
1058 |
EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
|
1059 |
{ |
|
1060 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
|
1061 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1062 |
Panic( EPhoneCtrlInvariant ) ); |
|
1063 |
||
1064 |
// Disable global notes |
|
1065 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
1066 |
globalNotifierParam.SetBoolean( ETrue ); |
|
1067 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
1068 |
&globalNotifierParam ); |
|
1069 |
||
1070 |
CPhoneState::DialVoiceCallL(); |
|
1071 |
||
1072 |
} |
|
1073 |
||
1074 |
// ----------------------------------------------------------------------------- |
|
1075 |
// CPhoneStateIdle::RestoreOngoing |
|
1076 |
// ----------------------------------------------------------------------------- |
|
1077 |
// |
|
1078 |
TBool CPhoneStateIdle::RestoreOngoing() |
|
1079 |
{ |
|
1080 |
TInt restoreValue; |
|
1081 |
||
1082 |
RProperty::Get( KUidSystemCategory, |
|
1083 |
conn::KUidBackupRestoreKey, |
|
1084 |
restoreValue ); |
|
1085 |
||
1086 |
return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
|
1087 |
} |
|
1088 |
||
1089 |
// ----------------------------------------------------------------------------- |
|
1090 |
// CPhoneStateIdle::CheckAppLaunchingL |
|
1091 |
// ----------------------------------------------------------------------------- |
|
1092 |
// |
|
1093 |
TBool CPhoneStateIdle::CheckAppLaunchingL( const TKeyCode aCode ) |
|
1094 |
{ |
|
1095 |
TBool valuesFetched( EFalse ); |
|
1096 |
||
1097 |
if( !IsSimOk() ) |
|
1098 |
{ |
|
1099 |
return valuesFetched; |
|
1100 |
} |
|
1101 |
||
1102 |
TPhoneCmdParamAppInfo appInfo; |
|
1103 |
HBufC8* appParam = HBufC8::NewL( KMaxParamLength ); |
|
1104 |
CleanupStack::PushL( appParam ); |
|
1105 |
||
1106 |
TPhoneCmdParamInteger numberEntryCount; |
|
1107 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
1108 |
&numberEntryCount ); |
|
1109 |
||
1110 |
TBool isValidAppLaunchingKeyEvent = EFalse; |
|
1111 |
if ( iCustomization && iCustomization->AllowAlphaNumericMode() && |
|
1112 |
TKeyCode( KPhoneDtmfHashCharacter ) == aCode ) |
|
1113 |
{ |
|
1114 |
// If alphanumeric mode is supported FEP changes text input mode with |
|
1115 |
// long hash and removes hash from number entry. |
|
1116 |
isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 0 ); |
|
1117 |
} |
|
1118 |
else |
|
1119 |
{ |
|
1120 |
isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 1 ); |
|
1121 |
} |
|
1122 |
||
1123 |
if ( isValidAppLaunchingKeyEvent ) |
|
1124 |
{ |
|
1125 |
TRAPD( err, |
|
1126 |
CPhoneCenRepProxy::Instance()->FetchValuesFromCenRepL( |
|
1127 |
appInfo, aCode, appParam, valuesFetched ) ); |
|
1128 |
||
1129 |
if ( KErrNone == err && valuesFetched ) |
|
1130 |
{ |
|
1131 |
// Remove the number entry window |
|
1132 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1133 |
||
1134 |
// Stop playing DTMF tone |
|
1135 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1136 |
||
1137 |
TPhoneCommandParam* phoneCommandParam = |
|
1138 |
static_cast<TPhoneCommandParam*>( &appInfo ); |
|
1139 |
iViewCommandHandle->ExecuteCommandL( |
|
1140 |
EPhoneViewActivateAppViewConventional, |
|
1141 |
phoneCommandParam ); |
|
1142 |
||
1143 |
// Continue displaying current app but set up the |
|
1144 |
// idle screen in the background |
|
1145 |
SetupIdleScreenInBackgroundL(); |
|
1146 |
} |
|
1147 |
} |
|
1148 |
CleanupStack::PopAndDestroy( appParam ); |
|
1149 |
return valuesFetched; |
|
1150 |
} |
|
1151 |
||
1152 |
// ----------------------------------------------------------- |
|
1153 |
// CPhoneStateIdle::HandleVoiceCallCommandL() |
|
1154 |
// ----------------------------------------------------------- |
|
1155 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1156 |
void CPhoneStateIdle::HandleVoiceCallCommandL() |
37 | 1157 |
{ |
1158 |
__LOGMETHODSTARTEND( |
|
1159 |
EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
|
1160 |
||
1161 |
if ( IsNumberEntryUsedL() ) |
|
1162 |
{ |
|
1163 |
// Handle send key short press, get the number entry contents. |
|
1164 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
1165 |
||
1166 |
if ( !IsSimOk() ) |
|
1167 |
{ |
|
1168 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ; |
|
1169 |
iStateMachine->SendPhoneEngineMessage( |
|
1170 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
1171 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
1172 |
return; |
|
1173 |
} |
|
1174 |
||
1175 |
#ifdef _DEBUG |
|
1176 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
1177 |
{ |
|
1178 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
1179 |
SendExitCommandL(); |
|
1180 |
} |
|
1181 |
else |
|
1182 |
#endif // _DEBUG |
|
1183 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1184 |
// call the number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1185 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1186 |
DialVoiceCallL(); |
37 | 1187 |
CleanupStack::PopAndDestroy( phoneNumber ); |
1188 |
} |
|
1189 |
} |
|
1190 |
} |
|
1191 |
||
1192 |
// End of File |