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