author | William Roberts <williamr@symbian.org> |
Wed, 15 Sep 2010 17:56:16 +0100 | |
changeset 68 | 82f96d64ae88 |
parent 56 | 5bcb308bd24d |
child 72 | c76a0b1755b9 |
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 CPhoneState class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include <avkon.rsg> |
|
21 |
#include <bautils.h> |
|
22 |
#include <eikenv.h> |
|
23 |
#include <StringLoader.h> |
|
24 |
#include <pevirtualengine.h> |
|
25 |
#include <mpeclientinformation.h> |
|
26 |
#include <mpeengineinfo.h> |
|
27 |
#include <cpephonemodelif.h> |
|
28 |
#include <featmgr.h> |
|
29 |
#include <rconnmon.h> |
|
30 |
#include <Profile.hrh> |
|
31 |
#include <PUAcodes.hrh> |
|
32 |
#include <AknUtils.h> |
|
33 |
#include <telephonyvariant.hrh> |
|
34 |
#include <aknsoundsystem.h> |
|
35 |
#include <wlaninternalpskeys.h> |
|
36 |
#include <btengdomainpskeys.h> |
|
37 |
#include <btengdomaincrkeys.h> |
|
38 |
#include <settingsinternalcrkeys.h> |
|
39 |
#include <starterclient.h> |
|
40 |
#include <rsssettings.h> |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
41 |
#include <UikonInternalPSKeys.h> |
37 | 42 |
#include <telephonydomainpstypes.h> |
43 |
#include <telinformationpskeys.h> |
|
44 |
#include <coreapplicationuisdomainpskeys.h> |
|
45 |
#include <mccecall.h> |
|
46 |
#include <ccpdefs.h> |
|
47 |
#include <LogsDomainCRKeys.h> |
|
48 |
#include <spsettings.h> |
|
49 |
#include <startupdomainpskeys.h> |
|
50 |
#include <MediatorDomainUIDs.h> |
|
51 |
#include <videotelcontrolmediatorapi.h> |
|
52 |
#include <textresolver.h> |
|
53 |
#include <phoneappvoipcommands.hrh> |
|
54 |
#include <hwrmdomainpskeys.h> |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
55 |
#include <hal.h> |
37 | 56 |
|
57 |
#include "phoneui.pan" |
|
58 |
#include "cphonestate.h" |
|
59 |
#include "mphonestatemachine.h" |
|
60 |
#include "mphoneviewcommandhandle.h" |
|
61 |
#include "tphonecmdparamboolean.h" |
|
62 |
#include "tphonecmdparaminteger.h" |
|
63 |
#include "tphonecmdparamkeyevent.h" |
|
64 |
#include "tphonecmdparamdynmenu.h" |
|
65 |
#include "tphonecmdparamcallheaderdata.h" |
|
66 |
#include "tphonecmdparamincallindicatordata.h" |
|
67 |
#include "tphonecmdparamnote.h" |
|
68 |
#include "tphonecmdparamkeycapture.h" |
|
69 |
#include "tphonecmdparamglobalnote.h" |
|
70 |
#include "tphonecmdparamquery.h" |
|
71 |
#include "tphonecmdparamstring.h" |
|
72 |
#include "tphonecmdparamcallstatedata.h" |
|
73 |
#include "tphonecmdparambitmap.h" |
|
74 |
#include "tphonecmdparamaudiooutput.h" |
|
75 |
#include "tphonecmdparamaudioavailability.h" |
|
76 |
#include "tphonecmdparamappinfo.h" |
|
77 |
#include "tphonecmdparamtranseffect.h" |
|
78 |
#include "tphonecmdparamringtone.h" |
|
79 |
#include "tphonecmdparamcustomdialer.h" |
|
80 |
#include "cphonekeys.h" |
|
81 |
#include "phoneui.hrh" |
|
82 |
#include "phonerssbase.h" |
|
83 |
#include "cphonebtaadisconnecthandler.h" |
|
84 |
#include "cphonemainresourceresolver.h" |
|
85 |
#include "cphonecenrepproxy.h" |
|
86 |
#include "cphonepubsubproxy.h" |
|
87 |
#include "phoneviewcommanddefinitions.h" |
|
88 |
#include "phonelogger.h" |
|
89 |
#include "phonestatedefinitions.h" |
|
90 |
#include "cphonetimer.h" |
|
91 |
#include "cphonereconnectquery.h" |
|
92 |
#include "mphoneerrormessageshandler.h" |
|
93 |
#include "cphoneclearblacklist.h" |
|
94 |
#include "mphonecustomization.h" |
|
95 |
#include "cphonemainerrormessageshandler.h" |
|
96 |
#include "cphoneaccessorybthandler.h" |
|
97 |
#include "cphonemediatorfactory.h" |
|
98 |
#include "mphonemediatormessage.h" |
|
99 |
#include "cphonemediatorsender.h" |
|
100 |
#include "cphonereleasecommand.h" |
|
101 |
#include "cphonecontinueemergencycallcommand.h" |
|
102 |
#include "cphonecallheadermanager.h" |
|
103 |
#include "cphonenumberentrymanager.h" |
|
104 |
#include "tphonecmdparamsfidata.h" |
|
105 |
#include "mphonestorage.h" |
|
106 |
#include "phoneconstants.h" |
|
107 |
#include "cphoneclearblacklist.h" |
|
108 |
||
109 |
// ================= MEMBER FUNCTIONS ======================= |
|
110 |
||
111 |
EXPORT_C CPhoneState::CPhoneState( |
|
112 |
MPhoneStateMachine* aStateMachine, |
|
113 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
114 |
MPhoneCustomization* aCustomization) : |
|
115 |
iStateMachine( aStateMachine ), |
|
116 |
iViewCommandHandle( aViewCommandHandle ), |
|
117 |
iCustomization( aCustomization ), |
|
118 |
iEnv( *CEikonEnv::Static() ) |
|
119 |
{ |
|
120 |
// Need to get current SimState for inherited classis |
|
121 |
iPreviousSimState = SimState(); |
|
122 |
__ASSERT_ALWAYS( |
|
123 |
aStateMachine && aViewCommandHandle, |
|
124 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
125 |
if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) ) |
|
126 |
{ |
|
127 |
iOnScreenDialer = ETrue; |
|
128 |
} |
|
129 |
} |
|
130 |
||
131 |
EXPORT_C void CPhoneState::BaseConstructL() |
|
132 |
{ |
|
133 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::BaseConstructL() "); |
|
134 |
if ( !iCbaManager ) |
|
135 |
{ |
|
136 |
iCbaManager = CPhoneCbaManager::NewL( |
|
137 |
this, |
|
138 |
*iViewCommandHandle, |
|
139 |
*iStateMachine ); |
|
140 |
} |
|
141 |
} |
|
142 |
||
143 |
EXPORT_C CPhoneState::~CPhoneState() |
|
144 |
{ |
|
145 |
if( iAlsLineChangeKeyPressTimer ) |
|
146 |
{ |
|
147 |
if( iAlsLineChangeKeyPressTimer->IsActive() ) |
|
148 |
{ |
|
149 |
iAlsLineChangeKeyPressTimer->CancelTimer(); |
|
150 |
} |
|
151 |
delete iAlsLineChangeKeyPressTimer; |
|
152 |
} |
|
153 |
delete iNumberEntryManager; |
|
154 |
delete iCallHeaderManager; |
|
155 |
delete iCbaManager; |
|
156 |
} |
|
157 |
||
158 |
// <-------------------------- PHONE ENGINE EVENTS ---------------------------> |
|
159 |
||
160 |
// ----------------------------------------------------------- |
|
161 |
// CPhoneState::HandlePhoneEngineMessageL |
|
162 |
// Default handling for Phone Engine messages |
|
163 |
// (other items were commented in a header). |
|
164 |
// ----------------------------------------------------------- |
|
165 |
// |
|
166 |
EXPORT_C void CPhoneState::HandlePhoneEngineMessageL( |
|
167 |
const TInt aMessage, |
|
168 |
TInt aCallId ) |
|
169 |
{ |
|
170 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL() "); |
|
171 |
||
172 |
CPhoneAccessoryBTHandler* accessoryBtHandler; |
|
173 |
||
174 |
switch ( aMessage ) |
|
175 |
{ |
|
176 |
case MEngineMonitor::EPEMessageNetworkRegistrationStatusChange: |
|
177 |
{ |
|
178 |
__PHONELOG1( EBasic, EPhoneControl, |
|
179 |
"PHONEUI_ERROR: EPEMessageNetworkRegistrationStatusChange - RegistrationStatus =%d ", |
|
180 |
iStateMachine->PhoneEngineInfo()->NetworkRegistrationStatus()); |
|
181 |
} |
|
182 |
break; |
|
183 |
||
184 |
case MEngineMonitor::EPEMessageAudioMuteChanged: |
|
185 |
HandleAudioMuteChangedL(); |
|
186 |
break; |
|
187 |
||
188 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
189 |
HandleAudioOutputChangedL(); |
|
190 |
// Go to current state implementation |
|
191 |
iCbaManager->UpdateInCallCbaL(); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
192 |
SetTouchPaneButtons(0); |
37 | 193 |
break; |
194 |
||
195 |
case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged: |
|
196 |
HandleAudioAvailableOutputChangedL(); |
|
197 |
if ( iStateMachine->PhoneEngineInfo()->AudioOutput() != EPENotActive ) |
|
198 |
{ |
|
199 |
// Go to current state implementation |
|
200 |
iCbaManager->UpdateInCallCbaL(); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
201 |
SetTouchPaneButtons(0); |
37 | 202 |
} |
203 |
break; |
|
204 |
||
205 |
case MEngineMonitor::EPEMessageChangedCallDuration: |
|
206 |
HandleChangedCallDurationL( aCallId ); |
|
207 |
break; |
|
208 |
||
209 |
case MEngineMonitor::EPEMessageRemoteBusy: |
|
210 |
HandleRemoteBusyL( aCallId ); |
|
211 |
break; |
|
212 |
||
213 |
case MEngineMonitor::EPEMessageCallWaiting: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
214 |
// No need to send waiting notification for user. |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
215 |
//SendGlobalInfoNoteL( EPhoneWaitingText, ETrue ); |
37 | 216 |
break; |
217 |
||
218 |
case MEngineMonitor::EPEMessageProfileChanged: |
|
219 |
{ |
|
220 |
} |
|
221 |
break; |
|
222 |
||
223 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
224 |
/* Flow through */ |
|
225 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
226 |
HandleDisconnectingL( aCallId ); |
|
227 |
break; |
|
228 |
||
229 |
case MEngineMonitor::EPEMessageTransferDone: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
230 |
SendGlobalInfoNoteL( EPhoneInCallTransferred, ETrue ); |
37 | 231 |
break; |
232 |
||
233 |
case MEngineMonitor::EPEMessageInitiatedEmergencyCall: |
|
234 |
HandleInitiatedEmergencyCallL( aCallId ); |
|
235 |
break; |
|
236 |
||
237 |
case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo: |
|
238 |
HandleInitiatedEmergencyWhileActiveVideoL(); |
|
239 |
break; |
|
240 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
241 |
case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
242 |
HandleCallSecureStatusChangeL( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
243 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
244 |
if ( iCustomization ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
245 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
246 |
iCustomization->HandlePhoneEngineMessageL( aMessage, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
247 |
aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
248 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
249 |
break; |
37 | 250 |
|
251 |
case MEngineMonitor::EPEMessageIssuingUSSDRequest: |
|
252 |
{ |
|
253 |
// Enable global notes |
|
254 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
255 |
globalNotifierParam.SetBoolean( EFalse ); |
|
256 |
iViewCommandHandle->ExecuteCommandL( |
|
257 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
258 |
&globalNotifierParam ); |
|
259 |
||
260 |
if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() ) |
|
261 |
{ |
|
262 |
// Remove number entry from screen |
|
263 |
iViewCommandHandle->ExecuteCommandL( |
|
264 |
EPhoneViewRemoveNumberEntry ); |
|
265 |
} |
|
266 |
else if ( IsOnScreenDialerSupported() ) |
|
267 |
{ |
|
268 |
NumberEntryClearL(); |
|
269 |
} |
|
270 |
} |
|
271 |
break; |
|
272 |
||
273 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
274 |
// Go to current state implementation |
|
275 |
iCbaManager->UpdateInCallCbaL(); |
|
276 |
break; |
|
277 |
||
278 |
// *#9990# |
|
279 |
case MEngineMonitor::EPEMessageShowBTLoopback: |
|
280 |
// Stop playing DTMF tone |
|
281 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
282 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
283 |
iViewCommandHandle, iStateMachine, this ); |
|
284 |
accessoryBtHandler->ShowBTLoopbackL(); |
|
285 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
286 |
break; |
|
287 |
||
288 |
// *#2820# |
|
289 |
case MEngineMonitor::EPEMessageShowBTDeviceAddress: |
|
290 |
// Stop playing DTMF tone |
|
291 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
292 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
293 |
iViewCommandHandle, iStateMachine, this ); |
|
294 |
accessoryBtHandler->ShowBTAddressL(); |
|
295 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
296 |
break; |
|
297 |
||
298 |
// *#7370# |
|
299 |
case MEngineMonitor::EPEMessageActivateRfsDeep: |
|
300 |
// Stop playing DTMF tone |
|
301 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
302 |
// Launch RFS |
|
303 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsDeep ); |
|
304 |
if ( !IsOnScreenDialerSupported() ) |
|
305 |
{ |
|
306 |
// Do state-specific operation when number entry is cleared |
|
307 |
HandleNumberEntryClearedL(); |
|
308 |
} |
|
309 |
break; |
|
310 |
||
311 |
// *#7780# |
|
312 |
case MEngineMonitor::EPEMessageActivateRfsNormal: |
|
313 |
// Stop playing DTMF tone |
|
314 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
315 |
// Launch RFS |
|
316 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsNormal ); |
|
317 |
if ( !IsOnScreenDialerSupported() ) |
|
318 |
{ |
|
319 |
// Do state-specific operation when number entry is cleared |
|
320 |
HandleNumberEntryClearedL(); |
|
321 |
} |
|
322 |
break; |
|
323 |
// *#62209526# |
|
324 |
case MEngineMonitor::EPEMessageShowWlanMacAddress: |
|
325 |
// Stop playing DTMF tone |
|
326 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
327 |
ShowWlanMacAddressL(); |
|
328 |
break; |
|
329 |
||
330 |
case MEngineMonitor::EPEMessageThumbnailLoadingCompleted: |
|
331 |
// Update call buble |
|
332 |
UpdateRemoteInfoDataL( aCallId ); |
|
333 |
break; |
|
334 |
||
335 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
336 |
UpdateRemoteInfoDataL ( aCallId ); |
|
337 |
break; |
|
338 |
||
339 |
case MEngineMonitor::EPEMessageSIMStateChanged: |
|
340 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL - simStateChanged =%d", SimState() ); |
|
341 |
HandleSimStateChangedL(); |
|
342 |
break; |
|
343 |
||
344 |
case MEngineMonitor::EPEMessageShowIncCallGroupIndex: |
|
345 |
HandleCugInUseNoteL(); |
|
346 |
break; |
|
347 |
||
348 |
default: |
|
349 |
||
350 |
TBool handled( EFalse ); |
|
351 |
||
352 |
if ( iCustomization ) |
|
353 |
{ |
|
354 |
handled = iCustomization->HandlePhoneEngineMessageL( |
|
355 |
aMessage, aCallId ); |
|
356 |
} |
|
357 |
||
358 |
if ( EFalse == handled ) |
|
359 |
{ |
|
360 |
MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId ); |
|
361 |
if( mediatorMessage ) |
|
362 |
{ |
|
363 |
CleanupDeletePushL( mediatorMessage ); |
|
364 |
mediatorMessage->ExecuteL(); |
|
365 |
CleanupStack::PopAndDestroy( mediatorMessage ); |
|
366 |
mediatorMessage = NULL; |
|
367 |
} |
|
368 |
} |
|
369 |
break; |
|
370 |
} |
|
371 |
} |
|
372 |
||
373 |
// ----------------------------------------------------------- |
|
374 |
// CPhoneState::HandleAudioMuteChangedL |
|
375 |
// Default handling for EPEMessageAudioMuteChanged message |
|
376 |
// (other items were commented in a header). |
|
377 |
// ----------------------------------------------------------- |
|
378 |
// |
|
379 |
EXPORT_C void CPhoneState::HandleAudioMuteChangedL() |
|
380 |
{ |
|
381 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioMuteChangedL() "); |
|
382 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
383 |
Panic( EPhoneCtrlInvariant ) ); |
|
384 |
||
385 |
TPhoneCmdParamBoolean booleanParam; |
|
386 |
const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute(); |
|
387 |
booleanParam.SetBoolean( audioMute ); |
|
388 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateMuteUIChanges, |
|
389 |
&booleanParam ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
390 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
391 |
SetTouchPaneButtons(0); |
37 | 392 |
} |
393 |
||
394 |
// ----------------------------------------------------------- |
|
395 |
// CPhoneState::HandleAudioOutputChangedL |
|
396 |
// Default handling for EPEMessageAudioOutputChanged message |
|
397 |
// (other items were commented in a header). |
|
398 |
// ----------------------------------------------------------- |
|
399 |
// |
|
400 |
EXPORT_C void CPhoneState::HandleAudioOutputChangedL() |
|
401 |
{ |
|
402 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioOutputChangedL() "); |
|
403 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
404 |
Panic( EPhoneCtrlInvariant ) ); |
|
405 |
||
406 |
TPhoneCmdParamAudioOutput outputParam; |
|
407 |
||
408 |
// Output |
|
409 |
const TPEAudioOutput audioOutput = |
|
410 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
|
411 |
outputParam.SetAudioOutput( audioOutput ); |
|
412 |
||
413 |
// view update |
|
414 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioPathUIChanges, |
|
415 |
&outputParam ); |
|
416 |
||
417 |
// Previous Output |
|
418 |
TPEPhoneAudioRouteParameters RouteParameters = iStateMachine-> |
|
419 |
PhoneEngineInfo()->RouteParameters(); |
|
420 |
const TPEAudioOutput previousOutput = |
|
421 |
RouteParameters.iPreviousOutput; |
|
422 |
||
423 |
// BT availability |
|
424 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
425 |
EPEBTAudioAccessory ); |
|
426 |
||
427 |
// Show note or BT disconnect handler |
|
428 |
if ( audioOutput != EPENotActive && |
|
429 |
previousOutput == EPEBTAudioAccessory && |
|
430 |
!btAvailable ) |
|
431 |
{ |
|
432 |
CPhoneBtaaDisconnectHandler::InstanceL()->HandleConnectionLostL(); |
|
433 |
} |
|
434 |
else if ( audioOutput == EPEBTAudioAccessory && |
|
435 |
previousOutput != EPEBTAudioAccessory && |
|
436 |
btAvailable ) |
|
437 |
{ |
|
438 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
439 |
iViewCommandHandle, iStateMachine, this ); |
|
440 |
bt->ShowBTActivatedL(); |
|
441 |
CleanupStack::PopAndDestroy( bt ); |
|
442 |
} |
|
443 |
else if ( audioOutput == EPENotActive && |
|
444 |
CPhoneBtaaDisconnectHandler::InstanceL()->IsQuery() ) |
|
445 |
{ |
|
446 |
CPhoneBtaaDisconnectHandler::InstanceL()->Cancel(); |
|
447 |
} |
|
448 |
else if ( RouteParameters.iShowNote && audioOutput == EPELoudspeaker ) |
|
449 |
{ |
|
450 |
CAknKeySoundSystem* keySounds = |
|
451 |
static_cast<CAknAppUi*>( iEnv.EikAppUi() )->KeySounds(); |
|
452 |
keySounds->PlaySound( EAvkonSIDIHFActive ); |
|
453 |
} |
|
454 |
} |
|
455 |
||
456 |
// ----------------------------------------------------------- |
|
457 |
// CPhoneState::HandleSimStateChangedL |
|
458 |
// Handles changes in the SIM card state. |
|
459 |
// ----------------------------------------------------------- |
|
460 |
// |
|
461 |
void CPhoneState::HandleSimStateChangedL() |
|
462 |
{ |
|
463 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleSimStateChangedL()" ); |
|
464 |
CPhoneMainResourceResolver& resolver = *CPhoneMainResourceResolver::Instance(); |
|
465 |
TPESimState simState = SimState(); |
|
466 |
||
467 |
__PHONELOG2( EBasic, EPhoneControl, "SIM state was changed from %d to %d", iPreviousSimState, simState ); |
|
468 |
||
469 |
switch ( simState ) |
|
470 |
{ |
|
471 |
case EPESimUsable: // Falls through. |
|
472 |
case EPESimReadable: // Falls through. |
|
473 |
case EPESimNotReady: |
|
474 |
{ |
|
475 |
if ( iPreviousSimState == EPESimNotPresent ) |
|
476 |
{ |
|
477 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was inserted, rebooting the phone" ); |
|
478 |
RStarterSession starterSession; |
|
479 |
User::LeaveIfError( starterSession.Connect() ); |
|
480 |
CleanupClosePushL( starterSession ); |
|
481 |
||
482 |
HBufC* queryText = StringLoader::LoadLC( resolver.ResolveResourceID( EPhoneRebootRequired ) ); |
|
483 |
||
484 |
TPhoneCmdParamQuery queryParams; |
|
485 |
queryParams.SetCommandParamId( TPhoneCommandParam::EPhoneParamRebootQuery ); |
|
486 |
queryParams.SetQueryPrompt( *queryText ); |
|
487 |
queryParams.SetDefaultCba( R_AVKON_SOFTKEYS_OK_EMPTY ); |
|
488 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParams ); |
|
489 |
||
490 |
starterSession.Reset( RStarterSession::ESIMStatusChangeReset ); |
|
491 |
CleanupStack::PopAndDestroy( 2, &starterSession ); // queryText |
|
492 |
} |
|
493 |
break; |
|
494 |
} |
|
495 |
case EPESimNotPresent: |
|
496 |
{ |
|
497 |
if ( iPreviousSimState == EPESimUsable || |
|
498 |
iPreviousSimState == EPESimReadable || |
|
499 |
iPreviousSimState == EPESimNotReady ) |
|
500 |
{ |
|
501 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was removed" ); |
|
502 |
||
503 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
504 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
37 | 505 |
|
506 |
globalNoteParam.SetTextResourceId( |
|
507 |
CPhoneMainResourceResolver::Instance()-> |
|
508 |
ResolveResourceID( EPhoneSimRemoved ) ); |
|
509 |
||
510 |
iViewCommandHandle->ExecuteCommandL( |
|
511 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
512 |
||
513 |
} |
|
514 |
// Show security note, if SIM not present and KFeatureIdFfSimlessOfflineSupport is disabled. |
|
515 |
else if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) && |
|
516 |
( iPreviousSimState != EPESimNotSupported ) ) |
|
517 |
{ |
|
518 |
StartShowSecurityNoteL(); |
|
519 |
} |
|
520 |
break; |
|
521 |
} |
|
522 |
default: |
|
523 |
break; |
|
524 |
} |
|
525 |
||
526 |
iPreviousSimState = simState; |
|
527 |
} |
|
528 |
||
529 |
// ----------------------------------------------------------------------------- |
|
530 |
// CPhoneState::IsValidAlphaNumericKey |
|
531 |
// Checks is the key event a number, a special character |
|
532 |
// or if VoIP is enabled some other character |
|
533 |
// ----------------------------------------------------------------------------- |
|
534 |
// |
|
535 |
TBool CPhoneState::IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent, |
|
536 |
TEventCode aEventCode ) |
|
537 |
{ |
|
538 |
TBool ret(EFalse); |
|
539 |
||
540 |
const TBool numericKeyEntered( CPhoneKeys::IsNumericKey( |
|
541 |
aKeyEvent, aEventCode ) ); |
|
542 |
||
543 |
// a numeric key (1,2,3,4,6,7,8,9,0,+,*,p,w ) |
|
544 |
// or |
|
545 |
// a letter from fullscreen qwerty, miniqwerty or handwriting |
|
546 |
// when voip is enabled |
|
547 |
if ( numericKeyEntered |
|
548 |
|| IsAlphanumericSupportedAndCharInput( aKeyEvent ) ) |
|
549 |
{ |
|
550 |
ret= ETrue; |
|
551 |
} |
|
552 |
||
553 |
return ret; |
|
554 |
} |
|
555 |
||
556 |
// ----------------------------------------------------------------------------- |
|
557 |
// CPhoneState::CustomizeCBAForPhoneNumber |
|
558 |
// |
|
559 |
// ----------------------------------------------------------------------------- |
|
560 |
// |
|
561 |
void CPhoneState::CustomizeCbaForPhoneNumberL() |
|
562 |
{ |
|
563 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) && |
|
564 |
iCustomization && |
|
565 |
iCustomization->AllowAlphaNumericMode() ) |
|
566 |
{ |
|
567 |
// Get the number entry contents |
|
568 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
569 |
||
570 |
TPhoneCmdParamInteger integerParam; |
|
571 |
||
572 |
//only charaters from set { 0, .., 9, *, #, +, p, w, P, W } used |
|
573 |
if ( CPhoneKeys::Validate( phoneNumber->Des()) ) |
|
574 |
{ |
|
575 |
integerParam.SetInteger( CPhoneMainResourceResolver::Instance()-> |
|
576 |
ResolveResourceID( EPhoneNumberAcqCBA ) ); |
|
577 |
} |
|
578 |
//other characters |
|
579 |
else |
|
580 |
{ |
|
581 |
integerParam.SetInteger( iCustomization->CustomizeSoftKeys() ); |
|
582 |
} |
|
583 |
||
584 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateCba, &integerParam ); |
|
585 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
586 |
} |
|
587 |
||
588 |
} |
|
589 |
||
590 |
// ----------------------------------------------------------------------------- |
|
591 |
// CPhoneState::IsTouchDTmfDialerOn |
|
592 |
// ----------------------------------------------------------------------------- |
|
593 |
// |
|
594 |
TBool CPhoneState::IsTouchDTmfDialerOn() const |
|
595 |
{ |
|
596 |
TBool status( EFalse ); |
|
597 |
return status; |
|
598 |
} |
|
599 |
// ----------------------------------------------------------------------------- |
|
600 |
// CPhoneState::SendDtmfKeyEventL |
|
601 |
// send dtmf event when, |
|
602 |
// -touch dtmf dialer is NOT visible |
|
603 |
// -query is not active |
|
604 |
// -menubar is not open |
|
605 |
// ----------------------------------------------------------------------------- |
|
606 |
// |
|
607 |
void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent, |
|
608 |
TEventCode aEventCode ) |
|
609 |
{ |
|
610 |
||
611 |
if ( !IsTouchDTmfDialerOn() |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
612 |
&& !IsAnyQueryActiveL() ) |
37 | 613 |
{ |
614 |
// Send the key event to the phone engine. |
|
615 |
SendKeyEventL( aKeyEvent, aEventCode ); |
|
616 |
} |
|
617 |
} |
|
618 |
||
619 |
// ----------------------------------------------------------------------------- |
|
620 |
// CPhoneState::IsKeyEventFurtherProcessed |
|
621 |
// ----------------------------------------------------------------------------- |
|
622 |
// |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
623 |
TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& /*aKeyEvent*/ ) const |
37 | 624 |
{ |
625 |
return ETrue; |
|
626 |
} |
|
627 |
||
628 |
// ----------------------------------------------------------- |
|
629 |
// CPhoneState::HandleErrorL |
|
630 |
// Default handling for HandleError message |
|
631 |
// (other items were commented in a header). |
|
632 |
// ----------------------------------------------------------- |
|
633 |
// |
|
634 |
EXPORT_C void CPhoneState::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
635 |
{ |
|
636 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleErrorL()"); |
|
637 |
||
638 |
__PHONELOG1( EBasic, EPhoneControl, |
|
639 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
640 |
aErrorInfo.iErrorCode ); |
|
641 |
||
642 |
__PHONELOG1( EBasic, EPhoneControl, |
|
643 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ", |
|
644 |
aErrorInfo.iCallId ); |
|
645 |
||
646 |
||
647 |
// Do the common error handling (display proper notes etc) |
|
648 |
CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( aErrorInfo ); |
|
649 |
||
650 |
switch( aErrorInfo.iErrorCode ) |
|
651 |
{ |
|
652 |
case ECCPErrorCCUserAlertingNoAnswer: |
|
653 |
case ECCPErrorCCResourceNotAvailable: |
|
654 |
{ |
|
655 |
if( aErrorInfo.iCallId > KErrNotFound ) |
|
656 |
{ |
|
657 |
if ( iStateMachine->PhoneEngineInfo()->CallDirection( |
|
658 |
aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated ) |
|
659 |
{ |
|
660 |
if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
661 |
{ |
|
662 |
// Active MO video call lost 3G network. |
|
663 |
__PHONELOG1( EBasic, EPhoneControl, |
|
664 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 1, callid%d ", |
|
665 |
aErrorInfo.iCallId ); |
|
666 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
667 |
} |
|
668 |
else |
|
669 |
{ |
|
670 |
__PHONELOG1( EBasic, EPhoneControl, |
|
671 |
"PhoneUIControl: CPhoneState::HandleErrorL - No video call =%d ", |
|
672 |
aErrorInfo.iCallId ); |
|
673 |
} |
|
674 |
} |
|
675 |
} |
|
676 |
} |
|
677 |
break; |
|
678 |
||
679 |
case ECCPErrorCCServiceNotAvailable: |
|
680 |
{ |
|
681 |
if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
682 |
{ |
|
683 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( EFalse ); |
|
684 |
} |
|
685 |
} |
|
686 |
break; |
|
687 |
||
688 |
case ECCPErrorBadRequest: |
|
689 |
{ |
|
690 |
TPECallType callType = |
|
691 |
iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
|
692 |
||
693 |
if( callType == EPECallTypeVideo ) |
|
694 |
{ |
|
695 |
// Dialling MO video call cannot reach 3G network. |
|
696 |
__PHONELOG1( EBasic, EPhoneControl, |
|
697 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 2, callid%d ", |
|
698 |
aErrorInfo.iCallId ); |
|
699 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
700 |
} |
|
701 |
} |
|
702 |
break; |
|
703 |
||
704 |
case ECCPErrorVideoCallNotSupportedByNetwork: |
|
705 |
case ECCPErrorVideoCallSetupFailed: |
|
706 |
case ECCPErrorNotReached: |
|
707 |
// If call id found and seems to be Video Call |
|
708 |
if ( IsVideoCall( aErrorInfo.iCallId ) ) |
|
709 |
{ |
|
710 |
// Get active call count |
|
711 |
TPhoneCmdParamInteger activeCallCount; |
|
712 |
iViewCommandHandle->ExecuteCommandL( |
|
713 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
714 |
||
715 |
if ( activeCallCount.Integer() == 0 |
|
716 |
|| iStateMachine->PhoneEngineInfo()->CallDirection( |
|
717 |
aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated ) |
|
718 |
{ |
|
719 |
// Dialling MO video call attempted in 2G network or |
|
720 |
// dialing MO video to unvalid number |
|
721 |
// Reconnect query include video label if errorcode is unvalid number. |
|
722 |
__PHONELOG1( EBasic, EPhoneControl, |
|
723 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 3, callid%d ", |
|
724 |
aErrorInfo.iCallId ); |
|
725 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( |
|
726 |
ECCPErrorNotReached == aErrorInfo.iErrorCode ); |
|
727 |
} |
|
728 |
} |
|
729 |
break; |
|
730 |
||
731 |
case ECCPErrorNoService: |
|
732 |
// No network -> hide volume popup |
|
733 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
734 |
break; |
|
735 |
||
736 |
case ECCPErrorSatControl: |
|
737 |
{ |
|
738 |
// check, that there really was a call established before completing SAT request |
|
739 |
if( aErrorInfo.iCallId != KPECallIdNotUsed ) |
|
740 |
{ |
|
741 |
} |
|
742 |
||
743 |
// remove number entry |
|
744 |
if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() ) |
|
745 |
{ |
|
746 |
iViewCommandHandle->ExecuteCommandL( |
|
747 |
EPhoneViewRemoveNumberEntry ); |
|
748 |
} |
|
749 |
else if ( IsOnScreenDialerSupported() ) |
|
750 |
{ |
|
751 |
NumberEntryClearL(); |
|
752 |
} |
|
753 |
} |
|
754 |
break; |
|
755 |
||
756 |
default: |
|
757 |
break; |
|
758 |
} |
|
759 |
||
760 |
// clear call blacklist if call failure occurs |
|
761 |
CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); |
|
762 |
} |
|
763 |
||
764 |
// ----------------------------------------------------------- |
|
765 |
// CPhoneState::HandleChangedCallDurationL |
|
766 |
// Default handling for EPEMessageChangedCallDuration message |
|
767 |
// (other items were commented in a header). |
|
768 |
// ----------------------------------------------------------- |
|
769 |
void CPhoneState::HandleChangedCallDurationL( TInt aCallId ) |
|
770 |
{ |
|
771 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() "); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
772 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
773 |
TInt ret = KErrNone; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
774 |
TInt isDisplayOn; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
775 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
776 |
ret = HAL::Get( HALData::EDisplayState, isDisplayOn ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
777 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
778 |
// Update only if the display is on or if HAL::Get returns an error, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
779 |
// in which case display value cannot be trusted. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
780 |
if ( ret || isDisplayOn ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
781 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
782 |
// Get the call duration |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
783 |
TTimeIntervalSeconds seconds = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
784 |
iStateMachine->PhoneEngineInfo()->CallDuration( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
785 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
786 |
TPhoneCmdParamInteger time; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
787 |
time.SetInteger(seconds.Int()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
788 |
iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
789 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
790 |
} |
37 | 791 |
|
792 |
// ----------------------------------------------------------------------------- |
|
793 |
// CPhoneState::HandleRemoteBusyL |
|
794 |
// ----------------------------------------------------------------------------- |
|
795 |
// |
|
796 |
void CPhoneState::HandleRemoteBusyL( TInt aCallId ) |
|
797 |
{ |
|
798 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleRemoteBusyL( ) "); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
799 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
800 |
TPEErrorInfo info; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
801 |
info.iCallId = aCallId; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
802 |
info.iErrorCode = ECCPErrorBusy; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
803 |
info.iErrorType = EPECcp; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
804 |
CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( info ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
805 |
|
37 | 806 |
const TPECallType callType = |
807 |
iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
|
808 |
||
809 |
if( callType == EPECallTypeVideo ) |
|
810 |
{ |
|
811 |
// Launch reconnect query including video call menu item |
|
812 |
__PHONELOG1( EBasic, EPhoneControl, |
|
813 |
"PhoneUIControl: CPhoneState::HandleRemoteBusyL - ShowReconnectQueryL vid 5, callid%d ", |
|
814 |
aCallId ); |
|
815 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
816 |
} |
|
817 |
} |
|
818 |
||
819 |
// ----------------------------------------------------------- |
|
820 |
// CPhoneState::HandleDisconnectingL |
|
821 |
// ----------------------------------------------------------- |
|
822 |
// |
|
823 |
EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId ) |
|
824 |
{ |
|
825 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) "); |
|
826 |
||
827 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
828 |
callHeaderParam.SetCallState( EPEStateDisconnecting ); |
|
829 |
||
830 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
831 |
LoadResource( labelText, EPhoneInCallDisconnected ); |
|
832 |
||
833 |
callHeaderParam.SetLabelText( labelText ); |
|
834 |
||
835 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
836 |
||
837 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
838 |
&callHeaderParam ); |
|
839 |
||
840 |
CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); |
|
841 |
} |
|
842 |
||
843 |
// ----------------------------------------------------------- |
|
844 |
// CPhoneState::IsCustomizedDialerVisibleL() |
|
845 |
// ----------------------------------------------------------- |
|
846 |
// |
|
847 |
EXPORT_C TBool CPhoneState::IsCustomizedDialerVisibleL() const |
|
848 |
{ |
|
849 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsCustomizedDialerVisibleL( ) "); |
|
850 |
return iViewCommandHandle->HandleCommandL( |
|
851 |
EPhoneIsCustomizedDialerVisible ) == EPhoneViewResponseSuccess; |
|
852 |
} |
|
853 |
||
854 |
// <------------------------------- KEY EVENTS -------------------------------> |
|
855 |
||
856 |
// ----------------------------------------------------------- |
|
857 |
// CPhoneState::HandleKeyMessageL( aMessage, aKeyCode ) |
|
858 |
// ----------------------------------------------------------- |
|
859 |
// |
|
860 |
EXPORT_C void CPhoneState::HandleKeyMessageL( |
|
861 |
TPhoneKeyEventMessages /*aMessage*/, |
|
862 |
TKeyCode /*aKeyCode*/ ) |
|
863 |
{ |
|
864 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyMessageL( ) "); |
|
865 |
} |
|
866 |
||
867 |
// ----------------------------------------------------------- |
|
868 |
// CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ) |
|
869 |
// ----------------------------------------------------------- |
|
870 |
// |
|
871 |
EXPORT_C void CPhoneState::HandleKeyEventL( |
|
872 |
const TKeyEvent& aKeyEvent, |
|
873 |
TEventCode aEventCode ) |
|
874 |
{ |
|
875 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyEventL( ) "); |
|
876 |
if ( ( IsNumberEntryVisibleL() ) || OnlySideVolumeKeySupported() ) |
|
877 |
{ |
|
878 |
// Handle numeric keys when key events are received in single state |
|
879 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
880 |
} |
|
881 |
else if ( aKeyEvent.iScanCode == EStdKeyUpArrow && |
|
882 |
aEventCode == EEventKey ) |
|
883 |
{ |
|
884 |
// Increace audio volume |
|
885 |
IncreaseAudioVolumeL(); |
|
886 |
} |
|
887 |
else if ( aKeyEvent.iScanCode == EStdKeyDownArrow && |
|
888 |
aEventCode == EEventKey ) |
|
889 |
{ |
|
890 |
// Decreace audio volume |
|
891 |
DecreaseAudioVolumeL(); |
|
892 |
} |
|
893 |
else |
|
894 |
{ |
|
895 |
// Handle numeric keys when key events are received in single state |
|
896 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
897 |
} |
|
898 |
} |
|
899 |
||
900 |
// ----------------------------------------------------------- |
|
901 |
// CPhoneState::OnlySideVolumeKeySupported |
|
902 |
// ----------------------------------------------------------- |
|
903 |
// |
|
904 |
TBool CPhoneState::OnlySideVolumeKeySupported() |
|
905 |
{ |
|
906 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::OnlySideVolumeKeySupported( ) "); |
|
907 |
TBool onlySideVolumeKeySupported(EFalse); |
|
908 |
if ( !CPhoneCenRepProxy::Instance()-> |
|
909 |
IsTelephonyFeatureSupported( KTelephonyLVFlagScrollVolumeKeys ) && |
|
910 |
FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys ) ) |
|
911 |
{ |
|
912 |
onlySideVolumeKeySupported = ETrue; |
|
913 |
} |
|
914 |
__PHONELOG1( EBasic, EPhoneControl, |
|
915 |
"OnlySideVolumeKeySupported: %d", |
|
916 |
onlySideVolumeKeySupported ); |
|
917 |
return onlySideVolumeKeySupported; |
|
918 |
} |
|
919 |
||
920 |
// ----------------------------------------------------------- |
|
921 |
// CPhoneState::HandleKeyPressDurationL( aScanCode, aKeyPressDuration ) |
|
922 |
// ----------------------------------------------------------- |
|
923 |
// |
|
924 |
EXPORT_C void CPhoneState::HandleKeyPressDurationL( |
|
925 |
TKeyCode aCode, |
|
926 |
TTimeIntervalMicroSeconds /*aKeyPressDuration*/ ) |
|
927 |
{ |
|
928 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyPressDurationL( ) "); |
|
929 |
||
930 |
if( aCode == KPhoneDtmfHashCharacter ) |
|
931 |
{ |
|
932 |
if( iAlsLineChangeKeyPressTimer ) |
|
933 |
{ |
|
934 |
if( iAlsLineChangeKeyPressTimer->IsActive() ) |
|
935 |
{ |
|
936 |
iAlsLineChangeKeyPressTimer->Cancel(); |
|
937 |
} |
|
938 |
} |
|
939 |
} |
|
940 |
} |
|
941 |
||
942 |
// ----------------------------------------------------------- |
|
943 |
// CPhoneState::HandleNumericKeyEventL |
|
944 |
// ----------------------------------------------------------- |
|
945 |
// |
|
946 |
EXPORT_C void CPhoneState::HandleNumericKeyEventL( |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
947 |
const TKeyEvent& /*aKeyEvent*/, |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
948 |
TEventCode /*aEventCode*/ ) |
37 | 949 |
{ |
950 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) "); |
|
951 |
||
952 |
} |
|
953 |
||
954 |
// ----------------------------------------------------------------------------- |
|
955 |
// CPhoneState::IsAnyQueryActiveL |
|
956 |
// ----------------------------------------------------------------------------- |
|
957 |
// |
|
958 |
EXPORT_C TBool CPhoneState::IsAnyQueryActiveL() |
|
959 |
{ |
|
960 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAnyQueryActiveL( ) "); |
|
961 |
TBool isActive( EFalse ); |
|
962 |
||
963 |
// If IsNoteDismissableL returns true then shown note is dismissable by key event |
|
964 |
// and then there is no actual query and IsAnyQueryActiveL returns false. |
|
965 |
if ( !IsNoteDismissableL() ) |
|
966 |
{ |
|
967 |
// Check is query displayed |
|
968 |
TPhoneCmdParamBoolean isQueryDisplayed; |
|
969 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewIsQuery, &isQueryDisplayed ); |
|
970 |
// Check is Blocking Dialog active ( e.g. RFS query ) |
|
971 |
TPhoneCmdParamBoolean blockingDialogStatus; |
|
972 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, |
|
973 |
&blockingDialogStatus ); |
|
974 |
// Check is note displayed |
|
975 |
TPhoneCmdParamBoolean isNoteActive; |
|
976 |
iViewCommandHandle->ExecuteCommandL( |
|
977 |
EPhoneViewIsNoteActive, &isNoteActive ); |
|
978 |
||
979 |
if ( isQueryDisplayed.Boolean() || blockingDialogStatus.Boolean() || isNoteActive.Boolean() ) |
|
980 |
{ |
|
981 |
isActive = ETrue; |
|
982 |
} |
|
983 |
} |
|
984 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyQueryActiveL: %d ", isActive ); |
|
985 |
return isActive; |
|
986 |
} |
|
987 |
||
988 |
// ----------------------------------------------------------------------------- |
|
989 |
// CPhoneState::IsNoteDismissable |
|
990 |
// ----------------------------------------------------------------------------- |
|
991 |
// |
|
992 |
TBool CPhoneState::IsNoteDismissableL() |
|
993 |
{ |
|
994 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteDismissableL( ) "); |
|
995 |
TBool dismiss = EFalse; |
|
996 |
if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) || |
|
997 |
(FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) && |
|
998 |
SimSecurityStatus() == ESimRejected ) ) |
|
999 |
{ |
|
1000 |
// Check if note is dismissed by key event. |
|
1001 |
TPhoneCmdParamBoolean isNoteDismissed; |
|
1002 |
iViewCommandHandle->ExecuteCommandL( |
|
1003 |
EPhoneViewIsActiveNoteDissmissableByKeyEvent, &isNoteDismissed ); |
|
1004 |
if ( isNoteDismissed.Boolean() ) |
|
1005 |
{ |
|
1006 |
dismiss = ETrue; |
|
1007 |
} |
|
1008 |
} |
|
1009 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsNoteDismissableL: %d ", dismiss ); |
|
1010 |
return dismiss; |
|
1011 |
} |
|
1012 |
||
1013 |
// ----------------------------------------------------------- |
|
1014 |
// CPhoneState::SendKeyEventL |
|
1015 |
// ----------------------------------------------------------- |
|
1016 |
// |
|
1017 |
void CPhoneState::SendKeyEventL( |
|
1018 |
const TKeyEvent& aKeyEvent, |
|
1019 |
TEventCode aEventCode ) |
|
1020 |
{ |
|
1021 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyEventL( ) "); |
|
1022 |
switch( aEventCode ) |
|
1023 |
{ |
|
1024 |
// EEventKey |
|
1025 |
case EEventKey: |
|
1026 |
// Send the key press to the phone engine, if applicable |
|
1027 |
SendKeyPressL( aKeyEvent, aEventCode ); |
|
1028 |
break; |
|
1029 |
||
1030 |
// EEventKeyUp |
|
1031 |
case EEventKeyUp: |
|
1032 |
// Send a key up event for the last key code sent to |
|
1033 |
// the phone engine |
|
1034 |
iStateMachine->SendPhoneEngineMessage( |
|
1035 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
1036 |
break; |
|
1037 |
||
1038 |
default: |
|
1039 |
break; |
|
1040 |
} |
|
1041 |
} |
|
1042 |
||
1043 |
// ----------------------------------------------------------- |
|
1044 |
// CPhoneState::SendKeyPressL |
|
1045 |
// ----------------------------------------------------------- |
|
1046 |
// |
|
1047 |
void CPhoneState::SendKeyPressL( |
|
1048 |
const TKeyEvent& aKeyEvent, |
|
1049 |
TEventCode aEventCode ) |
|
1050 |
{ |
|
1051 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyPressL( ) "); |
|
1052 |
const TBool dtmfToneKeyEntered = |
|
1053 |
CPhoneKeys::IsDtmfTone( aKeyEvent, aEventCode ); |
|
1054 |
||
1055 |
if ( dtmfToneKeyEntered || |
|
1056 |
aKeyEvent.iCode == EKeyBackspace ) |
|
1057 |
{ |
|
1058 |
// Get the number entry contents, if it exists |
|
1059 |
if ( IsNumberEntryUsedL() ) |
|
1060 |
{ |
|
1061 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
1062 |
// Save the phone number |
|
1063 |
__PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber ); |
|
1064 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
1065 |
||
1066 |
// Convert key code to western. |
|
1067 |
TBuf<1> buffer; // one character |
|
1068 |
buffer.Append( aKeyEvent.iCode ); |
|
1069 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1070 |
"CPhoneState::SendKeyPressL(%S)", |
|
1071 |
&buffer ); |
|
1072 |
AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
1073 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1074 |
"CPhoneState::SendKeyPressL(%S)", |
|
1075 |
&buffer ); |
|
1076 |
TLex code( buffer ); |
|
1077 |
||
1078 |
// Save the key code |
|
1079 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
1080 |
||
1081 |
// Plays a DTMF tone if active call |
|
1082 |
iStateMachine->SendPhoneEngineMessage( |
|
1083 |
MPEPhoneModel::EPEMessagePlayDTMF ); |
|
1084 |
// remove the phone number from the cleanup stack |
|
1085 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
1086 |
} |
|
1087 |
} |
|
1088 |
} |
|
1089 |
||
1090 |
// <------------------------------ SYSTEM EVENTS -----------------------------> |
|
1091 |
||
1092 |
||
1093 |
// ----------------------------------------------------------- |
|
1094 |
// CPhoneState::HandleSystemEventL |
|
1095 |
// ----------------------------------------------------------- |
|
1096 |
// |
|
1097 |
EXPORT_C void CPhoneState::HandleSystemEventL( const TWsEvent& /*aEvent*/ ) |
|
1098 |
{ |
|
1099 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleSystemEventL( ) "); |
|
1100 |
} |
|
1101 |
||
1102 |
// ----------------------------------------------------------- |
|
1103 |
// CPhoneState::HandleForegroundEventL |
|
1104 |
// ----------------------------------------------------------- |
|
1105 |
// |
|
1106 |
EXPORT_C void CPhoneState::HandleForegroundEventL( TBool aForeground ) |
|
1107 |
{ |
|
1108 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleForegroundEventL( ) "); |
|
1109 |
if ( !aForeground && IsNumberEntryUsedL() ) |
|
1110 |
{ |
|
1111 |
// Going out from foreground and number entry is open. |
|
1112 |
// Make sure that dtmf playing is stopped ( EEventKeyUp may be missed ). |
|
1113 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1114 |
} |
|
1115 |
} |
|
1116 |
||
1117 |
// ----------------------------------------------------------- |
|
1118 |
// CPhoneState::HandlePhoneForegroundEventL |
|
1119 |
// ----------------------------------------------------------- |
|
1120 |
// |
|
1121 |
EXPORT_C void CPhoneState::HandlePhoneForegroundEventL() |
|
1122 |
{ |
|
1123 |
} |
|
1124 |
||
1125 |
// ----------------------------------------------------------- |
|
1126 |
// CPhoneState::HandlePhoneFocusLostEventL |
|
1127 |
// ----------------------------------------------------------- |
|
1128 |
// |
|
1129 |
EXPORT_C void CPhoneState::HandlePhoneFocusLostEventL() |
|
1130 |
{ |
|
1131 |
// Notify that this method is called always when Idle is brought to foreground |
|
1132 |
// See implementation in CPhoneAppUI::HandleWsEventL |
|
1133 |
||
1134 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneFocusLostEventL( ) "); |
|
1135 |
} |
|
1136 |
// --------------------------------------------------------- |
|
1137 |
// CPhoneState::HandleIdleForegroundEventL |
|
1138 |
// --------------------------------------------------------- |
|
1139 |
// |
|
1140 |
EXPORT_C void CPhoneState::HandleIdleForegroundEventL() |
|
1141 |
{ |
|
1142 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleIdleForegroundEventL( ) "); |
|
1143 |
// Empty implementation |
|
1144 |
} |
|
1145 |
||
1146 |
// ----------------------------------------------------------- |
|
1147 |
// CPhoneState::HandleEnvironmentChangeL |
|
1148 |
// ----------------------------------------------------------- |
|
1149 |
// |
|
1150 |
EXPORT_C void CPhoneState::HandleEnvironmentChangeL( const TInt aChanges ) |
|
1151 |
{ |
|
1152 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleEnvironmentChangeL( ) "); |
|
1153 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandleEnvironmentChangeL - Changes: %d ", aChanges ); |
|
1154 |
// Update the profile display if required |
|
1155 |
if ( aChanges & |
|
1156 |
( EChangesLocale | EChangesMidnightCrossover | EChangesSystemTime ) ) |
|
1157 |
{ |
|
1158 |
UpdateProfileDisplayL(); |
|
1159 |
} |
|
1160 |
} |
|
1161 |
||
1162 |
// ----------------------------------------------------------- |
|
1163 |
// CPhoneState::HandlePhoneStartupL |
|
1164 |
// ----------------------------------------------------------- |
|
1165 |
// |
|
1166 |
EXPORT_C void CPhoneState::HandlePhoneStartupL() |
|
1167 |
{ |
|
1168 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneStartupL( ) "); |
|
1169 |
// Empty implementation |
|
1170 |
} |
|
1171 |
||
1172 |
// ----------------------------------------------------------- |
|
1173 |
// CPhoneState::HandlePropertyChangedL |
|
1174 |
// ----------------------------------------------------------- |
|
1175 |
// |
|
1176 |
EXPORT_C void CPhoneState::HandlePropertyChangedL( |
|
1177 |
const TUid& aCategory, |
|
1178 |
const TUint aKey, |
|
1179 |
const TInt aValue ) |
|
1180 |
{ |
|
1181 |
||
1182 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePropertyChangedL( ) "); |
|
1183 |
||
1184 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1185 |
"CPhoneState::HandlePropertyChangedL - aCategory= %d", aCategory ); |
|
1186 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1187 |
"CPhoneState::HandlePropertyChangedL - aKey= %d", aKey ); |
|
1188 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1189 |
"CPhoneState::HandlePropertyChangedL - aValue= %d", aValue ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1190 |
if ( aCategory == KPSUidTelInformation |
37 | 1191 |
&& SimState() == EPESimUsable ) |
1192 |
{ |
|
1193 |
// Telephony display event |
|
1194 |
if ( aKey == KTelDisplayInfo ) |
|
1195 |
{ |
|
1196 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::HandlePropertyChangedL - telephony display info received" ); |
|
1197 |
// Update the operator and profile display |
|
1198 |
UpdateProfileDisplayL(); |
|
1199 |
} |
|
1200 |
} |
|
1201 |
else if ( aCategory == KPSUidStartup && aKey == KStartupSimSecurityStatus ) |
|
1202 |
{ |
|
1203 |
// Show security note, SIM is not valid. |
|
1204 |
if ( aValue == ESimRejected || aValue == ESimUnaccepted ) |
|
1205 |
{ |
|
1206 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneStateStartup::HandlePropertyChangedL - SimSecurity status received" ); |
|
1207 |
StartShowSecurityNoteL(); |
|
1208 |
} |
|
1209 |
} |
|
1210 |
else if ( aCategory == KPSUidHWRM && aKey == KHWRMGripStatus ) |
|
1211 |
{ |
|
1212 |
UpdateCbaSwivelStateChangedL(); |
|
1213 |
} |
|
1214 |
} |
|
1215 |
||
1216 |
// ----------------------------------------------------------- |
|
1217 |
// CPhoneState::HandleCenRepChangeL |
|
1218 |
// ----------------------------------------------------------- |
|
1219 |
// |
|
1220 |
EXPORT_C void CPhoneState::HandleCenRepChangeL( |
|
1221 |
const TUid& /*aUid*/, |
|
1222 |
const TUint /*aId*/ ) |
|
1223 |
{ |
|
1224 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCenRepChangeL( ) "); |
|
1225 |
} |
|
1226 |
||
1227 |
// ----------------------------------------------------------- |
|
1228 |
// CPhoneState::NeedToSendToBackgroundL |
|
1229 |
// ----------------------------------------------------------- |
|
1230 |
// |
|
1231 |
EXPORT_C TBool CPhoneState::NeedToSendToBackgroundL() const |
|
1232 |
{ |
|
1233 |
return iViewCommandHandle->HandleCommandL( |
|
1234 |
EPhoneViewGetNeedToSendToBackgroundStatus ) == |
|
1235 |
EPhoneViewResponseSuccess; |
|
1236 |
} |
|
1237 |
||
1238 |
// ----------------------------------------------------------- |
|
1239 |
// CPhoneState::TopAppIsDisplayedL |
|
1240 |
// ----------------------------------------------------------- |
|
1241 |
// |
|
1242 |
EXPORT_C TBool CPhoneState::TopAppIsDisplayedL() const |
|
1243 |
{ |
|
1244 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TopAppIsDisplayedL( ) "); |
|
1245 |
return iViewCommandHandle->HandleCommandL( |
|
1246 |
EPhoneViewGetTopApplicationIsDisplayedStatus ) == |
|
1247 |
EPhoneViewResponseSuccess; |
|
1248 |
} |
|
1249 |
||
1250 |
// <---------------------------- MENU AND CBA EVENTS -------------------------> |
|
1251 |
||
1252 |
EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand ) |
|
1253 |
{ |
|
1254 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) "); |
|
1255 |
TBool commandStatus = ETrue; |
|
1256 |
switch( aCommand ) |
|
1257 |
{ |
|
1258 |
case EPhoneEmergencyCmdExit: |
|
1259 |
{ |
|
1260 |
} |
|
1261 |
// this should be bypasses? |
|
1262 |
case EPhoneDialerCallHandling: |
|
1263 |
case EPhoneCmdBack: |
|
1264 |
// Remove number entry from screen |
|
1265 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1266 |
// Do state-specific behaviour if number entry is cleared |
|
1267 |
HandleNumberEntryClearedL(); |
|
1268 |
break; |
|
1269 |
||
1270 |
case EPhoneDialerCmdTouchInput: |
|
1271 |
break; |
|
1272 |
||
1273 |
case EPhoneNumberAcqCmdSendMessage: |
|
1274 |
break; |
|
1275 |
||
1276 |
case EPhoneNumberAcqCmdSave: |
|
1277 |
break; |
|
1278 |
||
1279 |
case EPhoneNumberAcqCmdAddToName: |
|
1280 |
break; |
|
1281 |
||
1282 |
case EPhoneNumberAcqCmdAddToContacts: |
|
1283 |
{ |
|
1284 |
if ( IsOnScreenDialerSupported() ) |
|
1285 |
{ |
|
1286 |
TPhoneCmdParamQuery queryDialogParam; |
|
1287 |
queryDialogParam.SetQueryType( EPhoneContactsListQuery ); |
|
1288 |
queryDialogParam.SetQueryResourceId( |
|
1289 |
CPhoneMainResourceResolver::Instance()-> |
|
1290 |
ResolveResourceID( EPhoneAddtoContactsListQuery ) ); |
|
1291 |
||
1292 |
// Display dialog |
|
1293 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
1294 |
&queryDialogParam ); |
|
1295 |
} |
|
1296 |
} |
|
1297 |
break; |
|
1298 |
||
1299 |
case EPhoneCmdWaitNoteOk: |
|
1300 |
// Remove number entry from screen |
|
1301 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
1302 |
if ( !IsOnScreenDialerSupported() ) |
|
1303 |
{ |
|
1304 |
HandleNumberEntryClearedL(); |
|
1305 |
} |
|
1306 |
break; |
|
1307 |
||
1308 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
1309 |
DisconnectCallL(); |
|
1310 |
break; |
|
1311 |
||
1312 |
case EPhoneCmdYesAlsLineChange: |
|
1313 |
if( IsAlsLineChangePossible() ) |
|
1314 |
{ |
|
1315 |
ChangeAlsLineL(); |
|
1316 |
} |
|
1317 |
else |
|
1318 |
{ |
|
1319 |
SendGlobalErrorNoteL( EPhoneLineBlockingNote ); |
|
1320 |
HandleNumberEntryClearedL(); // Set back CBAs |
|
1321 |
} |
|
1322 |
break; |
|
1323 |
||
1324 |
case EPhoneCmdNoAlsLineChange: |
|
1325 |
if ( !IsOnScreenDialerSupported() ) |
|
1326 |
{ |
|
1327 |
HandleNumberEntryClearedL(); |
|
1328 |
} |
|
1329 |
break; |
|
1330 |
||
1331 |
case EPhoneCmdYesBtDisconnectQuery: |
|
1332 |
case EPhoneCmdNoBtDisconnectQuery: |
|
1333 |
CPhoneBtaaDisconnectHandler::InstanceL()->HandleQueryDismissL( aCommand ); |
|
1334 |
// Make sure that query is removed |
|
1335 |
// if there has been also another ( by Cover UI ). |
|
1336 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
1337 |
break; |
|
1338 |
||
1339 |
case EPhoneInCallCmdDeactivateIhf: // fall through |
|
1340 |
case EPhoneInCallCmdActivateIhf: |
|
1341 |
SetHandsfreeModeL( aCommand == EPhoneInCallCmdActivateIhf ); |
|
1342 |
break; |
|
1343 |
||
1344 |
case EPhoneInCallCmdHandset: // fall through |
|
1345 |
case EPhoneInCallCmdBtHandsfree: |
|
1346 |
CPhoneState::SetBTHandsfreeModeL( |
|
1347 |
aCommand == EPhoneInCallCmdBtHandsfree ); |
|
1348 |
break; |
|
1349 |
||
1350 |
case EPhoneInCallCmdActivatEPhonebook: |
|
1351 |
{ |
|
1352 |
} |
|
1353 |
break; |
|
1354 |
||
1355 |
case EPhoneNumberAcqSecurityDialer: |
|
1356 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1357 |
|
37 | 1358 |
} |
1359 |
break; |
|
1360 |
||
1361 |
case EPhoneDialerCmdContacts: |
|
1362 |
{ |
|
1363 |
} |
|
1364 |
break; |
|
1365 |
||
1366 |
case EPhoneNumberAcqCmdToggleNeAlphaMode: |
|
1367 |
case EPhoneNumberAcqCmdToggleNeNumericMode: |
|
1368 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1369 |
|
37 | 1370 |
} |
1371 |
break; |
|
1372 |
||
1373 |
case EPhoneCmdYesVideoFailedNoMemorySwitchToVoice: |
|
1374 |
DialVoiceCallL(); |
|
1375 |
break; |
|
1376 |
||
1377 |
case EPhoneCmdNoVideoFailedNoMemorySwitchToVoice: |
|
1378 |
if ( IsNumberEntryUsedL() ) |
|
1379 |
{ |
|
1380 |
// Show the number entry if it exists |
|
1381 |
SetNumberEntryVisibilityL(ETrue); |
|
1382 |
} |
|
1383 |
else if ( NeedToSendToBackgroundL() ) |
|
1384 |
{ |
|
1385 |
// Continue displaying current app but set up the |
|
1386 |
// idle screen in the background |
|
1387 |
SetupIdleScreenInBackgroundL(); |
|
1388 |
} |
|
1389 |
else |
|
1390 |
{ |
|
1391 |
// Display idle screen |
|
1392 |
DisplayIdleScreenL(); |
|
1393 |
} |
|
1394 |
break; |
|
1395 |
||
1396 |
case EPhoneInCallCmdSetVolumeLevel: |
|
1397 |
{ |
|
1398 |
// This command comes from ui control, no need to update |
|
1399 |
// value to control (second parameter set false). |
|
1400 |
ChangeAudioVolumeL( GetVolumeLevel(), EFalse ); |
|
1401 |
} |
|
1402 |
break; |
|
1403 |
||
1404 |
case EPhoneCmdVideoCallOutOfMemory: |
|
1405 |
ShowVideoCallOutOfMemoryNoteL(); |
|
1406 |
DisconnectCallL(); |
|
1407 |
break; |
|
1408 |
||
1409 |
case EPhoneCallComingCmdSoftReject: |
|
1410 |
// Open Soft reject message editor |
|
1411 |
OpenSoftRejectMessageEditorL(); |
|
1412 |
break; |
|
1413 |
||
1414 |
case EPhoneInCallCmdContacts: |
|
1415 |
iViewCommandHandle->ExecuteCommand( EPhoneViewOpenContacts ); |
|
1416 |
break; |
|
1417 |
||
1418 |
default: |
|
1419 |
||
1420 |
/*if ( IsOnScreenDialerSupported() ) |
|
1421 |
{ |
|
1422 |
// Offer command to view. |
|
1423 |
TPhoneViewResponseId resId = |
|
1424 |
iViewCommandHandle->HandleCommandL( aCommand ); |
|
1425 |
||
1426 |
if( resId == EPhoneViewResponseFailed ) |
|
1427 |
{ |
|
1428 |
commandStatus = EFalse; |
|
1429 |
} |
|
1430 |
} |
|
1431 |
else*/ |
|
1432 |
||
1433 |
{ |
|
1434 |
commandStatus = EFalse; |
|
1435 |
} |
|
1436 |
break; |
|
1437 |
} |
|
1438 |
||
1439 |
if( !commandStatus && iCustomization ) |
|
1440 |
{ |
|
1441 |
commandStatus = iCustomization->HandleCommandL( aCommand ); |
|
1442 |
} |
|
1443 |
||
1444 |
return commandStatus; |
|
1445 |
} |
|
1446 |
||
1447 |
// ----------------------------------------------------------------------------- |
|
1448 |
// CPhoneState::ProcessCommandL |
|
1449 |
// ----------------------------------------------------------------------------- |
|
1450 |
// |
|
1451 |
EXPORT_C TBool CPhoneState::ProcessCommandL( TInt /*aCommand*/ ) |
|
1452 |
{ |
|
1453 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL() "); |
|
1454 |
// no implementation. |
|
1455 |
return EFalse; |
|
1456 |
} |
|
1457 |
||
1458 |
// <-------------------------- REMOTE CONTROL EVENTS -------------------------> |
|
1459 |
||
1460 |
// ----------------------------------------------------------------------------- |
|
1461 |
// CPhoneState::HandleRemConCommandL |
|
1462 |
// ----------------------------------------------------------------------------- |
|
1463 |
// |
|
1464 |
EXPORT_C TBool CPhoneState::HandleRemConCommandL( |
|
1465 |
TRemConCoreApiOperationId aOperationId, |
|
1466 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
1467 |
{ |
|
1468 |
TBool handled = EFalse; |
|
1469 |
||
1470 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::MrccatoCommand() "); |
|
1471 |
switch ( aOperationId ) |
|
1472 |
{ |
|
1473 |
case ERemConCoreApiVolumeUp: |
|
1474 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeUp" ); |
|
1475 |
IncreaseAudioVolumeL(); |
|
1476 |
handled = ETrue; |
|
1477 |
break; |
|
1478 |
||
1479 |
case ERemConCoreApiVolumeDown: |
|
1480 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeDown" ); |
|
1481 |
DecreaseAudioVolumeL(); |
|
1482 |
handled = ETrue; |
|
1483 |
break; |
|
1484 |
case ERemConCoreApiMute: |
|
1485 |
{ |
|
1486 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiMute" ); |
|
1487 |
iStateMachine->PhoneEngineInfo()->AudioMute() ? |
|
1488 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( EFalse ): |
|
1489 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( ETrue ); |
|
1490 |
iStateMachine->SendPhoneEngineMessage( |
|
1491 |
MPEPhoneModel::EPEMessageSetAudioMute ); |
|
1492 |
handled = ETrue; |
|
1493 |
break; |
|
1494 |
} |
|
1495 |
||
1496 |
default: |
|
1497 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand MrccatoCmd.Other(%d)", aOperationId ); |
|
1498 |
// Other commands ignored. |
|
1499 |
break; |
|
1500 |
} |
|
1501 |
||
1502 |
return handled; |
|
1503 |
} |
|
1504 |
||
1505 |
// ----------------------------------------------------------- |
|
1506 |
// CPhoneState::DecreaseAudioVolume() |
|
1507 |
// ----------------------------------------------------------- |
|
1508 |
// |
|
1509 |
EXPORT_C void CPhoneState::DecreaseAudioVolumeL() |
|
1510 |
{ |
|
1511 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DecreaceAudioVolumeL( ) "); |
|
1512 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1513 |
Panic( EPhoneCtrlInvariant ) ); |
|
1514 |
||
1515 |
TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
1516 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::DecreaseAudioVolumeL - audio output =%d", output ); |
|
1517 |
if( output == EPETTY ) |
|
1518 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1519 |
SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl, ETrue ); |
37 | 1520 |
} |
1521 |
else |
|
1522 |
{ |
|
1523 |
TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() ); |
|
1524 |
audioVolume--; |
|
1525 |
ChangeAudioVolumeL( audioVolume, ETrue ); |
|
1526 |
} |
|
1527 |
} |
|
1528 |
||
1529 |
// ----------------------------------------------------------- |
|
1530 |
// CPhoneState::IncreaceAudioVolume() |
|
1531 |
// ----------------------------------------------------------- |
|
1532 |
// |
|
1533 |
EXPORT_C void CPhoneState::IncreaseAudioVolumeL() |
|
1534 |
{ |
|
1535 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IncreaceAudioVolumeL( ) "); |
|
1536 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1537 |
Panic( EPhoneCtrlInvariant ) ); |
|
1538 |
||
1539 |
TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
1540 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IncreaseAudioVolumeL - audio output =%d", output ); |
|
1541 |
if( output == EPETTY ) |
|
1542 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1543 |
SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl, ETrue ); |
37 | 1544 |
} |
1545 |
else |
|
1546 |
{ |
|
1547 |
TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() ); |
|
1548 |
audioVolume++; |
|
1549 |
ChangeAudioVolumeL( audioVolume, ETrue ); |
|
1550 |
} |
|
1551 |
} |
|
1552 |
||
1553 |
// ----------------------------------------------------------- |
|
1554 |
// CPhoneState::ChangeAudioVolumeL() |
|
1555 |
// ----------------------------------------------------------- |
|
1556 |
// |
|
1557 |
void CPhoneState::ChangeAudioVolumeL( TInt aLevel, TBool aUpdateControl ) |
|
1558 |
{ |
|
1559 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAudioVolumeL( ) "); |
|
1560 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::ChangeAudioVolumeL - set volume =%d", aLevel ); |
|
1561 |
||
1562 |
TInt valueToControl = aLevel; |
|
1563 |
||
1564 |
// sets value between 1 -10 |
|
1565 |
if ( aLevel>=KPhoneVolumeMinValue && aLevel<=KPhoneVolumeMaxValue ) |
|
1566 |
{ |
|
1567 |
iStateMachine->PhoneEngineInfo()->SetAudioVolumeCommand( aLevel ); |
|
1568 |
// Syncronizes audio volume level between engine and ui |
|
1569 |
// causes EPEMessageAudioVolumeChanged message to phoneUI |
|
1570 |
iStateMachine->SendPhoneEngineMessage( |
|
1571 |
MPEPhoneModel::EPEMessageSetAudioVolume ); |
|
1572 |
} |
|
1573 |
||
1574 |
if ( aUpdateControl ) |
|
1575 |
{ |
|
1576 |
// Update the volume display. |
|
1577 |
// Upper max (11) and under min (-1) |
|
1578 |
// values are also updated to volume popup. |
|
1579 |
TPhoneCmdParamInteger volumeParam; |
|
1580 |
volumeParam.SetInteger( valueToControl ); |
|
1581 |
iViewCommandHandle->ExecuteCommandL( |
|
1582 |
EPhoneViewSetNaviPaneAudioVolume, |
|
1583 |
&volumeParam ); |
|
1584 |
} |
|
1585 |
} |
|
1586 |
||
1587 |
// <-------------------------- COMMON STATE FUNCTIONS ------------------------> |
|
1588 |
||
1589 |
// ----------------------------------------------------------- |
|
1590 |
// CPhoneState::DialMultimediaCallL |
|
1591 |
// ----------------------------------------------------------- |
|
1592 |
// |
|
1593 |
EXPORT_C void CPhoneState::DialMultimediaCallL() |
|
1594 |
{ |
|
1595 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() "); |
|
1596 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1597 |
Panic( EPhoneCtrlInvariant ) ); |
|
1598 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVideo ); |
|
1599 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
1600 |
} |
|
1601 |
||
1602 |
// ----------------------------------------------------------- |
|
1603 |
// CPhoneState::DialVoiceCallL |
|
1604 |
// ----------------------------------------------------------- |
|
1605 |
// |
|
1606 |
EXPORT_C void CPhoneState::DialVoiceCallL() |
|
1607 |
{ |
|
1608 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
|
1609 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1610 |
Panic( EPhoneCtrlInvariant ) ); |
|
1611 |
||
1612 |
// Disable global notes |
|
1613 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
1614 |
globalNotifierParam.SetBoolean( ETrue ); |
|
1615 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
1616 |
&globalNotifierParam ); |
|
1617 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
|
1618 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
1619 |
} |
|
1620 |
||
1621 |
// ----------------------------------------------------------- |
|
1622 |
// CPhoneState::DisconnectCallL |
|
1623 |
// ----------------------------------------------------------- |
|
1624 |
// |
|
1625 |
EXPORT_C TBool CPhoneState::DisconnectCallL() |
|
1626 |
{ |
|
1627 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
|
1628 |
TPhoneCmdParamInteger callIdParam; |
|
1629 |
iViewCommandHandle->ExecuteCommandL( |
|
1630 |
EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
|
1631 |
||
1632 |
TBool ret = EFalse; |
|
1633 |
if( callIdParam.Integer() > KErrNotFound ) |
|
1634 |
{ |
|
1635 |
// Release the call |
|
1636 |
iStateMachine->SetCallId( callIdParam.Integer() ); |
|
1637 |
||
1638 |
if( IsVideoCall( callIdParam.Integer() ) ) |
|
1639 |
{ |
|
1640 |
// Video call can be released only after we get response to VT Shutdown Command |
|
1641 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
|
1642 |
KCatPhoneToVideotelCommands, |
|
1643 |
EVtCmdReleaseDataport, |
|
1644 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
1645 |
KPhoneToVideotelCmdVersionMinor, |
|
1646 |
KPhoneToVideotelCmdVersionBuild ), |
|
1647 |
KNullDesC8, |
|
1648 |
CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
|
1649 |
} |
|
1650 |
else |
|
1651 |
{ |
|
1652 |
// Release the call |
|
1653 |
iStateMachine->SendPhoneEngineMessage( |
|
1654 |
MPEPhoneModel::EPEMessageRelease ); |
|
1655 |
} |
|
1656 |
ret = ETrue; |
|
1657 |
} |
|
1658 |
else |
|
1659 |
{ |
|
1660 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
1661 |
"CPhoneState::DisconnectCallL has negative call id!" ); |
|
1662 |
} |
|
1663 |
||
1664 |
return ret; |
|
1665 |
} |
|
1666 |
||
1667 |
// ----------------------------------------------------------- |
|
1668 |
// CPhoneState::DisplayIdleScreenL |
|
1669 |
// ----------------------------------------------------------- |
|
1670 |
// |
|
1671 |
EXPORT_C void CPhoneState::DisplayIdleScreenL() |
|
1672 |
{ |
|
1673 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayIdleScreenL( ) "); |
|
1674 |
||
1675 |
// Don't remove reconnect query if it's shown |
|
1676 |
if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() ) |
|
1677 |
{ |
|
1678 |
// Remove dialogs if necessary |
|
1679 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1680 |
} |
|
1681 |
||
1682 |
// Set Empty CBA |
|
1683 |
iCbaManager->SetCbaL( EPhoneEmptyCBA ); |
|
1684 |
// Bring Idle app to the foreground |
|
1685 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
1686 |
} |
|
1687 |
||
1688 |
// ----------------------------------------------------------- |
|
1689 |
// CPhoneState::SetupIdleScreenInBackgroundL() |
|
1690 |
// ----------------------------------------------------------- |
|
1691 |
// |
|
1692 |
EXPORT_C void CPhoneState::SetupIdleScreenInBackgroundL() |
|
1693 |
{ |
|
1694 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetupIdleScreenInBackgroundL( ) "); |
|
1695 |
// Don't remove reconnect query if it's shown |
|
1696 |
if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() ) |
|
1697 |
{ |
|
1698 |
// Remove dialogs if necessary |
|
1699 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1700 |
} |
|
1701 |
// Return phone to the background |
|
1702 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
1703 |
||
1704 |
// Set Idle app as the top app |
|
1705 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication ); |
|
1706 |
||
1707 |
// Set Empty CBA |
|
1708 |
iCbaManager->SetCbaL( EPhoneEmptyCBA ); |
|
1709 |
} |
|
1710 |
||
1711 |
// --------------------------------------------------------- |
|
1712 |
// CPhoneState::CallFromNumberEntryL |
|
1713 |
// --------------------------------------------------------- |
|
1714 |
// |
|
1715 |
EXPORT_C void CPhoneState::CallFromNumberEntryL() |
|
1716 |
{ |
|
1717 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallFromNumberEntryL( ) "); |
|
1718 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1719 |
Panic( EPhoneCtrlInvariant ) ); |
|
1720 |
||
1721 |
if ( IsOnScreenDialerSupported() ) |
|
1722 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1723 |
if ( IsCustomizedDialerVisibleL() ) |
37 | 1724 |
{ |
1725 |
return; |
|
1726 |
} |
|
1727 |
||
1728 |
else if( IsNumberEntryUsedL() ) |
|
1729 |
{ |
|
1730 |
// Query on top of dialer |
|
1731 |
if ( IsAnyQueryActiveL() ) |
|
1732 |
{ |
|
1733 |
return; |
|
1734 |
} |
|
1735 |
// Open recent calls list when the number entry is empty |
|
1736 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
1737 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
1738 |
&numberEntryCountParam ); |
|
1739 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
1740 |
TBool startLogs = neLength == 0 ? ETrue : EFalse; |
|
1741 |
||
1742 |
if ( startLogs ) |
|
1743 |
{ |
|
1744 |
iViewCommandHandle->HandleCommandL( |
|
1745 |
EPhoneDialerCmdLog ); |
|
1746 |
return; |
|
1747 |
} |
|
1748 |
} |
|
1749 |
} |
|
1750 |
||
1751 |
// Get the number entry contents |
|
1752 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
1753 |
||
1754 |
// Call the number |
|
1755 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
1756 |
||
1757 |
if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
1758 |
{ |
|
1759 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1760 |
||
1761 |
HandleNumberEntryClearedL(); |
|
1762 |
} |
|
1763 |
||
1764 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
1765 |
||
1766 |
if ( !iCustomization || |
|
1767 |
!iCustomization->HandleCallFromNumberEntryL() ) |
|
1768 |
{ |
|
1769 |
// Customization didn't handle call. Dial voice call |
|
1770 |
// as normally |
|
1771 |
DialVoiceCallL(); |
|
1772 |
} |
|
1773 |
||
1774 |
} |
|
1775 |
||
1776 |
// ----------------------------------------------------------- |
|
1777 |
// CPhoneState::DisplayHeaderForCallComingInL |
|
1778 |
// ----------------------------------------------------------- |
|
1779 |
// |
|
1780 |
EXPORT_C void CPhoneState::DisplayHeaderForCallComingInL( |
|
1781 |
TInt aCallId, |
|
1782 |
TBool aWaitingCall ) |
|
1783 |
{ |
|
1784 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForCallComingInL( ) "); |
|
1785 |
CallheaderManagerL()->DisplayHeaderForCallComingInL( aCallId, aWaitingCall ); |
|
1786 |
} |
|
1787 |
||
1788 |
// ----------------------------------------------------------- |
|
1789 |
// CPhoneState::SetCallHeaderTextsForCallComingInL |
|
1790 |
// ----------------------------------------------------------- |
|
1791 |
// |
|
1792 |
EXPORT_C void CPhoneState::SetCallHeaderTextsForCallComingInL( |
|
1793 |
TInt aCallId, |
|
1794 |
TBool aWaitingCall, |
|
1795 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
1796 |
{ |
|
1797 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetCallHeaderTextsForCallComingInL( ) "); |
|
1798 |
CallheaderManagerL()->SetCallHeaderTextsForCallComingIn( aCallId, aWaitingCall, aCallHeaderData ); |
|
1799 |
} |
|
1800 |
||
1801 |
// ----------------------------------------------------------- |
|
1802 |
// CPhoneState::DisplayHeaderForOutgoingCallL |
|
1803 |
// ----------------------------------------------------------- |
|
1804 |
// |
|
1805 |
EXPORT_C void CPhoneState::DisplayHeaderForOutgoingCallL( |
|
1806 |
TInt aCallId ) |
|
1807 |
{ |
|
1808 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForOutgoingCallL( ) "); |
|
1809 |
CallheaderManagerL()->DisplayHeaderForOutgoingCallL(aCallId); |
|
1810 |
} |
|
1811 |
||
1812 |
// ----------------------------------------------------------- |
|
1813 |
// CPhoneState::UpdateSingleActiveCallL |
|
1814 |
// ----------------------------------------------------------- |
|
1815 |
// |
|
1816 |
EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId ) |
|
1817 |
{ |
|
1818 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) "); |
|
1819 |
||
1820 |
// Stop capturing keys |
|
1821 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
1822 |
||
1823 |
BeginUiUpdateLC(); |
|
1824 |
||
1825 |
// Update call state |
|
1826 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
1827 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
1828 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
1829 |
&callHeaderParam ); |
|
1830 |
||
1831 |
// Update remote info data |
|
1832 |
UpdateRemoteInfoDataL( aCallId ); |
|
1833 |
||
1834 |
// Create call duration label if enabled |
|
1835 |
// This key will be moved to some other area, but since key |
|
1836 |
// is supported we can still use it. |
|
1837 |
TBool callDuration( EFalse ); |
|
1838 |
CPhoneCenRepProxy::Instance()->GetInt( |
|
1839 |
KCRUidLogs, KLogsShowCallDuration, callDuration ); |
|
1840 |
||
1841 |
if ( callDuration ) |
|
1842 |
{ |
|
1843 |
HandleChangedCallDurationL( aCallId ); |
|
1844 |
} |
|
1845 |
||
1846 |
EndUiUpdate(); |
|
1847 |
||
1848 |
// Go to current state implementation |
|
1849 |
iCbaManager->UpdateInCallCbaL(); |
|
1850 |
||
1851 |
// Go to background if necessary |
|
1852 |
if ( NeedToSendToBackgroundL() || IsAutoLockOn() ) |
|
1853 |
{ |
|
1854 |
} |
|
1855 |
// If there is no need to send back ground and number entry is used then |
|
1856 |
// we must show number entry. |
|
1857 |
else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() ) |
|
1858 |
{ |
|
1859 |
SetNumberEntryVisibilityL(ETrue); |
|
1860 |
} |
|
1861 |
} |
|
1862 |
||
1863 |
// ----------------------------------------------------------- |
|
1864 |
// CPhoneState::CaptureKeysDuringCallNotificationL |
|
1865 |
// ----------------------------------------------------------- |
|
1866 |
// |
|
1867 |
EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL( |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1868 |
TBool /*aCaptured*/ ) |
37 | 1869 |
{ |
1870 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) "); |
|
1871 |
// Determine which view command to execute based on the capture status |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1872 |
/*const TInt viewCommandId = aCaptured ? |
37 | 1873 |
EPhoneViewStartCapturingKey : |
1874 |
EPhoneViewStopCapturingKey; |
|
1875 |
||
1876 |
// Capture the App key |
|
1877 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
1878 |
appKeyCaptureParam.SetKey( EStdKeyApplication0 ); |
|
1879 |
appKeyCaptureParam.SetKeyCode( EKeyApplication0 ); |
|
1880 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
1881 |
iViewCommandHandle->ExecuteCommandL( viewCommandId, &appKeyCaptureParam ); |
|
1882 |
||
1883 |
// Capture the Camera key, if it exists |
|
1884 |
if ( FeatureManager::FeatureSupported( KFeatureIdCamera ) ) |
|
1885 |
{ |
|
1886 |
TPhoneCmdParamKeyCapture cameraKeyCaptureParam; |
|
1887 |
cameraKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
1888 |
cameraKeyCaptureParam.SetKeyCode( EKeyDevice7 ); |
|
1889 |
cameraKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
1890 |
iViewCommandHandle->ExecuteCommandL( viewCommandId, |
|
1891 |
&cameraKeyCaptureParam ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1892 |
}*/ |
37 | 1893 |
} |
1894 |
||
1895 |
// ----------------------------------------------------------- |
|
1896 |
// CPhoneState::IsWaitingCallL |
|
1897 |
// ----------------------------------------------------------- |
|
1898 |
// |
|
1899 |
TBool CPhoneState::IsWaitingCallL( const TInt aCallId ) |
|
1900 |
{ |
|
1901 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsWaitingCallL( ) "); |
|
1902 |
return CallheaderManagerL()->IsWaitingCallL( aCallId ); |
|
1903 |
} |
|
1904 |
||
1905 |
// ----------------------------------------------------------- |
|
1906 |
// CPhoneState::UpdateCallHeaderInfoL |
|
1907 |
// ----------------------------------------------------------- |
|
1908 |
// |
|
1909 |
TPhoneCmdParamCallHeaderData CPhoneState::UpdateCallHeaderInfoL( TInt aCallId ) |
|
1910 |
{ |
|
1911 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateCallHeaderInfoL( ) "); |
|
1912 |
return CallheaderManagerL()->UpdateCallHeaderInfoL( aCallId ); |
|
1913 |
} |
|
1914 |
||
1915 |
// ----------------------------------------------------------- |
|
1916 |
// CPhoneState::UpdateRemoteInfoDataL |
|
1917 |
// ----------------------------------------------------------- |
|
1918 |
// |
|
1919 |
EXPORT_C void CPhoneState::UpdateRemoteInfoDataL( TInt aCallId ) |
|
1920 |
{ |
|
1921 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::UpdateRemoteInfoDataL() "); |
|
1922 |
TPhoneCmdParamCallHeaderData callHeaderParam = UpdateCallHeaderInfoL( aCallId ); |
|
1923 |
||
1924 |
if( iCustomization ) |
|
1925 |
{ |
|
1926 |
TBuf<KCntMaxTextFieldLength> inCallNumberText( KNullDesC ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1927 |
|
37 | 1928 |
// to check if we have VoIP call in question and fix |
1929 |
// parameters if needed |
|
1930 |
iCustomization->ModifyCallHeaderTexts( aCallId, &callHeaderParam, |
|
1931 |
inCallNumberText ); |
|
1932 |
} |
|
1933 |
||
1934 |
||
1935 |
// Update the remote info data in the call header |
|
1936 |
iViewCommandHandle->ExecuteCommandL( |
|
1937 |
EPhoneViewUpdateCallHeaderRemoteInfoData, |
|
1938 |
aCallId, |
|
1939 |
&callHeaderParam ); |
|
1940 |
} |
|
1941 |
||
1942 |
// ----------------------------------------------------------- |
|
1943 |
// CPhoneState::SetCallHeaderType |
|
1944 |
// ----------------------------------------------------------- |
|
1945 |
// |
|
1946 |
EXPORT_C void CPhoneState::SetCallHeaderType( |
|
1947 |
TInt aCallHeaderType ) |
|
1948 |
{ |
|
1949 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetCallHeaderType() "); |
|
1950 |
TRAP_IGNORE( CallheaderManagerL()->SetCallHeaderType( aCallHeaderType ) ); |
|
1951 |
} |
|
1952 |
||
1953 |
// ----------------------------------------------------------- |
|
1954 |
// CPhoneState::GetRemoteInfoDataL |
|
1955 |
// ----------------------------------------------------------- |
|
1956 |
// |
|
1957 |
EXPORT_C void CPhoneState::GetRemoteInfoDataL( |
|
1958 |
TInt aCallId, |
|
1959 |
TDes& aData ) |
|
1960 |
{ |
|
1961 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::GetRemoteInfoDataL() "); |
|
1962 |
CallheaderManagerL()->GetRemoteInfoDataL( aCallId, aData ); |
|
1963 |
} |
|
1964 |
||
1965 |
// ----------------------------------------------------------- |
|
1966 |
// CPhoneState::UpdateCbaSwivelStateChangedL |
|
1967 |
// ----------------------------------------------------------- |
|
1968 |
// |
|
1969 |
void CPhoneState::UpdateCbaSwivelStateChangedL() |
|
1970 |
{ |
|
1971 |
__LOGMETHODSTARTEND(EPhoneControl,"CPhoneState::UpdateCbaSwivelStateChangedL()" ); |
|
1972 |
||
1973 |
TPhoneCmdParamCallStateData callStateData; |
|
1974 |
callStateData.SetCallState( EPEStateRinging ); |
|
1975 |
iViewCommandHandle->HandleCommandL( |
|
1976 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
1977 |
TInt incomingCall = callStateData.CallId(); |
|
1978 |
||
1979 |
TPhoneCmdParamInteger activeCallCount; |
|
1980 |
iViewCommandHandle->ExecuteCommandL( |
|
1981 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
1982 |
||
1983 |
if ( incomingCall > KErrNotFound ) |
|
1984 |
{ |
|
1985 |
if( activeCallCount.Integer() == ENoActiveCalls ) |
|
1986 |
{ |
|
1987 |
iCbaManager->UpdateIncomingCbaL( incomingCall ); |
|
1988 |
} |
|
1989 |
else |
|
1990 |
{ |
|
1991 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
1992 |
} |
|
1993 |
} |
|
1994 |
else if ( activeCallCount.Integer() != ENoActiveCalls ) |
|
1995 |
{ |
|
1996 |
iCbaManager->UpdateInCallCbaL(); |
|
1997 |
} |
|
1998 |
} |
|
1999 |
||
2000 |
// ----------------------------------------------------------------------------- |
|
2001 |
// CPhoneState::IsSwivelClosed |
|
2002 |
// This function checks from PubSubProxy that is |
|
2003 |
// Swivel closed or not in product. |
|
2004 |
// |
|
2005 |
// ----------------------------------------------------------------------------- |
|
2006 |
// |
|
2007 |
EXPORT_C TBool CPhoneState::IsSwivelClosed() const |
|
2008 |
{ |
|
2009 |
if( CPhoneCenRepProxy::Instance()-> |
|
2010 |
IsTelephonyFeatureSupported( KTelephonyLVFlagSwivelInDevice )) |
|
2011 |
{ |
|
2012 |
return CPhonePubSubProxy::Instance()-> |
|
2013 |
Value( KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed; |
|
2014 |
} |
|
2015 |
else |
|
2016 |
{ |
|
2017 |
return EFalse; |
|
2018 |
} |
|
2019 |
} |
|
2020 |
||
2021 |
// <-------------------------- CONTEXT MENU -------------------------> |
|
2022 |
||
2023 |
// ----------------------------------------------------------- |
|
2024 |
// CPhoneState::ShowNoteL |
|
2025 |
// ----------------------------------------------------------- |
|
2026 |
// |
|
2027 |
EXPORT_C void CPhoneState::ShowNoteL( TInt aResourceId ) |
|
2028 |
{ |
|
2029 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNoteL( ) "); |
|
2030 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2031 |
TPhoneCmdParamNote noteParam; |
|
2032 |
noteParam.SetType( EPhoneNotePermanent ); |
|
2033 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2034 |
ResolveResourceID( aResourceId ) ); |
|
2035 |
||
2036 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
2037 |
} |
|
2038 |
||
2039 |
// ----------------------------------------------------------- |
|
2040 |
// CPhoneState::ShowQueryL |
|
2041 |
// ----------------------------------------------------------- |
|
2042 |
// |
|
2043 |
EXPORT_C void CPhoneState::ShowQueryL( TInt aResourceId ) |
|
2044 |
{ |
|
2045 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowQueryL( ) "); |
|
2046 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2047 |
TPhoneCmdParamQuery queryParam; |
|
2048 |
queryParam.SetQueryType( EPhoneQueryDialog ); |
|
2049 |
queryParam.SetQueryResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2050 |
ResolveResourceID( aResourceId ) ); |
|
2051 |
||
2052 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParam ); |
|
2053 |
} |
|
2054 |
||
2055 |
// ----------------------------------------------------------- |
|
2056 |
// CPhoneState::ShowTextQueryL |
|
2057 |
// ----------------------------------------------------------- |
|
2058 |
// |
|
2059 |
EXPORT_C void CPhoneState::ShowTextQueryL( |
|
2060 |
TInt aDialogResourceId, |
|
2061 |
TInt aDefaultCbaResourceId, |
|
2062 |
TInt aContentCbaResourceId, |
|
2063 |
TDes* aDataText, |
|
2064 |
TBool aSendKeyEnabled ) |
|
2065 |
{ |
|
2066 |
__ASSERT_DEBUG( aDialogResourceId && |
|
2067 |
aDefaultCbaResourceId && |
|
2068 |
aContentCbaResourceId && |
|
2069 |
aDataText, |
|
2070 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2071 |
TPhoneCmdParamQuery queryDialogParam; |
|
2072 |
queryDialogParam.SetQueryType( EPhoneTextQueryDialog ); |
|
2073 |
queryDialogParam.SetQueryResourceId( aDialogResourceId ); |
|
2074 |
queryDialogParam.SetDefaultCba( aDefaultCbaResourceId ); |
|
2075 |
queryDialogParam.SetContentCba( aContentCbaResourceId ); |
|
2076 |
queryDialogParam.SetDataText( aDataText ); |
|
2077 |
queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled ); |
|
2078 |
||
2079 |
// Display dialog |
|
2080 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
2081 |
&queryDialogParam ); |
|
2082 |
} |
|
2083 |
||
2084 |
// ----------------------------------------------------------- |
|
2085 |
// CPhoneState::DisplayCallTerminationNoteL |
|
2086 |
// ----------------------------------------------------------- |
|
2087 |
// |
|
2088 |
EXPORT_C void CPhoneState::DisplayCallTerminationNoteL() |
|
2089 |
{ |
|
2090 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayCallTerminationNoteL( ) "); |
|
2091 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
2092 |
Panic( EPhoneCtrlInvariant ) ); |
|
2093 |
if ( CheckIfShowCallTerminationNote() ) |
|
2094 |
{ |
|
2095 |
TBuf<KPhoneMaxCharsInNote> noteText; |
|
2096 |
TBuf<KPhoneMaxCharsInNote> postCallLineText; |
|
2097 |
||
2098 |
// Post call Line 1: Call Summary |
|
2099 |
LoadResource( postCallLineText, EPhoneNoteTextCallSummary ); |
|
2100 |
noteText.Append( postCallLineText ); |
|
2101 |
noteText.Append( KPhoneLineFeed ); |
|
2102 |
||
2103 |
// Post call Line 2: Duration |
|
2104 |
LoadResource( postCallLineText, EPhoneNoteTextCallDuration ); |
|
2105 |
noteText.Append( postCallLineText ); |
|
2106 |
noteText.Append( KPhoneLineFeed ); |
|
2107 |
||
2108 |
// Post call Line 3: Time, get the format for last call time. |
|
2109 |
LoadResource( postCallLineText, EPhoneCallDurationFormatString ); |
|
2110 |
TPtrC durationFormat( postCallLineText ); |
|
2111 |
||
2112 |
// Get the last call duration |
|
2113 |
TTime time( 0 ); |
|
2114 |
TTimeIntervalSeconds timeInterval = |
|
2115 |
iStateMachine->PhoneEngineInfo()->CallDuration(); |
|
2116 |
time += timeInterval; |
|
2117 |
||
2118 |
// Format the time |
|
2119 |
TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC ); |
|
2120 |
time.FormatL( timeString, durationFormat ); |
|
2121 |
||
2122 |
AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeString ); |
|
2123 |
||
2124 |
noteText.Append( timeString ); |
|
2125 |
||
2126 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2127 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
37 | 2128 |
globalNoteParam.SetText( noteText ); |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2129 |
|
37 | 2130 |
iViewCommandHandle->ExecuteCommandL( |
2131 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2132 |
} |
|
2133 |
} |
|
2134 |
||
2135 |
// --------------------------------------------------------- |
|
2136 |
// CPhoneState::SendGlobalInfoNoteL |
|
2137 |
// --------------------------------------------------------- |
|
2138 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2139 |
EXPORT_C void CPhoneState::SendGlobalInfoNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2140 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2141 |
{ |
2142 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalInfoNoteL( ) "); |
|
2143 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2144 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2145 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
|
2146 |
{ |
|
2147 |
// Re-enable global notes |
|
2148 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2149 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2150 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2151 |
&globalNotifierParam ); |
|
2152 |
||
2153 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2154 |
PhoneNotificationType type = aNotificationDialog ? |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2155 |
EPhoneNotificationDialog : EPhoneMessageBoxInformation; |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2156 |
globalNoteParam.SetType( type ); |
37 | 2157 |
globalNoteParam.SetTextResourceId( |
2158 |
CPhoneMainResourceResolver::Instance()-> |
|
2159 |
ResolveResourceID( aResourceId ) ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2160 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2161 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2162 |
|
37 | 2163 |
iViewCommandHandle->ExecuteCommandL( |
2164 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2165 |
} |
|
2166 |
} |
|
2167 |
||
2168 |
// --------------------------------------------------------- |
|
2169 |
// CPhoneUIController::SendGlobalWarningNoteL |
|
2170 |
// --------------------------------------------------------- |
|
2171 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2172 |
EXPORT_C void CPhoneState::SendGlobalWarningNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2173 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2174 |
{ |
2175 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) "); |
|
2176 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2177 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2178 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || |
|
2179 |
SimState() == EPESimReadable ) |
|
2180 |
{ |
|
2181 |
// Re-enable global notes |
|
2182 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2183 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2184 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2185 |
&globalNotifierParam ); |
|
2186 |
||
2187 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2188 |
PhoneNotificationType type = aNotificationDialog ? |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2189 |
EPhoneNotificationDialog : EPhoneMessageBoxWarning; |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2190 |
globalNoteParam.SetType( type ); |
37 | 2191 |
globalNoteParam.SetTextResourceId( |
2192 |
CPhoneMainResourceResolver::Instance()-> |
|
2193 |
ResolveResourceID( aResourceId ) ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2194 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2195 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2196 |
|
37 | 2197 |
iViewCommandHandle->ExecuteCommandL( |
2198 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2199 |
} |
|
2200 |
} |
|
2201 |
||
2202 |
// --------------------------------------------------------- |
|
2203 |
// CPhoneUIController::SendGlobalErrorNoteL |
|
2204 |
// --------------------------------------------------------- |
|
2205 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2206 |
EXPORT_C void CPhoneState::SendGlobalErrorNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2207 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2208 |
{ |
2209 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) "); |
|
2210 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2211 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2212 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
|
2213 |
{ |
|
2214 |
// Re-enable global notes |
|
2215 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2216 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2217 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2218 |
&globalNotifierParam ); |
|
2219 |
||
2220 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2221 |
PhoneNotificationType type = aNotificationDialog ? |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2222 |
EPhoneNotificationDialog : EPhoneMessageBoxInformation; |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2223 |
globalNoteParam.SetType( type ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2224 |
|
37 | 2225 |
globalNoteParam.SetTextResourceId( |
2226 |
CPhoneMainResourceResolver::Instance()-> |
|
2227 |
ResolveResourceID( aResourceId ) ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2228 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
37 | 2229 |
|
2230 |
iViewCommandHandle->ExecuteCommandL( |
|
2231 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2232 |
} |
|
2233 |
} |
|
2234 |
||
2235 |
// --------------------------------------------------------- |
|
2236 |
// CPhoneState::SetHandsfreeModeL |
|
2237 |
// --------------------------------------------------------- |
|
2238 |
// |
|
2239 |
EXPORT_C void CPhoneState::SetHandsfreeModeL( TBool aHandsfreeMode ) |
|
2240 |
{ |
|
2241 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetHandsfreeModeL( ) "); |
|
2242 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
2243 |
iViewCommandHandle, iStateMachine, this ); |
|
2244 |
if ( !bt->SetHandsfreeModeL( aHandsfreeMode )) |
|
2245 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2246 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 2247 |
} |
2248 |
CleanupStack::PopAndDestroy( bt ); |
|
2249 |
} |
|
2250 |
||
2251 |
// --------------------------------------------------------- |
|
2252 |
// CPhoneState::SetBTHandsfreeModeL |
|
2253 |
// --------------------------------------------------------- |
|
2254 |
// |
|
2255 |
EXPORT_C void CPhoneState::SetBTHandsfreeModeL( TBool aHandsfreeMode ) |
|
2256 |
{ |
|
2257 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) "); |
|
2258 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
2259 |
iViewCommandHandle, iStateMachine, this ); |
|
2260 |
if ( !bt->SetBTHandsfreeModeL( aHandsfreeMode )) |
|
2261 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2262 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 2263 |
} |
2264 |
CleanupStack::PopAndDestroy( bt ); |
|
2265 |
} |
|
2266 |
||
2267 |
// <-------------------------- INTERNAL FUNCTIONS ------------------------> |
|
2268 |
||
2269 |
// ----------------------------------------------------------- |
|
2270 |
// CPhoneState::UpdateProfileDisplayL |
|
2271 |
// ----------------------------------------------------------- |
|
2272 |
// |
|
2273 |
void CPhoneState::UpdateProfileDisplayL() |
|
2274 |
{ |
|
2275 |
} |
|
2276 |
||
2277 |
||
2278 |
// ----------------------------------------------------------- |
|
2279 |
// CPhoneState::HandleInitiatedEmergencyCallL |
|
2280 |
// Default handling for EPEMessageInitiatedEmergencyCallL message |
|
2281 |
// (other items were commented in a header). |
|
2282 |
// ----------------------------------------------------------- |
|
2283 |
// |
|
2284 |
void CPhoneState::HandleInitiatedEmergencyCallL( TInt /*aCallId*/ ) |
|
2285 |
{ |
|
2286 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyCallL( ) "); |
|
2287 |
||
2288 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
2289 |
||
2290 |
// Stop tone playing, if necessary |
|
2291 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
2292 |
||
2293 |
// Reset Hold flag to view |
|
2294 |
TPhoneCmdParamBoolean holdFlag; |
|
2295 |
holdFlag.SetBoolean( EFalse ); |
|
2296 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
2297 |
||
2298 |
// Go to emergency call state |
|
2299 |
// No need update cba |
|
2300 |
iStateMachine->ChangeState( EPhoneStateEmergency ); |
|
2301 |
} |
|
2302 |
||
2303 |
// ----------------------------------------------------------- |
|
2304 |
// CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL |
|
2305 |
// ----------------------------------------------------------- |
|
2306 |
// |
|
2307 |
void CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL() |
|
2308 |
{ |
|
2309 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) "); |
|
2310 |
||
2311 |
// We have existing video call so need to release dataport before continuing |
|
2312 |
// emergency call. Otherwise we will face problems with dataport use later. |
|
2313 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
|
2314 |
KCatPhoneToVideotelCommands, |
|
2315 |
EVtCmdReleaseDataport, |
|
2316 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
2317 |
KPhoneToVideotelCmdVersionMinor, |
|
2318 |
KPhoneToVideotelCmdVersionBuild ), |
|
2319 |
KNullDesC8, |
|
2320 |
CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) ); |
|
2321 |
} |
|
2322 |
||
2323 |
// ----------------------------------------------------------- |
|
2324 |
// CPhoneState::HandleCallSecureStatusChangeL |
|
2325 |
// ----------------------------------------------------------- |
|
2326 |
// |
|
2327 |
void CPhoneState::HandleCallSecureStatusChangeL( TInt aCallId ) |
|
2328 |
{ |
|
2329 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCallSecureStatusChangeL( ) "); |
|
2330 |
||
2331 |
TBool ciphering( ETrue ); |
|
2332 |
TBool secureSpecified( ETrue ); |
|
2333 |
||
2334 |
if ( aCallId > KErrNotFound ) |
|
2335 |
{ |
|
2336 |
ciphering = iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ); |
|
2337 |
secureSpecified = iStateMachine->PhoneEngineInfo()->SecureSpecified(); |
|
2338 |
} |
|
2339 |
||
2340 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
2341 |
||
2342 |
callHeaderParam.SetCiphering( ciphering ); |
|
2343 |
callHeaderParam.SetCipheringIndicatorAllowed( secureSpecified ); |
|
2344 |
||
2345 |
iViewCommandHandle->ExecuteCommandL( |
|
2346 |
EPhoneViewCipheringInfoChange, |
|
2347 |
aCallId, |
|
2348 |
&callHeaderParam ); |
|
2349 |
} |
|
2350 |
||
2351 |
// --------------------------------------------------------- |
|
2352 |
// CPhoneState::IsVideoCall |
|
2353 |
// --------------------------------------------------------- |
|
2354 |
// |
|
2355 |
EXPORT_C TBool CPhoneState::IsVideoCall( const TInt aCallId ) |
|
2356 |
{ |
|
2357 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsVideoCall( ) "); |
|
2358 |
TBool isVideoCall( EFalse ); |
|
2359 |
TRAP_IGNORE( isVideoCall = CallheaderManagerL()->IsVideoCall( aCallId ) ); |
|
2360 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2361 |
"CPhoneState::IsVideoCall isVideoCall(%d)", |
|
2362 |
isVideoCall ); |
|
2363 |
return isVideoCall; |
|
2364 |
} |
|
2365 |
||
2366 |
// --------------------------------------------------------- |
|
2367 |
// CPhoneState::ChangeAlsLineL |
|
2368 |
// --------------------------------------------------------- |
|
2369 |
// |
|
2370 |
void CPhoneState::ChangeAlsLineL() |
|
2371 |
{ |
|
2372 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAlsLineL( ) "); |
|
2373 |
||
2374 |
if ( !IsOnScreenDialerSupported() ) |
|
2375 |
{ |
|
2376 |
// Do state-specific operation when number entry is cleared |
|
2377 |
HandleNumberEntryClearedL(); |
|
2378 |
} |
|
2379 |
||
2380 |
CCCECallParameters::TCCELineType currentLine; |
|
2381 |
TSSSettingsAlsValue newLine( ESSSettingsAlsPrimary ); |
|
2382 |
||
2383 |
currentLine = iStateMachine->PhoneEngineInfo()->ALSLine(); |
|
2384 |
||
2385 |
if ( currentLine == CCCECallParameters::ECCELineTypePrimary ) |
|
2386 |
{ |
|
2387 |
newLine = ESSSettingsAlsAlternate; |
|
2388 |
} |
|
2389 |
else if ( currentLine == CCCECallParameters::ECCELineTypeAux ) |
|
2390 |
{ |
|
2391 |
newLine = ESSSettingsAlsPrimary; |
|
2392 |
} |
|
2393 |
||
2394 |
RSSSettings ssSettings; |
|
2395 |
TInt retValue = ssSettings.Open(); |
|
2396 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2397 |
"CPhoneState::ChangeAlsLineL : Open %d", retValue ); |
|
2398 |
if ( retValue == KErrNone ) |
|
2399 |
{ |
|
2400 |
retValue = ssSettings.Set( ESSSettingsAls, newLine ); |
|
2401 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2402 |
"CPhoneState::ChangeAlsLineL : Set %d", retValue ); |
|
2403 |
ssSettings.Close(); |
|
2404 |
} |
|
2405 |
} |
|
2406 |
||
2407 |
// --------------------------------------------------------- |
|
2408 |
// CPhoneState::GetActiveCallIdL() |
|
2409 |
// --------------------------------------------------------- |
|
2410 |
// |
|
2411 |
TInt CPhoneState::GetActiveCallIdL() |
|
2412 |
{ |
|
2413 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetActiveCallId()( ) "); |
|
2414 |
||
2415 |
// Fetch active call's id from view |
|
2416 |
TPhoneViewResponseId response; |
|
2417 |
TPhoneCmdParamCallStateData callStateData; |
|
2418 |
callStateData.SetCallState( EPEStateConnected ); |
|
2419 |
response = iViewCommandHandle->HandleCommandL( |
|
2420 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
2421 |
||
2422 |
if ( response == EPhoneViewResponseSuccess && |
|
2423 |
callStateData.CallId() < 0 ) // no connected calls |
|
2424 |
{ |
|
2425 |
// check for held call |
|
2426 |
callStateData.SetCallState( EPEStateHeld ); |
|
2427 |
response = iViewCommandHandle->HandleCommandL( |
|
2428 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
2429 |
} |
|
2430 |
||
2431 |
return callStateData.CallId(); |
|
2432 |
} |
|
2433 |
||
2434 |
// --------------------------------------------------------- |
|
2435 |
// CPhoneState::SimState() |
|
2436 |
// --------------------------------------------------------- |
|
2437 |
// |
|
2438 |
EXPORT_C TPESimState CPhoneState::SimState() const |
|
2439 |
{ |
|
2440 |
||
2441 |
/* |
|
2442 |
SIM states: |
|
2443 |
||
2444 |
EPESimStatusUninitialized = KPEStartupEnumerationFirstValue =100, |
|
2445 |
EPESimUsable, // The Sim card is fully usable. |
|
2446 |
EPESimReadable, // The SIM card is not fully usable, but the emergency number can be read. |
|
2447 |
EPESimNotReady, // The Sim card is present but not ready or usable. |
|
2448 |
EPESimNotPresent, // The Sim card is not present. |
|
2449 |
EPESimNotSupported // SIM/RUIM is not supported. Some CDMA phones do not support a SIM/RUIM at all. |
|
2450 |
*/ |
|
2451 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimState()"); |
|
2452 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
2453 |
Panic( EPhoneCtrlInvariant ) ); |
|
2454 |
TPESimState simState = iStateMachine->PhoneEngineInfo()->SimState(); |
|
2455 |
||
2456 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2457 |
"CPhoneState::SimState - value= %d", simState ); |
|
2458 |
return simState; |
|
2459 |
} |
|
2460 |
||
2461 |
// --------------------------------------------------------- |
|
2462 |
// CPhoneState::IsSimOk() |
|
2463 |
// --------------------------------------------------------- |
|
2464 |
// |
|
2465 |
EXPORT_C TBool CPhoneState::IsSimOk() |
|
2466 |
{ |
|
2467 |
||
2468 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsSimOk()"); |
|
2469 |
// Phone is interested on Sim state and sim security statuses |
|
2470 |
// Check first Sim state status: |
|
2471 |
TBool retVal( ETrue ); |
|
2472 |
switch ( SimState() ) |
|
2473 |
{ |
|
2474 |
case EPESimNotSupported: |
|
2475 |
retVal = EFalse; |
|
2476 |
break; |
|
2477 |
||
2478 |
case EPESimNotPresent: |
|
2479 |
{ |
|
2480 |
if ( !FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) || |
|
2481 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) |
|
2482 |
{ |
|
2483 |
retVal = EFalse; |
|
2484 |
} |
|
2485 |
break; |
|
2486 |
} |
|
2487 |
||
2488 |
default: |
|
2489 |
break; |
|
2490 |
} |
|
2491 |
if ( retVal != EFalse ) |
|
2492 |
{ |
|
2493 |
// Sim state is valid, check also Sim security status |
|
2494 |
switch ( SimSecurityStatus() ) |
|
2495 |
{ |
|
2496 |
case ESimRejected: |
|
2497 |
case ESimUnaccepted: |
|
2498 |
retVal = EFalse; |
|
2499 |
break; |
|
2500 |
||
2501 |
default: |
|
2502 |
break; |
|
2503 |
} |
|
2504 |
} |
|
2505 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2506 |
"CPhoneState::IsSimOK - value= %d", retVal ); |
|
2507 |
return retVal; |
|
2508 |
} |
|
2509 |
||
2510 |
// ----------------------------------------------------------- |
|
2511 |
// CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled |
|
2512 |
// ----------------------------------------------------------- |
|
2513 |
// |
|
2514 |
EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled() |
|
2515 |
{ |
|
2516 |
TPhoneCmdParamBoolean isSecurityMode; |
|
2517 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ) ); |
|
2518 |
if ( SimState() == EPESimNotPresent && isSecurityMode.Boolean() ) |
|
2519 |
{ |
|
2520 |
return ETrue; |
|
2521 |
} |
|
2522 |
else |
|
2523 |
{ |
|
2524 |
return EFalse; |
|
2525 |
} |
|
2526 |
} |
|
2527 |
||
2528 |
// --------------------------------------------------------- |
|
2529 |
// CPhoneState::SetDivertIndication |
|
2530 |
// --------------------------------------------------------- |
|
2531 |
// |
|
2532 |
EXPORT_C void CPhoneState::SetDivertIndication( const TBool aDivertIndication ) |
|
2533 |
{ |
|
2534 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetDivertIndication()"); |
|
2535 |
TRAP_IGNORE( CallheaderManagerL()->SetDivertIndication( aDivertIndication ) ); |
|
2536 |
} |
|
2537 |
||
2538 |
// --------------------------------------------------------- |
|
2539 |
// CPhoneState::StartAlsLineChangeTimerL |
|
2540 |
// --------------------------------------------------------- |
|
2541 |
// |
|
2542 |
EXPORT_C void CPhoneState::StartAlsLineChangeTimerL() |
|
2543 |
{ |
|
2544 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartAlsLineChangeTimerL()"); |
|
2545 |
TBool alsLineAvailable = iStateMachine->PhoneEngineInfo()->ALSLineSupport(); |
|
2546 |
||
2547 |
if( alsLineAvailable ) |
|
2548 |
{ |
|
2549 |
if( !iAlsLineChangeKeyPressTimer ) |
|
2550 |
{ |
|
2551 |
iAlsLineChangeKeyPressTimer = CPhoneTimer::NewL(); |
|
2552 |
} |
|
2553 |
||
2554 |
iAlsLineChangeKeyPressTimer->After( KAlsLineChangeTimerValue, |
|
2555 |
TCallBack( AlsLineChangeTimerCallbackL, this ) ); |
|
2556 |
} |
|
2557 |
else |
|
2558 |
{ |
|
2559 |
// Don't bother launching the timer. ALS not supported. |
|
2560 |
__PHONELOG( EBasic, EPhoneControl, |
|
2561 |
"CPhoneState::StartAlsLineChangeTimerL - ALS not supported " ); |
|
2562 |
} |
|
2563 |
} |
|
2564 |
||
2565 |
// ----------------------------------------------------------------------------- |
|
2566 |
// CPhoneState::StartShowSecurityNoteL |
|
2567 |
// ----------------------------------------------------------------------------- |
|
2568 |
// |
|
2569 |
EXPORT_C void CPhoneState::StartShowSecurityNoteL() |
|
2570 |
{ |
|
2571 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL "); |
|
2572 |
||
2573 |
// Set security mode on. |
|
2574 |
TPhoneCmdParamBoolean securityMode; |
|
2575 |
securityMode.SetBoolean( ETrue ); |
|
2576 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode ); |
|
2577 |
||
2578 |
// Remove number entry from screen |
|
2579 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
2580 |
||
2581 |
iCbaManager->UpdateCbaL( EPhoneEmptyCBA ); |
|
2582 |
||
2583 |
TPhoneCmdParamInteger uidParam; |
|
2584 |
// Bring Phone app in the foreground |
|
2585 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
2586 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
2587 |
&uidParam ); |
|
2588 |
||
2589 |
// Set Phone as the top application |
|
2590 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
2591 |
&uidParam ); |
|
2592 |
||
2593 |
TInt resourceId ( KErrNone ); |
|
2594 |
||
2595 |
if ( SimSecurityStatus() == ESimRejected ) |
|
2596 |
{ |
|
2597 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
2598 |
ResolveResourceID( EPhoneSimRejected ); |
|
2599 |
} |
|
2600 |
else if ( SimState() == EPESimNotPresent ) |
|
2601 |
{ |
|
2602 |
// insert sim card -note |
|
2603 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
2604 |
ResolveResourceID( EPhoneSimRemoved ); |
|
2605 |
} |
|
2606 |
else if ( SimSecurityStatus() == ESimUnaccepted ) |
|
2607 |
{ |
|
2608 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
2609 |
ResolveResourceID( EPhoneSimUnaccepted ); |
|
2610 |
} |
|
2611 |
||
2612 |
if ( resourceId != KErrNone ) |
|
2613 |
{ |
|
2614 |
// Add it to the resource string |
|
2615 |
HBufC* buf = StringLoader::LoadLC( resourceId ); |
|
2616 |
||
2617 |
TPhoneCmdParamNote noteParam; |
|
2618 |
||
2619 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2620 |
ResolveResourceID( EPhoneSecurityInformationNote ) ); |
|
2621 |
||
2622 |
noteParam.SetText( *buf ); |
|
2623 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
2624 |
noteParam.SetType( EPhoneNoteSecurity ); |
|
2625 |
// Display note |
|
2626 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
2627 |
||
2628 |
CleanupStack::PopAndDestroy( buf ); |
|
2629 |
||
2630 |
||
2631 |
// Capture the App key |
|
2632 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
2633 |
appKeyCaptureParam.SetKey( EStdKeyApplication0 ); |
|
2634 |
appKeyCaptureParam.SetKeyCode( EKeyApplication0 ); |
|
2635 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
2636 |
iViewCommandHandle->ExecuteCommandL( |
|
2637 |
EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
|
2638 |
} |
|
2639 |
} |
|
2640 |
||
2641 |
// --------------------------------------------------------- |
|
2642 |
// CPhoneState::AlsLineChangeTimerCallbackL |
|
2643 |
// --------------------------------------------------------- |
|
2644 |
// |
|
2645 |
TInt CPhoneState::AlsLineChangeTimerCallbackL( TAny* aAny ) |
|
2646 |
{ |
|
2647 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::AlsLineChangeTimerCallbackL()"); |
|
2648 |
||
2649 |
// Send a key up event for stopping keypad tone |
|
2650 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
2651 |
iStateMachine->SendPhoneEngineMessage( |
|
2652 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
2653 |
||
2654 |
if ( !( reinterpret_cast<CPhoneState*>( aAny )-> |
|
2655 |
IsOnScreenDialerSupported() ) ) |
|
2656 |
{ |
|
2657 |
// If dialer is undefined remove the number entry. |
|
2658 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
2659 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
2660 |
} |
|
2661 |
else |
|
2662 |
{ |
|
2663 |
// If on screen dialer is in use just clear entry |
|
2664 |
// do not remove dialer. |
|
2665 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
2666 |
NumberEntryClearL(); |
|
2667 |
} |
|
2668 |
||
2669 |
// Show the als line changing confirmation query |
|
2670 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
2671 |
ShowQueryL( EPhoneAlsLineChangeConfirmationQuery ); |
|
2672 |
||
2673 |
return KErrNone; |
|
2674 |
} |
|
2675 |
||
2676 |
// --------------------------------------------------------- |
|
2677 |
// CPhoneState::ShowWlanMacAddressL |
|
2678 |
// --------------------------------------------------------- |
|
2679 |
// |
|
2680 |
void CPhoneState::ShowWlanMacAddressL() |
|
2681 |
{ |
|
2682 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ShowWlanMacAddressL()"); |
|
2683 |
if ( IsOnScreenDialerSupported() ) |
|
2684 |
{ |
|
2685 |
NumberEntryClearL(); |
|
2686 |
} |
|
2687 |
else |
|
2688 |
{ |
|
2689 |
// Remove number entry from screen |
|
2690 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
2691 |
} |
|
2692 |
||
2693 |
// Fetch WLAN MAC address |
|
2694 |
TBuf8<KPhoneWlanMacAddressLength> address; |
|
2695 |
RProperty::Get( |
|
2696 |
KPSUidWlan, |
|
2697 |
KPSWlanMacAddress, |
|
2698 |
address ); |
|
2699 |
||
2700 |
// Format fetched address |
|
2701 |
TBuf<KPhoneWlanMacAddressLength> wlanMACAddress; |
|
2702 |
for ( TInt i( 0 ); i < address.Length(); i++ ) |
|
2703 |
{ |
|
2704 |
// Set separator |
|
2705 |
if( i > 0 ) |
|
2706 |
{ |
|
2707 |
wlanMACAddress.Append( KPhoneWlanSeparator ); |
|
2708 |
} |
|
2709 |
// Set data |
|
2710 |
TBuf<10> tmp; |
|
2711 |
tmp.Format( KWLanMACDataFormat, address[i] ); |
|
2712 |
wlanMACAddress.Append( tmp ); |
|
2713 |
} |
|
2714 |
||
2715 |
// Now we need the localised text |
|
2716 |
HBufC* wlanMacAddress = StringLoader::LoadLC( |
|
2717 |
CPhoneMainResourceResolver::Instance()-> |
|
2718 |
ResolveResourceID( EPhoneWlanMacAddress ), wlanMACAddress ); |
|
2719 |
||
2720 |
TPhoneCmdParamNote noteParam; |
|
2721 |
noteParam.SetType( EPhoneNoteCustom ); |
|
2722 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2723 |
ResolveResourceID( EPhoneInformationWaitNote ) ); |
|
2724 |
noteParam.SetText( *wlanMacAddress ); |
|
2725 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
2726 |
||
2727 |
// Display note |
|
2728 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
2729 |
||
2730 |
CleanupStack::PopAndDestroy( wlanMacAddress ); |
|
2731 |
} |
|
2732 |
||
2733 |
// ----------------------------------------------------------- |
|
2734 |
// CPhoneState::HandleAudioAvailableOutputChangedL |
|
2735 |
// Default handling for EPEMessageAvailableAudioOutputsChanged message |
|
2736 |
// (other items were commented in a header). |
|
2737 |
// ----------------------------------------------------------- |
|
2738 |
// |
|
2739 |
void CPhoneState::HandleAudioAvailableOutputChangedL() |
|
2740 |
{ |
|
2741 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioAvailableOutputChangedL() "); |
|
2742 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
2743 |
Panic( EPhoneCtrlInvariant ) ); |
|
2744 |
||
2745 |
TPhoneCmdParamAudioAvailability outputParam; |
|
2746 |
||
2747 |
// Output |
|
2748 |
const TPEAudioOutput audioOutput = |
|
2749 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
|
2750 |
||
2751 |
// BT availability |
|
2752 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
2753 |
EPEBTAudioAccessory ); |
|
2754 |
outputParam.SetBTAccAvailable( btAvailable ); |
|
2755 |
||
2756 |
// Wired availability |
|
2757 |
TBool wiredAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
2758 |
EPEWiredAudioAccessory ); |
|
2759 |
outputParam.SetWiredAccAvailable( wiredAvailable ); |
|
2760 |
||
2761 |
// BTA disconnect handler check |
|
2762 |
if( btAvailable ) |
|
2763 |
{ |
|
2764 |
CPhoneBtaaDisconnectHandler::InstanceL()->Cancel(); |
|
2765 |
} |
|
2766 |
||
2767 |
// view update |
|
2768 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioAvailabilityUIChanges, |
|
2769 |
&outputParam ); |
|
2770 |
} |
|
2771 |
||
2772 |
||
2773 |
// --------------------------------------------------------- |
|
2774 |
// CPhoneState::IsAlsLineChangePossible |
|
2775 |
// --------------------------------------------------------- |
|
2776 |
// |
|
2777 |
TBool CPhoneState::IsAlsLineChangePossible() |
|
2778 |
{ |
|
2779 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAlsLineChangePossible( ) "); |
|
2780 |
||
2781 |
TBool isAlsLineChangePossible( ETrue ); |
|
2782 |
TSSSettingsAlsBlockingValue AlsBlockingValue( ESSSettingsAlsBlockingNotSupported ); |
|
2783 |
TInt value( 0 ); |
|
2784 |
||
2785 |
RSSSettings ssSettings; |
|
2786 |
TInt retValue = ssSettings.Open(); |
|
2787 |
||
2788 |
if ( retValue == KErrNone ) |
|
2789 |
{ |
|
2790 |
ssSettings.Get( ESSSettingsAlsBlocking, value ); |
|
2791 |
ssSettings.Close(); |
|
2792 |
||
2793 |
AlsBlockingValue = static_cast< TSSSettingsAlsBlockingValue > ( value ); |
|
2794 |
||
2795 |
if( AlsBlockingValue == ESSSettingsAlsAlternate ) |
|
2796 |
{ |
|
2797 |
isAlsLineChangePossible = EFalse; |
|
2798 |
} |
|
2799 |
} |
|
2800 |
||
2801 |
return isAlsLineChangePossible; |
|
2802 |
} |
|
2803 |
||
2804 |
// --------------------------------------------------------- |
|
2805 |
// CPhoneState::ShowNumberBusyNoteL |
|
2806 |
// --------------------------------------------------------- |
|
2807 |
// |
|
2808 |
EXPORT_C void CPhoneState::ShowNumberBusyNoteL() |
|
2809 |
{ |
|
2810 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNumberBusyNoteL( ) "); |
|
2811 |
// Re-enable global notes |
|
2812 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2813 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2814 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2815 |
&globalNotifierParam ); |
|
2816 |
||
2817 |
TInt resource( EPhoneNumberBusy ); |
|
2818 |
||
2819 |
if( iCustomization ) |
|
2820 |
{ |
|
2821 |
// Get customized text resource for busy note |
|
2822 |
resource = iCustomization->CustomizeBusyNoteText(); |
|
2823 |
} |
|
2824 |
||
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2825 |
// Show number busy notification |
37 | 2826 |
TPhoneCmdParamGlobalNote globalNoteParam; |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2827 |
globalNoteParam.SetType( EPhoneNotificationDialog ); |
37 | 2828 |
globalNoteParam.SetTextResourceId( |
2829 |
CPhoneMainResourceResolver::Instance()-> |
|
2830 |
ResolveResourceID( resource ) ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
2831 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2832 |
globalNoteParam.SetNotificationDialog( ETrue ); |
37 | 2833 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowGlobalNote, |
2834 |
&globalNoteParam ); |
|
2835 |
} |
|
2836 |
||
2837 |
// --------------------------------------------------------- |
|
2838 |
// CPhoneState::IsAutoLockOn |
|
2839 |
// --------------------------------------------------------- |
|
2840 |
// |
|
2841 |
EXPORT_C TBool CPhoneState::IsAutoLockOn() const |
|
2842 |
{ |
|
2843 |
// Check if phone is locked |
|
2844 |
const TBool phoneIsLocked = |
|
2845 |
CPhonePubSubProxy::Instance()->Value( |
|
2846 |
KPSUidCoreApplicationUIs, |
|
2847 |
KCoreAppUIsAutolockStatus ) > EAutolockOff; |
|
2848 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2849 |
__PHONELOG1( EBasic, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2850 |
EPhoneControl, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2851 |
"CPhoneState::IsAutoLockOn() Status: %d", |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2852 |
phoneIsLocked ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2853 |
|
37 | 2854 |
return phoneIsLocked; |
2855 |
} |
|
2856 |
||
2857 |
// --------------------------------------------------------- |
|
2858 |
// CPhoneState::IsKeyLockOn |
|
2859 |
// --------------------------------------------------------- |
|
2860 |
// |
|
2861 |
EXPORT_C TBool CPhoneState::IsKeyLockOn() const |
|
2862 |
{ |
|
2863 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsKeyLockOn( ) "); |
|
2864 |
TPhoneCmdParamBoolean keyLockStatus; |
|
2865 |
keyLockStatus.SetBoolean( EFalse ); |
|
2866 |
||
2867 |
iViewCommandHandle->ExecuteCommand( |
|
2868 |
EPhoneViewGetKeyLockStatus, |
|
2869 |
&keyLockStatus ); |
|
2870 |
||
2871 |
__PHONELOG1( EBasic, |
|
2872 |
EPhoneControl, |
|
2873 |
"CPhoneState::IsKeyLockOn() Lock Status: %d", |
|
2874 |
keyLockStatus.Boolean() ); |
|
2875 |
return keyLockStatus.Boolean(); |
|
2876 |
} |
|
2877 |
||
2878 |
// --------------------------------------------------------- |
|
2879 |
// CPhoneState::CompleteSatRequestL |
|
2880 |
// --------------------------------------------------------- |
|
2881 |
// |
|
2882 |
EXPORT_C void CPhoneState::CompleteSatRequestL( const TInt aCallId ) |
|
2883 |
{ |
|
2884 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CompleteSatRequestL( ) "); |
|
2885 |
iStateMachine->SetCallId( aCallId ); |
|
2886 |
iStateMachine->SendPhoneEngineMessage( |
|
2887 |
MPEPhoneModel::EPEMessageSatCallRequestCompleted ); |
|
2888 |
} |
|
2889 |
||
2890 |
// --------------------------------------------------------- |
|
2891 |
// CPhoneState::SetTouchPaneButtons |
|
2892 |
// --------------------------------------------------------- |
|
2893 |
// |
|
2894 |
EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ ) |
|
2895 |
{ |
|
2896 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
2897 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2898 |
TPhoneCmdParamBoolean muteParam; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2899 |
muteParam.SetBoolean( iStateMachine->PhoneEngineInfo()->AudioMute() ); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2900 |
iViewCommandHandle->ExecuteCommand(EPhoneViewSetMuteFlag,&muteParam); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2901 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2902 |
const TPEAudioOutput audioOutput = |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2903 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2904 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2905 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2906 |
EPEBTAudioAccessory ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2907 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2908 |
TPhoneCmdParamBoolean btParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2909 |
btParam.SetBoolean( audioOutput == EPEBTAudioAccessory ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2910 |
iViewCommandHandle->ExecuteCommand(EPhoneViewSetBlueToothFlag,&btParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2911 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2912 |
TPhoneCmdParamBoolean btAvailableParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2913 |
btAvailableParam.SetBoolean( btAvailable ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2914 |
iViewCommandHandle->ExecuteCommand( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2915 |
EPhoneViewSetBluetoothAvailableFlag,&btAvailableParam); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2916 |
|
37 | 2917 |
TBool emergency( EPEStateIdle != |
2918 |
iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) ); |
|
2919 |
TPhoneCmdParamBoolean booleanParam; |
|
2920 |
booleanParam.SetBoolean( emergency ); |
|
2921 |
||
2922 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
2923 |
EPhoneViewSetTouchPaneButtons, |
|
2924 |
&booleanParam ) ); |
|
2925 |
} |
|
2926 |
} |
|
2927 |
||
2928 |
// --------------------------------------------------------- |
|
2929 |
// CPhoneState::DeleteTouchPaneButtons |
|
2930 |
// --------------------------------------------------------- |
|
2931 |
// |
|
2932 |
EXPORT_C void CPhoneState::DeleteTouchPaneButtons() |
|
2933 |
{ |
|
2934 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
2935 |
{ |
|
2936 |
TPhoneCmdParamBoolean boolParam; |
|
2937 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
2938 |
EPhoneViewSetTouchPaneButtons, |
|
2939 |
&boolParam ) ); |
|
2940 |
} |
|
2941 |
} |
|
2942 |
||
2943 |
// --------------------------------------------------------- |
|
2944 |
// CPhoneState::HandleLongHashL |
|
2945 |
// --------------------------------------------------------- |
|
2946 |
// |
|
2947 |
EXPORT_C void CPhoneState::HandleLongHashL() |
|
2948 |
{ |
|
2949 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() "); |
|
2950 |
||
2951 |
} |
|
2952 |
||
2953 |
// ----------------------------------------------------------- |
|
2954 |
// CPhoneState::BeginUiUpdateLC |
|
2955 |
// ----------------------------------------------------------- |
|
2956 |
// |
|
2957 |
EXPORT_C void CPhoneState::BeginUiUpdateLC() |
|
2958 |
{ |
|
2959 |
||
2960 |
iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
|
2961 |
||
2962 |
TCleanupItem operation( UiUpdateCleanup, this ); |
|
2963 |
CleanupStack::PushL( operation ); |
|
2964 |
} |
|
2965 |
||
2966 |
// ----------------------------------------------------------- |
|
2967 |
// CPhoneState::EndUiUpdate |
|
2968 |
// ----------------------------------------------------------- |
|
2969 |
// |
|
2970 |
EXPORT_C void CPhoneState::EndUiUpdate() |
|
2971 |
{ |
|
2972 |
CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
|
2973 |
} |
|
2974 |
||
2975 |
// ----------------------------------------------------------- |
|
2976 |
// CPhoneState::CheckIfShowTerminationNote |
|
2977 |
// This method is intended to be overridden in states |
|
2978 |
// that contain more info about decision. |
|
2979 |
// ----------------------------------------------------------- |
|
2980 |
// |
|
2981 |
EXPORT_C TBool CPhoneState::CheckIfShowCallTerminationNote( ) |
|
2982 |
{ |
|
2983 |
TBool show = EFalse; |
|
2984 |
TInt callSummaryActivated = 0; |
|
2985 |
const TInt err = CPhoneCenRepProxy::Instance()->GetInt( |
|
2986 |
KCRUidCommonTelephonySettings, |
|
2987 |
KSettingsSummaryAfterCall, |
|
2988 |
callSummaryActivated ); |
|
2989 |
||
2990 |
if ( err == KErrNone && callSummaryActivated ) |
|
2991 |
{ |
|
2992 |
show = ETrue; |
|
2993 |
} |
|
2994 |
||
2995 |
return show; |
|
2996 |
} |
|
2997 |
||
2998 |
// ----------------------------------------------------------------------------- |
|
2999 |
// CPhoneState::HandleDtmfKeyTone |
|
3000 |
// Called from KeyEventForwarder |
|
3001 |
// Allow only special characters to pass from |
|
3002 |
// keyEventForwarder to phoneEngine |
|
3003 |
// ----------------------------------------------------------------------------- |
|
3004 |
// |
|
3005 |
||
3006 |
EXPORT_C void CPhoneState::HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent, |
|
3007 |
TEventCode aEventCode ) |
|
3008 |
{ |
|
3009 |
SendDtmfKeyEventL( aKeyEvent, aEventCode ); |
|
3010 |
} |
|
3011 |
||
3012 |
// ----------------------------------------------------------------------------- |
|
3013 |
// CPhoneState::UiUpdateCleanup |
|
3014 |
// ----------------------------------------------------------------------------- |
|
3015 |
// |
|
3016 |
void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
|
3017 |
{ |
|
3018 |
static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3019 |
EPhoneViewEndUpdate ); |
|
3020 |
} |
|
3021 |
||
3022 |
// ----------------------------------------------------------- |
|
3023 |
// CPhoneState::SetDefaultFlagsL() |
|
3024 |
// ----------------------------------------------------------- |
|
3025 |
// |
|
3026 |
EXPORT_C void CPhoneState::SetDefaultFlagsL() |
|
3027 |
{ |
|
3028 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetDefaultFlagsL()"); |
|
3029 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
3030 |
||
3031 |
// Reset Hold flag to view |
|
3032 |
TPhoneCmdParamBoolean holdFlag; |
|
3033 |
holdFlag.SetBoolean( EFalse ); |
|
3034 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
3035 |
||
3036 |
// Update FSW |
|
3037 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
3038 |
||
3039 |
// Re-enable global notes |
|
3040 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
3041 |
globalNotifierParam.SetBoolean( EFalse ); |
|
3042 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
3043 |
&globalNotifierParam ); |
|
3044 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
3045 |
&globalNotifierParam ); |
|
3046 |
||
3047 |
// uncapture App and Camera keys if not security mode |
|
3048 |
TPhoneCmdParamBoolean isSecurityMode; |
|
3049 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
3050 |
if ( !isSecurityMode.Boolean() ) |
|
3051 |
{ |
|
3052 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
3053 |
} |
|
3054 |
||
3055 |
// Restore keylock if phone has been locked before call. |
|
3056 |
if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
3057 |
{ |
|
3058 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock ); |
|
3059 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
3060 |
} |
|
3061 |
} |
|
3062 |
||
3063 |
// ----------------------------------------------------------- |
|
3064 |
// CPhoneState::GetVolumeLevel |
|
3065 |
// ----------------------------------------------------------- |
|
3066 |
// |
|
3067 |
TInt CPhoneState::GetVolumeLevel() |
|
3068 |
{ |
|
3069 |
TPhoneCmdParamInteger integerParam; |
|
3070 |
||
3071 |
iViewCommandHandle->ExecuteCommand( EPhoneViewGetAudioVolumeLevel, |
|
3072 |
&integerParam ); |
|
3073 |
return integerParam.Integer(); |
|
3074 |
} |
|
3075 |
||
3076 |
// ----------------------------------------------------------- |
|
3077 |
// CPhoneState::ShowVideoCallOutOfMemoryNoteL |
|
3078 |
// ----------------------------------------------------------- |
|
3079 |
// |
|
3080 |
void CPhoneState::ShowVideoCallOutOfMemoryNoteL() |
|
3081 |
{ |
|
3082 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
3083 |
"CPhoneState::ShowVideoCallOutOfMemoryNoteL()" ); |
|
3084 |
||
3085 |
// Re-enable global notes |
|
3086 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
3087 |
globalNotifierParam.SetBoolean( EFalse ); |
|
3088 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
3089 |
&globalNotifierParam ); |
|
3090 |
||
3091 |
// Bring Phone app in the foreground |
|
3092 |
TPhoneCmdParamInteger uidParam; |
|
3093 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
3094 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
3095 |
&uidParam ); |
|
3096 |
||
3097 |
// Set Phone as the top application |
|
3098 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
3099 |
&uidParam ); |
|
3100 |
||
3101 |
// Display error note |
|
3102 |
SExtendedError ext; |
|
3103 |
ext.iComponent = KUidPhoneApplication; |
|
3104 |
ext.iErrorNumber = KErrNoMemory; |
|
3105 |
ext.iInformation = EFalse; |
|
3106 |
TBuf<1> ignore; |
|
3107 |
iAvkonAppUi->HandleError( KErrNoMemory, ext, ignore, ignore ); |
|
3108 |
} |
|
3109 |
||
3110 |
// ----------------------------------------------------------------------------- |
|
3111 |
// CPhoneState::SimSecurityStatus |
|
3112 |
// ----------------------------------------------------------------------------- |
|
3113 |
// |
|
3114 |
TInt CPhoneState::SimSecurityStatus() const |
|
3115 |
{ |
|
3116 |
/* |
|
3117 |
Sim security statuses: |
|
3118 |
||
3119 |
ESimSecurityStatusUninitialized = KStartupEnumerationFirstValue, |
|
3120 |
ESimRejected, // The PUK code has been entered incorrectly, so the card is rejected. |
|
3121 |
ESimUnaccepted // The SIM lock is on, so the card is unaccepted. |
|
3122 |
*/ |
|
3123 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimSecurityStatus()" ); |
|
3124 |
return CPhonePubSubProxy::Instance()->Value( |
|
3125 |
KPSUidStartup, KStartupSimSecurityStatus ); |
|
3126 |
} |
|
3127 |
||
3128 |
// ----------------------------------------------------------------------------- |
|
3129 |
// CPhoneState::CallWaitingNoteL |
|
3130 |
// ----------------------------------------------------------------------------- |
|
3131 |
// |
|
3132 |
EXPORT_C void CPhoneState::CallWaitingNoteL( TInt aCallId ) |
|
3133 |
{ |
|
3134 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallWaitingNoteL()" ); |
|
3135 |
||
3136 |
TBuf< KPhoneContactNameMaxLength > callText( KNullDesC ); |
|
3137 |
||
3138 |
// Set CLI text for the call header |
|
3139 |
const TBool contactInfoAvailable = |
|
3140 |
iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() || |
|
3141 |
iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length(); |
|
3142 |
||
3143 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3144 |
"CPhoneState::CallWaitingNoteL - contactInfoAvailable(%d)", contactInfoAvailable ); |
|
3145 |
||
3146 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3147 |
"CPhoneState::CallWaitingNoteL - remote name(%S)", |
|
3148 |
&iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) ); |
|
3149 |
||
3150 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3151 |
"CPhoneState::CallWaitingNoteL - company name(%S)", |
|
3152 |
&iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) ); |
|
3153 |
||
3154 |
if ( contactInfoAvailable ) |
|
3155 |
{ |
|
3156 |
// Set Call Text flag to waiting note |
|
3157 |
callText = iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ); |
|
3158 |
||
3159 |
// if no remote name available then set company name |
|
3160 |
if ( callText == KNullDesC ) |
|
3161 |
{ |
|
3162 |
callText = iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ); |
|
3163 |
} |
|
3164 |
||
3165 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
3166 |
globalNoteParam.SetText( callText ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3167 |
globalNoteParam.SetType( EPhoneNotificationDialog ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3168 |
|
37 | 3169 |
globalNoteParam.SetTextResourceId( |
3170 |
CPhoneMainResourceResolver::Instance()-> |
|
3171 |
ResolveResourceID( EPhoneCallWaitingWithLabel ) ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3172 |
globalNoteParam.SetNotificationDialog( ETrue ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3173 |
|
37 | 3174 |
iViewCommandHandle->ExecuteCommandL( |
3175 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
3176 |
} |
|
3177 |
else |
|
3178 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3179 |
SendGlobalInfoNoteL( EPhoneCallWaitingWithoutLabel, ETrue ); |
37 | 3180 |
} |
3181 |
} |
|
3182 |
||
3183 |
// ---------------------------------------------------------------------------- |
|
3184 |
// CPhoneState::SetRingingTonePlaybackL() |
|
3185 |
// ---------------------------------------------------------------------------- |
|
3186 |
// |
|
3187 |
EXPORT_C void CPhoneState::SetRingingTonePlaybackL( TInt aCallId ) |
|
3188 |
{ |
|
3189 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
3190 |
"CPhoneState::SetRingingTonePlaybackL()" ); |
|
3191 |
||
3192 |
TPhoneCmdParamRingTone ringToneParam; |
|
3193 |
ringToneParam.SetVolume( |
|
3194 |
iStateMachine->PhoneEngineInfo()->RingingVolume() ); |
|
3195 |
||
3196 |
TArray< TContactItemId > alertGroups = |
|
3197 |
iStateMachine->PhoneEngineInfo()->AlertForGroup(); |
|
3198 |
||
3199 |
TInt alertGroupCount = alertGroups.Count(); |
|
3200 |
TInt contactGroupCount = |
|
3201 |
iStateMachine->PhoneEngineInfo()->ContactGroups( aCallId ).Count(); |
|
3202 |
TBool alertingGroupFound( EFalse ); |
|
3203 |
||
3204 |
// Check contents of both the alerting groups array and call contact group |
|
3205 |
// array, if any of the group ids match then allow playing. |
|
3206 |
if ( alertGroupCount > 0 ) |
|
3207 |
{ |
|
3208 |
for ( TInt i = 0 ; i < alertGroupCount ; i++ ) |
|
3209 |
{ |
|
3210 |
for ( TInt j = 0 ; j < contactGroupCount ; j++ ) |
|
3211 |
{ |
|
3212 |
if ( alertGroups[ i ] == |
|
3213 |
( iStateMachine->PhoneEngineInfo()->ContactGroups( |
|
3214 |
aCallId ) )[ j ] ) |
|
3215 |
{ |
|
3216 |
alertingGroupFound = ETrue; |
|
3217 |
} |
|
3218 |
} |
|
3219 |
} |
|
3220 |
if ( alertingGroupFound == EFalse ) |
|
3221 |
{ |
|
3222 |
ringToneParam.SetRingingType( EProfileRingingTypeSilent ); |
|
3223 |
} |
|
3224 |
else |
|
3225 |
{ |
|
3226 |
ringToneParam.SetRingingType( |
|
3227 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
3228 |
} |
|
3229 |
} |
|
3230 |
else // no alerting groups set |
|
3231 |
{ |
|
3232 |
ringToneParam.SetRingingType( |
|
3233 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
3234 |
} |
|
3235 |
||
3236 |
// Set ring tone |
|
3237 |
if ( iStateMachine->PhoneEngineInfo()->PersonalRingingTone( |
|
3238 |
aCallId ).Length() ) |
|
3239 |
{ |
|
3240 |
// Set the personal ring tone |
|
3241 |
ringToneParam.SetRingTone( |
|
3242 |
iStateMachine->PhoneEngineInfo()->PersonalRingingTone( aCallId ) ); |
|
3243 |
ringToneParam.SetType( EPhoneRingTonePersonal ); |
|
3244 |
} |
|
3245 |
else if ( iStateMachine->PhoneEngineInfo()->RingingTone( |
|
3246 |
aCallId ).Length() ) |
|
3247 |
{ |
|
3248 |
// Set the profile ring tone |
|
3249 |
ringToneParam.SetRingTone( |
|
3250 |
iStateMachine->PhoneEngineInfo()->RingingTone( aCallId ) ); |
|
3251 |
ringToneParam.SetType( EPhoneRingToneProfile ); |
|
3252 |
||
3253 |
if ( ( iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 && |
|
3254 |
BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), |
|
3255 |
iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ) ) ) || |
|
3256 |
iStateMachine->PhoneEngineInfo()->HasCallerThumbnail( aCallId ) ) |
|
3257 |
{ |
|
3258 |
// Caller image set |
|
3259 |
ringToneParam.SetCallerImageStatus( ETrue ); |
|
3260 |
} |
|
3261 |
} |
|
3262 |
||
3263 |
// Set text to say, if enabled |
|
3264 |
if ( iStateMachine->PhoneEngineInfo()->TextToSpeech() ) |
|
3265 |
{ |
|
3266 |
ringToneParam.SetTextToSay( |
|
3267 |
iStateMachine->PhoneEngineInfo()->RemoteTextToSpeechText( |
|
3268 |
aCallId ) ); |
|
3269 |
} |
|
3270 |
||
3271 |
if ( iStateMachine->PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 ) |
|
3272 |
{ |
|
3273 |
ringToneParam.SetCallerTextStatus( ETrue ); |
|
3274 |
} |
|
3275 |
||
3276 |
// Play the ring tone |
|
3277 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewPlayRingTone, &ringToneParam ); |
|
3278 |
} |
|
3279 |
||
3280 |
// ----------------------------------------------------------- |
|
3281 |
// CPhoneState::HandleCugNoteL |
|
3282 |
// ----------------------------------------------------------- |
|
3283 |
// |
|
3284 |
void CPhoneState::HandleCugInUseNoteL() |
|
3285 |
{ |
|
3286 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCugInUseNoteL() "); |
|
3287 |
||
3288 |
TInt cugIndex( 0 ); |
|
3289 |
||
3290 |
RSSSettings ssSettings; |
|
3291 |
TInt retValue = ssSettings.Open(); |
|
3292 |
||
3293 |
if ( retValue == KErrNone ) |
|
3294 |
{ |
|
3295 |
ssSettings.Get( ESSSettingsCug, cugIndex ); |
|
3296 |
} |
|
3297 |
ssSettings.Close(); |
|
3298 |
||
3299 |
if ( cugIndex ) |
|
3300 |
{ |
|
3301 |
// Add it to the resource string |
|
3302 |
HBufC* buf = StringLoader::LoadLC( |
|
3303 |
CPhoneMainResourceResolver::Instance()-> |
|
3304 |
ResolveResourceID( |
|
3305 |
EPhoneInfoCugInUse ), cugIndex ); |
|
3306 |
||
3307 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
3308 |
globalNoteParam.SetText( *buf ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3309 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3310 |
|
37 | 3311 |
iViewCommandHandle->ExecuteCommandL( |
3312 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
3313 |
||
3314 |
CleanupStack::PopAndDestroy( buf ); |
|
3315 |
} |
|
3316 |
} |
|
3317 |
||
3318 |
// ----------------------------------------------------------- |
|
3319 |
// CPhoneState::CallheaderManagerL |
|
3320 |
// ----------------------------------------------------------- |
|
3321 |
// |
|
3322 |
CPhoneCallHeaderManager* CPhoneState::CallheaderManagerL() |
|
3323 |
{ |
|
3324 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::CallheaderManagerL() "); |
|
3325 |
if ( !iCallHeaderManager ) |
|
3326 |
{ |
|
3327 |
iCallHeaderManager = CPhoneCallHeaderManager::NewL( |
|
3328 |
*iViewCommandHandle, |
|
3329 |
*iStateMachine, |
|
3330 |
iCustomization ); |
|
3331 |
} |
|
3332 |
return iCallHeaderManager; |
|
3333 |
} |
|
3334 |
||
3335 |
// ----------------------------------------------------------- |
|
3336 |
// CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer |
|
3337 |
// ----------------------------------------------------------- |
|
3338 |
// |
|
3339 |
EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer() |
|
3340 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3341 |
|
37 | 3342 |
} |
3343 |
||
3344 |
// ----------------------------------------------------------- |
|
3345 |
// CPhoneState::IsOnScreenDialerSupported |
|
3346 |
// ----------------------------------------------------------- |
|
3347 |
// |
|
3348 |
EXPORT_C TBool CPhoneState::IsOnScreenDialerSupported() const |
|
3349 |
{ |
|
3350 |
return iOnScreenDialer; |
|
3351 |
} |
|
3352 |
||
3353 |
// --------------------------------------------------------------------------- |
|
3354 |
// CPhoneState::LoadResource |
|
3355 |
// --------------------------------------------------------------------------- |
|
3356 |
// |
|
3357 |
void CPhoneState::LoadResource( TDes& aData, const TInt aResource ) const |
|
3358 |
{ |
|
3359 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() "); |
|
3360 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource ); |
|
3361 |
StringLoader::Load( aData, |
|
3362 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), |
|
3363 |
&iEnv ); |
|
3364 |
} |
|
3365 |
||
3366 |
// ----------------------------------------------------------- |
|
3367 |
// CPhoneState::IsAnyConnectedCalls |
|
3368 |
// ----------------------------------------------------------- |
|
3369 |
// |
|
3370 |
TBool CPhoneState::IsAnyConnectedCalls() |
|
3371 |
{ |
|
3372 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAnyConnectedCalls() "); |
|
3373 |
TBool connectedCall(EFalse); |
|
3374 |
if ( iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnected ) || |
|
3375 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnecting ) || |
|
3376 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnectedConference ) ) |
|
3377 |
{ |
|
3378 |
connectedCall = ETrue; |
|
3379 |
} |
|
3380 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyConnectedCalls: (%d)", connectedCall ); |
|
3381 |
return connectedCall; |
|
3382 |
} |
|
3383 |
||
3384 |
// ----------------------------------------------------------- |
|
3385 |
// CPhoneState::NumberEntryContentL |
|
3386 |
// ----------------------------------------------------------- |
|
3387 |
// |
|
3388 |
CPhoneNumberEntryManager* CPhoneState::NumberEntryManagerL() |
|
3389 |
{ |
|
3390 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::NumberEntryContentL() "); |
|
3391 |
if ( !iNumberEntryManager ) |
|
3392 |
{ |
|
3393 |
iNumberEntryManager = CPhoneNumberEntryManager::NewL( |
|
3394 |
this, |
|
3395 |
*iViewCommandHandle, |
|
3396 |
*iStateMachine, |
|
3397 |
iCustomization, |
|
3398 |
*iCbaManager ); |
|
3399 |
} |
|
3400 |
return iNumberEntryManager; |
|
3401 |
} |
|
3402 |
||
3403 |
// ----------------------------------------------------------- |
|
3404 |
// CPhoneState::PhoneNumberFromEntryLC() |
|
3405 |
// ----------------------------------------------------------- |
|
3406 |
// |
|
3407 |
EXPORT_C HBufC* CPhoneState::PhoneNumberFromEntryLC() |
|
3408 |
{ |
|
3409 |
return NumberEntryManagerL()->PhoneNumberFromEntryLC(); |
|
3410 |
} |
|
3411 |
||
3412 |
// ----------------------------------------------------------- |
|
3413 |
// CPhoneState::IsNumberEntryUsedL |
|
3414 |
// ----------------------------------------------------------- |
|
3415 |
// |
|
3416 |
EXPORT_C TBool CPhoneState::IsNumberEntryUsedL() |
|
3417 |
{ |
|
3418 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryUsedL( ) "); |
|
3419 |
return NumberEntryManagerL()->IsNumberEntryUsedL(); |
|
3420 |
} |
|
3421 |
||
3422 |
// ----------------------------------------------------------- |
|
3423 |
// CPhoneState::IsNumberEntryVisibleL |
|
3424 |
// ----------------------------------------------------------- |
|
3425 |
// |
|
3426 |
EXPORT_C TBool CPhoneState::IsNumberEntryVisibleL() |
|
3427 |
{ |
|
3428 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryVisibleL( ) "); |
|
3429 |
return NumberEntryManagerL()->IsNumberEntryVisibleL(); |
|
3430 |
} |
|
3431 |
||
3432 |
// ----------------------------------------------------------- |
|
3433 |
// CPhoneState::HandleNumberEntryClearedL |
|
3434 |
// ----------------------------------------------------------- |
|
3435 |
// |
|
3436 |
EXPORT_C void CPhoneState::HandleNumberEntryClearedL() |
|
3437 |
{ |
|
3438 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumberEntryClearedL( ) "); |
|
3439 |
NumberEntryManagerL()->HandleNumberEntryClearedL(); |
|
3440 |
} |
|
3441 |
||
3442 |
// ----------------------------------------------------------- |
|
3443 |
// CPhoneState::SetNumberEntryVisibilityL |
|
3444 |
// ----------------------------------------------------------- |
|
3445 |
// |
|
3446 |
EXPORT_C void CPhoneState::SetNumberEntryVisibilityL( const TBool aVisible ) |
|
3447 |
{ |
|
3448 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetNumberEntryVisibilityL( ) "); |
|
3449 |
TPhoneCmdParamBoolean booleanParam; |
|
3450 |
booleanParam.SetBoolean( ETrue ); |
|
3451 |
if ( !aVisible ) |
|
3452 |
{ |
|
3453 |
booleanParam.SetBoolean( EFalse ); |
|
3454 |
} |
|
3455 |
NumberEntryManagerL()->SetNumberEntryVisibilityL( booleanParam ); |
|
3456 |
} |
|
3457 |
||
3458 |
// ----------------------------------------------------------- |
|
3459 |
// CPhoneState::IsNumberEntryContentStored |
|
3460 |
// ----------------------------------------------------------- |
|
3461 |
// |
|
3462 |
EXPORT_C TBool CPhoneState::IsNumberEntryContentStored() |
|
3463 |
{ |
|
3464 |
TBool isNumberEntryContentStored( EFalse ); |
|
3465 |
TRAP_IGNORE( isNumberEntryContentStored = NumberEntryManagerL()->IsNumberEntryContentStored() ); |
|
3466 |
return isNumberEntryContentStored; |
|
3467 |
} |
|
3468 |
||
3469 |
// ----------------------------------------------------------- |
|
3470 |
// CPhoneState::StoreNumberEntryContentL |
|
3471 |
// ----------------------------------------------------------- |
|
3472 |
// |
|
3473 |
EXPORT_C void CPhoneState::StoreNumberEntryContentL() |
|
3474 |
{ |
|
3475 |
NumberEntryManagerL()->StoreNumberEntryContentL(); |
|
3476 |
} |
|
3477 |
||
3478 |
// ----------------------------------------------------------- |
|
3479 |
// CPhoneState::ClearNumberEntryContentCache |
|
3480 |
// ----------------------------------------------------------- |
|
3481 |
// |
|
3482 |
EXPORT_C void CPhoneState::ClearNumberEntryContentCache() |
|
3483 |
{ |
|
3484 |
TRAP_IGNORE( NumberEntryManagerL()->ClearNumberEntryContentCache() ); |
|
3485 |
} |
|
3486 |
||
3487 |
// ----------------------------------------------------------------------------- |
|
3488 |
// CPhoneState::IsAlphanumericSupportedAndCharInput |
|
3489 |
// ----------------------------------------------------------------------------- |
|
3490 |
// |
|
3491 |
EXPORT_C TBool CPhoneState::IsAlphanumericSupportedAndCharInput( |
|
3492 |
const TKeyEvent& aKeyEvent ) |
|
3493 |
{ |
|
3494 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAlphanumericSupportedAndCharInput() "); |
|
3495 |
TBool alphaNumericSupport(EFalse); |
|
3496 |
TRAP_IGNORE( alphaNumericSupport = NumberEntryManagerL()->IsAlphanumericSupportedAndCharInput( aKeyEvent ) ); |
|
3497 |
return alphaNumericSupport; |
|
3498 |
} |
|
3499 |
||
3500 |
// --------------------------------------------------------- |
|
3501 |
// CPhoneState::OnlyHashInNumberEntryL |
|
3502 |
// --------------------------------------------------------- |
|
3503 |
// |
|
3504 |
EXPORT_C void CPhoneState::OnlyHashInNumberEntryL() |
|
3505 |
{ |
|
3506 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OnlyHashInNumberEntryL( ) "); |
|
3507 |
// 0.8 seconds has passed, start ALS line change timer |
|
3508 |
StartAlsLineChangeTimerL(); |
|
3509 |
} |
|
3510 |
||
3511 |
// ----------------------------------------------------------- |
|
3512 |
// CPhoneState::NumberEntryClearL |
|
3513 |
// ----------------------------------------------------------- |
|
3514 |
// |
|
3515 |
void CPhoneState::NumberEntryClearL() |
|
3516 |
{ |
|
3517 |
NumberEntryManagerL()->NumberEntryClearL(); |
|
3518 |
} |
|
3519 |
||
3520 |
// ----------------------------------------------------------- |
|
3521 |
// CPhoneState::GetBlockedKeyList |
|
3522 |
// ----------------------------------------------------------- |
|
3523 |
// |
|
3524 |
EXPORT_C const RArray<TInt>& CPhoneState::GetBlockedKeyList() const |
|
3525 |
{ |
|
3526 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetBlockedKeyList( ) "); |
|
3527 |
return iStateMachine->PhoneStorage()->GetBlockedKeyList(); |
|
3528 |
} |
|
3529 |
||
3530 |
// ----------------------------------------------------------- |
|
3531 |
// CPhoneState::DisableHWKeysL |
|
3532 |
// ----------------------------------------------------------- |
|
3533 |
// |
|
3534 |
EXPORT_C void CPhoneState::DisableHWKeysL() |
|
3535 |
{ |
|
3536 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableHWKeysL( ) "); |
|
3537 |
||
3538 |
if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
3539 |
{ |
|
3540 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableHWKeysL HW Keys Disabled " ); |
|
3541 |
||
3542 |
iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyNo ); |
|
3543 |
iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyYes ); |
|
3544 |
} |
|
3545 |
} |
|
3546 |
||
3547 |
// ----------------------------------------------------------- |
|
3548 |
// CPhoneState::DisableCallUIL |
|
3549 |
// ----------------------------------------------------------- |
|
3550 |
// |
|
3551 |
EXPORT_C void CPhoneState::DisableCallUIL() |
|
3552 |
{ |
|
3553 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableCallUIL( ) "); |
|
3554 |
||
3555 |
// Set Call UI state to storage |
|
3556 |
if( !iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
3557 |
{ |
|
3558 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableCallUIL CallUI Disabled " ); |
|
3559 |
||
3560 |
// Show keys locked note |
|
3561 |
TPhoneCmdParamNote noteParam; |
|
3562 |
noteParam.SetType( EPhoneNoteUIDisabled ); |
|
3563 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3564 |
ResolveResourceID( EPhoneInformationNote ) ); |
|
3565 |
||
3566 |
HBufC* noteText = StringLoader::LoadLC( |
|
3567 |
CPhoneMainResourceResolver::Instance()-> |
|
3568 |
ResolveResourceID( EPhoneIncomingCallKeysLocked ) ); |
|
3569 |
noteParam.SetText( *noteText ); |
|
3570 |
||
3571 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3572 |
CleanupStack::PopAndDestroy( noteText ); |
|
3573 |
||
3574 |
// Start capturing the key guard key |
|
3575 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
3576 |
appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
3577 |
appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
|
3578 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
3579 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
|
3580 |
||
3581 |
// Set Call UI state to storage |
|
3582 |
iStateMachine->PhoneStorage()->SetScreenLocked( ETrue ); |
|
3583 |
} |
|
3584 |
} |
|
3585 |
||
3586 |
// ----------------------------------------------------------- |
|
3587 |
// CPhoneState::EnableCallUIL |
|
3588 |
// ----------------------------------------------------------- |
|
3589 |
// |
|
3590 |
EXPORT_C void CPhoneState::EnableCallUIL() |
|
3591 |
{ |
|
3592 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EnableCallUIL( ) "); |
|
3593 |
||
3594 |
if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
3595 |
{ |
|
3596 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::EnableCallUIL CallUI Enabled " ); |
|
3597 |
||
3598 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
3599 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote ); |
|
3600 |
||
3601 |
// Stop capturing the key guard key |
|
3602 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
3603 |
appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
3604 |
appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
|
3605 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
3606 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopCapturingKey, &appKeyCaptureParam ); |
|
3607 |
||
3608 |
iStateMachine->PhoneStorage()->SetScreenLocked( EFalse ); |
|
3609 |
} |
|
3610 |
} |
|
3611 |
||
3612 |
// ----------------------------------------------------------- |
|
3613 |
// CPhoneState::CheckDisableHWKeysAndCallUIL |
|
3614 |
// ----------------------------------------------------------- |
|
3615 |
// |
|
3616 |
EXPORT_C void CPhoneState::CheckDisableHWKeysAndCallUIL() |
|
3617 |
{ |
|
3618 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::CheckDisableHWKeysAndCallUIL( ) "); |
|
3619 |
||
3620 |
if( IsKeyLockOn() || IsAutoLockOn() ) |
|
3621 |
{ |
|
3622 |
// Disable HW keys if needed |
|
3623 |
if( CPhoneCenRepProxy::Instance()-> |
|
3624 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3625 |
{ |
|
3626 |
DisableHWKeysL(); |
|
3627 |
} |
|
3628 |
||
3629 |
// Disable Call UI if needed |
|
3630 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3631 |
&& !CPhoneCenRepProxy::Instance()-> |
|
3632 |
IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
3633 |
{ |
|
3634 |
DisableCallUIL(); |
|
3635 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( ETrue ); |
|
3636 |
} |
|
3637 |
} |
|
3638 |
} |
|
3639 |
||
3640 |
// ----------------------------------------------------------- |
|
3641 |
// CPhoneState::HandleHoldSwitchL |
|
3642 |
// ----------------------------------------------------------- |
|
3643 |
// |
|
3644 |
EXPORT_C void CPhoneState::HandleHoldSwitchL() |
|
3645 |
{ |
|
3646 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::HandleHoldSwitchL( ) "); |
|
3647 |
||
3648 |
if( CPhoneCenRepProxy::Instance()-> |
|
3649 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3650 |
{ |
|
3651 |
if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
3652 |
{ |
|
3653 |
// Disable HW Keys if needed |
|
3654 |
DisableHWKeysL(); |
|
3655 |
} |
|
3656 |
else |
|
3657 |
{ |
|
3658 |
// Reset blocked keys list |
|
3659 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
3660 |
} |
|
3661 |
} |
|
3662 |
||
3663 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3664 |
&& !CPhoneCenRepProxy::Instance()-> |
|
3665 |
IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
3666 |
{ |
|
3667 |
if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
3668 |
{ |
|
3669 |
// Enable Call |
|
3670 |
EnableCallUIL(); |
|
3671 |
} |
|
3672 |
else |
|
3673 |
{ |
|
3674 |
// Set keylock enabled |
|
3675 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
3676 |
// Disable Call |
|
3677 |
DisableCallUIL(); |
|
3678 |
} |
|
3679 |
} |
|
3680 |
||
3681 |
// Stop ringingtone |
|
3682 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
3683 |
} |
|
3684 |
||
3685 |
// ----------------------------------------------------------- |
|
3686 |
// CPhoneState::RetainPreviousKeylockStateL |
|
3687 |
// ----------------------------------------------------------- |
|
3688 |
// |
|
3689 |
EXPORT_C void CPhoneState::RetainPreviousKeylockStateL() |
|
3690 |
{ |
|
3691 |
// Lock keypad, if keylock was enabled before incoming call. |
|
3692 |
// Also reset PhoneStorage keylock status. |
|
3693 |
if ( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) && |
|
3694 |
iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
3695 |
{ |
|
3696 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
3697 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
3698 |
} |
|
3699 |
} |
|
3700 |
||
3701 |
// --------------------------------------------------------- |
|
3702 |
// CPhoneState::HandleKeyLockEnabledL |
|
3703 |
// --------------------------------------------------------- |
|
3704 |
// |
|
3705 |
EXPORT_C void CPhoneState::HandleKeyLockEnabled( TBool aKeylockEnabled ) |
|
3706 |
{ |
|
3707 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyLockEnabledL( ) "); |
|
3708 |
if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
3709 |
&& CPhoneCenRepProxy::Instance()-> |
|
3710 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
3711 |
{ |
|
3712 |
if( !aKeylockEnabled ) |
|
3713 |
{ |
|
3714 |
// Keylock disabled |
|
3715 |
// Reset blocked keys list |
|
3716 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
3717 |
} |
|
3718 |
} |
|
3719 |
} |
|
3720 |
||
3721 |
// --------------------------------------------------------- |
|
3722 |
// CPhoneState::SetToolbarButtonLoudspeakerEnabled |
|
3723 |
// --------------------------------------------------------- |
|
3724 |
// |
|
3725 |
EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled() |
|
3726 |
{ |
|
3727 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3728 |
{ |
|
3729 |
TPhoneCmdParamInteger integerParam; |
|
3730 |
integerParam.SetInteger( EPhoneInCallCmdActivateIhf ); |
|
3731 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3732 |
EPhoneViewEnableToolbarButton, &integerParam )); |
|
3733 |
} |
|
3734 |
} |
|
3735 |
||
3736 |
// --------------------------------------------------------- |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
3737 |
// CPhoneState::SetBackButtonActive |
37 | 3738 |
// --------------------------------------------------------- |
3739 |
// |
|
3740 |
EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive ) |
|
3741 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3742 |
if(IsAutoLockOn() && aActive) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3743 |
// keep back button dimmed device lock case |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3744 |
return; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3745 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3746 |
|
37 | 3747 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3748 |
{ |
|
3749 |
TPhoneCmdParamBoolean booleanParam; |
|
3750 |
booleanParam.SetBoolean( aActive ); |
|
3751 |
iViewCommandHandle->ExecuteCommand( |
|
3752 |
EPhoneViewBackButtonActive, &booleanParam ); |
|
3753 |
} |
|
3754 |
} |
|
3755 |
||
3756 |
// ----------------------------------------------------------- |
|
3757 |
// CPhoneState::OpenSoftRejectMessageEditorL |
|
3758 |
// ----------------------------------------------------------- |
|
3759 |
// |
|
3760 |
EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
|
3761 |
{ |
|
3762 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
3763 |
"CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
|
3764 |
||
3765 |
// Fetch incoming call's id from view |
|
3766 |
TPhoneCmdParamCallStateData callStateData; |
|
3767 |
callStateData.SetCallState( EPEStateRinging ); |
|
3768 |
iViewCommandHandle->HandleCommandL( |
|
3769 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
3770 |
||
3771 |
TInt ringingCallId( KErrNotFound ); |
|
3772 |
// Do nothing if negative incoming call id |
|
3773 |
if( callStateData.CallId() > KErrNotFound ) |
|
3774 |
{ |
|
3775 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
3776 |
||
3777 |
ringingCallId = callStateData.CallId(); |
|
3778 |
} |
|
3779 |
||
3780 |
||
3781 |
TPhoneCmdParamSfiData sfiDataParam; |
|
3782 |
||
3783 |
if (KErrNotFound != ringingCallId) |
|
3784 |
{ |
|
3785 |
if ( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ).Length() ) |
|
3786 |
{ |
|
3787 |
// store both the name and the number |
|
3788 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
3789 |
sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) ); |
|
3790 |
} |
|
3791 |
else |
|
3792 |
{ |
|
3793 |
// store the number |
|
3794 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
3795 |
} |
|
3796 |
} |
|
3797 |
||
3798 |
iViewCommandHandle->ExecuteCommandL( |
|
3799 |
EPhoneViewOpenSoftRejectEditor, &sfiDataParam ); |
|
3800 |
} |
|
3801 |
||
3802 |
// End of File |
|
3803 |