author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:15:47 +0300 | |
changeset 46 | bc5a64e5bc3c |
parent 45 | 6b911d05207e |
child 50 | 377c906a8701 |
child 51 | f39ed5e045e0 |
child 56 | 5bcb308bd24d |
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 |
TPhoneCmdParamBoolean keypadVolumeParam; |
|
221 |
if ( iStateMachine->PhoneEngineInfo()->KeypadVolume() == 0 ) |
|
222 |
{ |
|
223 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioDisabled ); |
|
224 |
} |
|
225 |
else |
|
226 |
{ |
|
227 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioEnabled ); |
|
228 |
} |
|
229 |
UpdateProfileDisplayL(); |
|
230 |
} |
|
231 |
break; |
|
232 |
||
233 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
234 |
// Close menu bar, if it is displayed, for call ending note |
|
235 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
236 |
/* Flow through */ |
|
237 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
238 |
HandleDisconnectingL( aCallId ); |
|
239 |
break; |
|
240 |
||
241 |
case MEngineMonitor::EPEMessageTransferDone: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
242 |
SendGlobalInfoNoteL( EPhoneInCallTransferred, ETrue ); |
37 | 243 |
break; |
244 |
||
245 |
case MEngineMonitor::EPEMessageInitiatedEmergencyCall: |
|
246 |
HandleInitiatedEmergencyCallL( aCallId ); |
|
247 |
break; |
|
248 |
||
249 |
case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo: |
|
250 |
HandleInitiatedEmergencyWhileActiveVideoL(); |
|
251 |
break; |
|
252 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
253 |
case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
254 |
HandleCallSecureStatusChangeL( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
255 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
256 |
if ( iCustomization ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
257 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
258 |
iCustomization->HandlePhoneEngineMessageL( aMessage, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
259 |
aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
260 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
261 |
break; |
37 | 262 |
|
263 |
case MEngineMonitor::EPEMessageIssuingUSSDRequest: |
|
264 |
{ |
|
265 |
// Enable global notes |
|
266 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
267 |
globalNotifierParam.SetBoolean( EFalse ); |
|
268 |
iViewCommandHandle->ExecuteCommandL( |
|
269 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
270 |
&globalNotifierParam ); |
|
271 |
||
272 |
if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() ) |
|
273 |
{ |
|
274 |
// Remove number entry from screen |
|
275 |
iViewCommandHandle->ExecuteCommandL( |
|
276 |
EPhoneViewRemoveNumberEntry ); |
|
277 |
} |
|
278 |
else if ( IsOnScreenDialerSupported() ) |
|
279 |
{ |
|
280 |
NumberEntryClearL(); |
|
281 |
} |
|
282 |
} |
|
283 |
break; |
|
284 |
||
285 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
286 |
// Go to current state implementation |
|
287 |
iCbaManager->UpdateInCallCbaL(); |
|
288 |
break; |
|
289 |
||
290 |
// *#9990# |
|
291 |
case MEngineMonitor::EPEMessageShowBTLoopback: |
|
292 |
// Stop playing DTMF tone |
|
293 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
294 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
295 |
iViewCommandHandle, iStateMachine, this ); |
|
296 |
accessoryBtHandler->ShowBTLoopbackL(); |
|
297 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
298 |
break; |
|
299 |
||
300 |
// *#2820# |
|
301 |
case MEngineMonitor::EPEMessageShowBTDeviceAddress: |
|
302 |
// Stop playing DTMF tone |
|
303 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
304 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
305 |
iViewCommandHandle, iStateMachine, this ); |
|
306 |
accessoryBtHandler->ShowBTAddressL(); |
|
307 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
308 |
break; |
|
309 |
||
310 |
// *#7370# |
|
311 |
case MEngineMonitor::EPEMessageActivateRfsDeep: |
|
312 |
// Stop playing DTMF tone |
|
313 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
314 |
// Launch RFS |
|
315 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsDeep ); |
|
316 |
if ( !IsOnScreenDialerSupported() ) |
|
317 |
{ |
|
318 |
// Do state-specific operation when number entry is cleared |
|
319 |
HandleNumberEntryClearedL(); |
|
320 |
} |
|
321 |
break; |
|
322 |
||
323 |
// *#7780# |
|
324 |
case MEngineMonitor::EPEMessageActivateRfsNormal: |
|
325 |
// Stop playing DTMF tone |
|
326 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
327 |
// Launch RFS |
|
328 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsNormal ); |
|
329 |
if ( !IsOnScreenDialerSupported() ) |
|
330 |
{ |
|
331 |
// Do state-specific operation when number entry is cleared |
|
332 |
HandleNumberEntryClearedL(); |
|
333 |
} |
|
334 |
break; |
|
335 |
// *#62209526# |
|
336 |
case MEngineMonitor::EPEMessageShowWlanMacAddress: |
|
337 |
// Stop playing DTMF tone |
|
338 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
339 |
ShowWlanMacAddressL(); |
|
340 |
break; |
|
341 |
||
342 |
case MEngineMonitor::EPEMessageThumbnailLoadingCompleted: |
|
343 |
// Update call buble |
|
344 |
UpdateRemoteInfoDataL( aCallId ); |
|
345 |
break; |
|
346 |
||
347 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
348 |
UpdateRemoteInfoDataL ( aCallId ); |
|
349 |
break; |
|
350 |
||
351 |
case MEngineMonitor::EPEMessageSIMStateChanged: |
|
352 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL - simStateChanged =%d", SimState() ); |
|
353 |
HandleSimStateChangedL(); |
|
354 |
break; |
|
355 |
||
356 |
case MEngineMonitor::EPEMessageShowIncCallGroupIndex: |
|
357 |
HandleCugInUseNoteL(); |
|
358 |
break; |
|
359 |
||
360 |
default: |
|
361 |
||
362 |
TBool handled( EFalse ); |
|
363 |
||
364 |
if ( iCustomization ) |
|
365 |
{ |
|
366 |
handled = iCustomization->HandlePhoneEngineMessageL( |
|
367 |
aMessage, aCallId ); |
|
368 |
} |
|
369 |
||
370 |
if ( EFalse == handled ) |
|
371 |
{ |
|
372 |
MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId ); |
|
373 |
if( mediatorMessage ) |
|
374 |
{ |
|
375 |
CleanupDeletePushL( mediatorMessage ); |
|
376 |
mediatorMessage->ExecuteL(); |
|
377 |
CleanupStack::PopAndDestroy( mediatorMessage ); |
|
378 |
mediatorMessage = NULL; |
|
379 |
} |
|
380 |
} |
|
381 |
break; |
|
382 |
} |
|
383 |
} |
|
384 |
||
385 |
// ----------------------------------------------------------- |
|
386 |
// CPhoneState::HandleAudioMuteChangedL |
|
387 |
// Default handling for EPEMessageAudioMuteChanged message |
|
388 |
// (other items were commented in a header). |
|
389 |
// ----------------------------------------------------------- |
|
390 |
// |
|
391 |
EXPORT_C void CPhoneState::HandleAudioMuteChangedL() |
|
392 |
{ |
|
393 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioMuteChangedL() "); |
|
394 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
395 |
Panic( EPhoneCtrlInvariant ) ); |
|
396 |
||
397 |
TPhoneCmdParamBoolean booleanParam; |
|
398 |
const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute(); |
|
399 |
booleanParam.SetBoolean( audioMute ); |
|
400 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateMuteUIChanges, |
|
401 |
&booleanParam ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
402 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
403 |
SetTouchPaneButtons(0); |
37 | 404 |
} |
405 |
||
406 |
// ----------------------------------------------------------- |
|
407 |
// CPhoneState::HandleAudioOutputChangedL |
|
408 |
// Default handling for EPEMessageAudioOutputChanged message |
|
409 |
// (other items were commented in a header). |
|
410 |
// ----------------------------------------------------------- |
|
411 |
// |
|
412 |
EXPORT_C void CPhoneState::HandleAudioOutputChangedL() |
|
413 |
{ |
|
414 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioOutputChangedL() "); |
|
415 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
416 |
Panic( EPhoneCtrlInvariant ) ); |
|
417 |
||
418 |
TPhoneCmdParamAudioOutput outputParam; |
|
419 |
||
420 |
// Output |
|
421 |
const TPEAudioOutput audioOutput = |
|
422 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
|
423 |
outputParam.SetAudioOutput( audioOutput ); |
|
424 |
||
425 |
// view update |
|
426 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioPathUIChanges, |
|
427 |
&outputParam ); |
|
428 |
||
429 |
// Previous Output |
|
430 |
TPEPhoneAudioRouteParameters RouteParameters = iStateMachine-> |
|
431 |
PhoneEngineInfo()->RouteParameters(); |
|
432 |
const TPEAudioOutput previousOutput = |
|
433 |
RouteParameters.iPreviousOutput; |
|
434 |
||
435 |
// BT availability |
|
436 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
437 |
EPEBTAudioAccessory ); |
|
438 |
||
439 |
// Show note or BT disconnect handler |
|
440 |
if ( audioOutput != EPENotActive && |
|
441 |
previousOutput == EPEBTAudioAccessory && |
|
442 |
!btAvailable ) |
|
443 |
{ |
|
444 |
CPhoneBtaaDisconnectHandler::InstanceL()->HandleConnectionLostL(); |
|
445 |
} |
|
446 |
else if ( audioOutput == EPEBTAudioAccessory && |
|
447 |
previousOutput != EPEBTAudioAccessory && |
|
448 |
btAvailable ) |
|
449 |
{ |
|
450 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
451 |
iViewCommandHandle, iStateMachine, this ); |
|
452 |
bt->ShowBTActivatedL(); |
|
453 |
CleanupStack::PopAndDestroy( bt ); |
|
454 |
} |
|
455 |
else if ( audioOutput == EPENotActive && |
|
456 |
CPhoneBtaaDisconnectHandler::InstanceL()->IsQuery() ) |
|
457 |
{ |
|
458 |
CPhoneBtaaDisconnectHandler::InstanceL()->Cancel(); |
|
459 |
} |
|
460 |
else if ( RouteParameters.iShowNote && audioOutput == EPELoudspeaker ) |
|
461 |
{ |
|
462 |
CAknKeySoundSystem* keySounds = |
|
463 |
static_cast<CAknAppUi*>( iEnv.EikAppUi() )->KeySounds(); |
|
464 |
keySounds->PlaySound( EAvkonSIDIHFActive ); |
|
465 |
} |
|
466 |
} |
|
467 |
||
468 |
// ----------------------------------------------------------- |
|
469 |
// CPhoneState::HandleSimStateChangedL |
|
470 |
// Handles changes in the SIM card state. |
|
471 |
// ----------------------------------------------------------- |
|
472 |
// |
|
473 |
void CPhoneState::HandleSimStateChangedL() |
|
474 |
{ |
|
475 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleSimStateChangedL()" ); |
|
476 |
CPhoneMainResourceResolver& resolver = *CPhoneMainResourceResolver::Instance(); |
|
477 |
TPESimState simState = SimState(); |
|
478 |
||
479 |
__PHONELOG2( EBasic, EPhoneControl, "SIM state was changed from %d to %d", iPreviousSimState, simState ); |
|
480 |
||
481 |
switch ( simState ) |
|
482 |
{ |
|
483 |
case EPESimUsable: // Falls through. |
|
484 |
case EPESimReadable: // Falls through. |
|
485 |
case EPESimNotReady: |
|
486 |
{ |
|
487 |
if ( iPreviousSimState == EPESimNotPresent ) |
|
488 |
{ |
|
489 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was inserted, rebooting the phone" ); |
|
490 |
RStarterSession starterSession; |
|
491 |
User::LeaveIfError( starterSession.Connect() ); |
|
492 |
CleanupClosePushL( starterSession ); |
|
493 |
||
494 |
HBufC* queryText = StringLoader::LoadLC( resolver.ResolveResourceID( EPhoneRebootRequired ) ); |
|
495 |
||
496 |
TPhoneCmdParamQuery queryParams; |
|
497 |
queryParams.SetCommandParamId( TPhoneCommandParam::EPhoneParamRebootQuery ); |
|
498 |
queryParams.SetQueryPrompt( *queryText ); |
|
499 |
queryParams.SetDefaultCba( R_AVKON_SOFTKEYS_OK_EMPTY ); |
|
500 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParams ); |
|
501 |
||
502 |
starterSession.Reset( RStarterSession::ESIMStatusChangeReset ); |
|
503 |
CleanupStack::PopAndDestroy( 2, &starterSession ); // queryText |
|
504 |
} |
|
505 |
break; |
|
506 |
} |
|
507 |
case EPESimNotPresent: |
|
508 |
{ |
|
509 |
if ( iPreviousSimState == EPESimUsable || |
|
510 |
iPreviousSimState == EPESimReadable || |
|
511 |
iPreviousSimState == EPESimNotReady ) |
|
512 |
{ |
|
513 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was removed" ); |
|
514 |
||
515 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
516 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
517 |
globalNoteParam.SetTone( EAvkonSIDNoSound ); |
|
518 |
||
519 |
globalNoteParam.SetTextResourceId( |
|
520 |
CPhoneMainResourceResolver::Instance()-> |
|
521 |
ResolveResourceID( EPhoneSimRemoved ) ); |
|
522 |
||
523 |
iViewCommandHandle->ExecuteCommandL( |
|
524 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
525 |
||
526 |
} |
|
527 |
// Show security note, if SIM not present and KFeatureIdFfSimlessOfflineSupport is disabled. |
|
528 |
else if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) && |
|
529 |
( iPreviousSimState != EPESimNotSupported ) ) |
|
530 |
{ |
|
531 |
StartShowSecurityNoteL(); |
|
532 |
} |
|
533 |
break; |
|
534 |
} |
|
535 |
default: |
|
536 |
break; |
|
537 |
} |
|
538 |
||
539 |
iPreviousSimState = simState; |
|
540 |
} |
|
541 |
||
542 |
// ----------------------------------------------------------------------------- |
|
543 |
// CPhoneState::IsValidAlphaNumericKey |
|
544 |
// Checks is the key event a number, a special character |
|
545 |
// or if VoIP is enabled some other character |
|
546 |
// ----------------------------------------------------------------------------- |
|
547 |
// |
|
548 |
TBool CPhoneState::IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent, |
|
549 |
TEventCode aEventCode ) |
|
550 |
{ |
|
551 |
TBool ret(EFalse); |
|
552 |
||
553 |
const TBool numericKeyEntered( CPhoneKeys::IsNumericKey( |
|
554 |
aKeyEvent, aEventCode ) ); |
|
555 |
||
556 |
// a numeric key (1,2,3,4,6,7,8,9,0,+,*,p,w ) |
|
557 |
// or |
|
558 |
// a letter from fullscreen qwerty, miniqwerty or handwriting |
|
559 |
// when voip is enabled |
|
560 |
if ( numericKeyEntered |
|
561 |
|| IsAlphanumericSupportedAndCharInput( aKeyEvent ) ) |
|
562 |
{ |
|
563 |
ret= ETrue; |
|
564 |
} |
|
565 |
||
566 |
return ret; |
|
567 |
} |
|
568 |
||
569 |
// ----------------------------------------------------------------------------- |
|
570 |
// CPhoneState::CustomizeCBAForPhoneNumber |
|
571 |
// |
|
572 |
// ----------------------------------------------------------------------------- |
|
573 |
// |
|
574 |
void CPhoneState::CustomizeCbaForPhoneNumberL() |
|
575 |
{ |
|
576 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) && |
|
577 |
iCustomization && |
|
578 |
iCustomization->AllowAlphaNumericMode() ) |
|
579 |
{ |
|
580 |
// Get the number entry contents |
|
581 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
582 |
||
583 |
TPhoneCmdParamInteger integerParam; |
|
584 |
||
585 |
//only charaters from set { 0, .., 9, *, #, +, p, w, P, W } used |
|
586 |
if ( CPhoneKeys::Validate( phoneNumber->Des()) ) |
|
587 |
{ |
|
588 |
integerParam.SetInteger( CPhoneMainResourceResolver::Instance()-> |
|
589 |
ResolveResourceID( EPhoneNumberAcqCBA ) ); |
|
590 |
} |
|
591 |
//other characters |
|
592 |
else |
|
593 |
{ |
|
594 |
integerParam.SetInteger( iCustomization->CustomizeSoftKeys() ); |
|
595 |
} |
|
596 |
||
597 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateCba, &integerParam ); |
|
598 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
599 |
} |
|
600 |
||
601 |
} |
|
602 |
||
603 |
// ----------------------------------------------------------------------------- |
|
604 |
// CPhoneState::IsTouchDTmfDialerOn |
|
605 |
// ----------------------------------------------------------------------------- |
|
606 |
// |
|
607 |
TBool CPhoneState::IsTouchDTmfDialerOn() const |
|
608 |
{ |
|
609 |
TBool status( EFalse ); |
|
610 |
if ( IsOnScreenDialerSupported() ) |
|
611 |
{ |
|
612 |
TBool isDialerVisible( EFalse ); |
|
613 |
TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() ); |
|
614 |
||
615 |
if ( isDialerVisible ) |
|
616 |
{ |
|
617 |
status = ETrue; |
|
618 |
} |
|
619 |
} |
|
620 |
return status; |
|
621 |
} |
|
622 |
// ----------------------------------------------------------------------------- |
|
623 |
// CPhoneState::SendDtmfKeyEventL |
|
624 |
// send dtmf event when, |
|
625 |
// -touch dtmf dialer is NOT visible |
|
626 |
// -query is not active |
|
627 |
// -menubar is not open |
|
628 |
// ----------------------------------------------------------------------------- |
|
629 |
// |
|
630 |
void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent, |
|
631 |
TEventCode aEventCode ) |
|
632 |
{ |
|
633 |
||
634 |
if ( !IsTouchDTmfDialerOn() |
|
635 |
&& !IsAnyQueryActiveL() |
|
636 |
&& !IsMenuBarVisibleL() ) |
|
637 |
{ |
|
638 |
// Send the key event to the phone engine. |
|
639 |
SendKeyEventL( aKeyEvent, aEventCode ); |
|
640 |
} |
|
641 |
} |
|
642 |
||
643 |
// ----------------------------------------------------------------------------- |
|
644 |
// CPhoneState::IsKeyEventFurtherProcessed |
|
645 |
// ----------------------------------------------------------------------------- |
|
646 |
// |
|
647 |
TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const |
|
648 |
{ |
|
649 |
// While being in some special keyboard mode (Full Screen&mini QWERTY, |
|
650 |
// handwriting mode) FEP sends only EEventKey -event and thus manual |
|
651 |
// DTMFs can not be played with the user specified tone lengths. Also, |
|
652 |
// in general, DTMFs are tried to play only in numeric mode. |
|
653 |
TBool numericMode = iViewCommandHandle->HandleCommandL( |
|
654 |
EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess; |
|
655 |
||
656 |
if ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode ) |
|
657 |
{ |
|
658 |
return EFalse; |
|
659 |
} |
|
660 |
||
661 |
return ETrue; |
|
662 |
} |
|
663 |
||
664 |
// ----------------------------------------------------------- |
|
665 |
// CPhoneState::HandleErrorL |
|
666 |
// Default handling for HandleError message |
|
667 |
// (other items were commented in a header). |
|
668 |
// ----------------------------------------------------------- |
|
669 |
// |
|
670 |
EXPORT_C void CPhoneState::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
671 |
{ |
|
672 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleErrorL()"); |
|
673 |
||
674 |
__PHONELOG1( EBasic, EPhoneControl, |
|
675 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
676 |
aErrorInfo.iErrorCode ); |
|
677 |
||
678 |
__PHONELOG1( EBasic, EPhoneControl, |
|
679 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ", |
|
680 |
aErrorInfo.iCallId ); |
|
681 |
||
682 |
||
683 |
// Sets touch buttons to correct status if error has occured. |
|
684 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
685 |
{ |
|
686 |
iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons ); |
|
687 |
} |
|
688 |
||
689 |
// Do the common error handling (display proper notes etc) |
|
690 |
CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( aErrorInfo ); |
|
691 |
||
692 |
switch( aErrorInfo.iErrorCode ) |
|
693 |
{ |
|
694 |
case ECCPErrorCCUserAlertingNoAnswer: |
|
695 |
case ECCPErrorCCResourceNotAvailable: |
|
696 |
{ |
|
697 |
if( aErrorInfo.iCallId > KErrNotFound ) |
|
698 |
{ |
|
699 |
if ( iStateMachine->PhoneEngineInfo()->CallDirection( |
|
700 |
aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated ) |
|
701 |
{ |
|
702 |
if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
703 |
{ |
|
704 |
// Active MO video call lost 3G network. |
|
705 |
__PHONELOG1( EBasic, EPhoneControl, |
|
706 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 1, callid%d ", |
|
707 |
aErrorInfo.iCallId ); |
|
708 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
709 |
} |
|
710 |
else |
|
711 |
{ |
|
712 |
__PHONELOG1( EBasic, EPhoneControl, |
|
713 |
"PhoneUIControl: CPhoneState::HandleErrorL - No video call =%d ", |
|
714 |
aErrorInfo.iCallId ); |
|
715 |
} |
|
716 |
} |
|
717 |
} |
|
718 |
} |
|
719 |
break; |
|
720 |
||
721 |
case ECCPErrorCCServiceNotAvailable: |
|
722 |
{ |
|
723 |
if( IsVideoCall( aErrorInfo.iCallId ) ) |
|
724 |
{ |
|
725 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( EFalse ); |
|
726 |
} |
|
727 |
} |
|
728 |
break; |
|
729 |
||
730 |
case ECCPErrorBadRequest: |
|
731 |
{ |
|
732 |
TPECallType callType = |
|
733 |
iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
|
734 |
||
735 |
if( callType == EPECallTypeVideo ) |
|
736 |
{ |
|
737 |
// Dialling MO video call cannot reach 3G network. |
|
738 |
__PHONELOG1( EBasic, EPhoneControl, |
|
739 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 2, callid%d ", |
|
740 |
aErrorInfo.iCallId ); |
|
741 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
742 |
} |
|
743 |
} |
|
744 |
break; |
|
745 |
||
746 |
case ECCPErrorVideoCallNotSupportedByNetwork: |
|
747 |
case ECCPErrorVideoCallSetupFailed: |
|
748 |
case ECCPErrorNotReached: |
|
749 |
// If call id found and seems to be Video Call |
|
750 |
if ( IsVideoCall( aErrorInfo.iCallId ) ) |
|
751 |
{ |
|
752 |
// Get active call count |
|
753 |
TPhoneCmdParamInteger activeCallCount; |
|
754 |
iViewCommandHandle->ExecuteCommandL( |
|
755 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
756 |
||
757 |
if ( activeCallCount.Integer() == 0 |
|
758 |
|| iStateMachine->PhoneEngineInfo()->CallDirection( |
|
759 |
aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated ) |
|
760 |
{ |
|
761 |
// Dialling MO video call attempted in 2G network or |
|
762 |
// dialing MO video to unvalid number |
|
763 |
// Reconnect query include video label if errorcode is unvalid number. |
|
764 |
__PHONELOG1( EBasic, EPhoneControl, |
|
765 |
"PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 3, callid%d ", |
|
766 |
aErrorInfo.iCallId ); |
|
767 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( |
|
768 |
ECCPErrorNotReached == aErrorInfo.iErrorCode ); |
|
769 |
} |
|
770 |
} |
|
771 |
break; |
|
772 |
||
773 |
case ECCPErrorNoService: |
|
774 |
// No network -> hide volume popup |
|
775 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
776 |
break; |
|
777 |
||
778 |
case ECCPErrorSatControl: |
|
779 |
{ |
|
780 |
// check, that there really was a call established before completing SAT request |
|
781 |
if( aErrorInfo.iCallId != KPECallIdNotUsed ) |
|
782 |
{ |
|
783 |
} |
|
784 |
||
785 |
// remove number entry |
|
786 |
if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() ) |
|
787 |
{ |
|
788 |
iViewCommandHandle->ExecuteCommandL( |
|
789 |
EPhoneViewRemoveNumberEntry ); |
|
790 |
} |
|
791 |
else if ( IsOnScreenDialerSupported() ) |
|
792 |
{ |
|
793 |
NumberEntryClearL(); |
|
794 |
} |
|
795 |
} |
|
796 |
break; |
|
797 |
||
798 |
default: |
|
799 |
break; |
|
800 |
} |
|
801 |
||
802 |
// clear call blacklist if call failure occurs |
|
803 |
CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); |
|
804 |
} |
|
805 |
||
806 |
// ----------------------------------------------------------- |
|
807 |
// CPhoneState::HandleChangedCallDurationL |
|
808 |
// Default handling for EPEMessageChangedCallDuration message |
|
809 |
// (other items were commented in a header). |
|
810 |
// ----------------------------------------------------------- |
|
811 |
void CPhoneState::HandleChangedCallDurationL( TInt aCallId ) |
|
812 |
{ |
|
813 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() "); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
814 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
815 |
TInt ret = KErrNone; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
816 |
TInt isDisplayOn; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
817 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
818 |
ret = HAL::Get( HALData::EDisplayState, isDisplayOn ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
819 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
820 |
// 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
|
821 |
// 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
|
822 |
if ( ret || isDisplayOn ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
823 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
824 |
// Get the call duration |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
825 |
TTimeIntervalSeconds seconds = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
826 |
iStateMachine->PhoneEngineInfo()->CallDuration( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
827 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
828 |
TPhoneCmdParamInteger time; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
829 |
time.SetInteger(seconds.Int()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
830 |
iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
831 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
832 |
} |
37 | 833 |
|
834 |
// ----------------------------------------------------------------------------- |
|
835 |
// CPhoneState::HandleRemoteBusyL |
|
836 |
// ----------------------------------------------------------------------------- |
|
837 |
// |
|
838 |
void CPhoneState::HandleRemoteBusyL( TInt aCallId ) |
|
839 |
{ |
|
840 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleRemoteBusyL( ) "); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
841 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
842 |
TPEErrorInfo info; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
843 |
info.iCallId = aCallId; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
844 |
info.iErrorCode = ECCPErrorBusy; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
845 |
info.iErrorType = EPECcp; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
846 |
CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( info ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
847 |
|
37 | 848 |
const TPECallType callType = |
849 |
iStateMachine->PhoneEngineInfo()->CallTypeCommand(); |
|
850 |
||
851 |
if( callType == EPECallTypeVideo ) |
|
852 |
{ |
|
853 |
// Launch reconnect query including video call menu item |
|
854 |
__PHONELOG1( EBasic, EPhoneControl, |
|
855 |
"PhoneUIControl: CPhoneState::HandleRemoteBusyL - ShowReconnectQueryL vid 5, callid%d ", |
|
856 |
aCallId ); |
|
857 |
CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
|
858 |
} |
|
859 |
} |
|
860 |
||
861 |
// ----------------------------------------------------------- |
|
862 |
// CPhoneState::HandleDisconnectingL |
|
863 |
// ----------------------------------------------------------- |
|
864 |
// |
|
865 |
EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId ) |
|
866 |
{ |
|
867 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) "); |
|
868 |
// If there is no call in connected state then EPhoneDtmfTextQuery and EPhoneDtmfListQueryDialog |
|
869 |
// must be dismmissed from UI, therefore we must set EPhoneViewSetNoConnectedCalls to ETrue this |
|
870 |
// way we can ensure that CPhoneQueryController doesnt relaunch EPhoneDtmfListQueryDialog. |
|
871 |
if ( !IsAnyConnectedCalls() ) |
|
872 |
{ |
|
873 |
TPhoneCmdParamBoolean booleanParam; |
|
874 |
booleanParam.SetBoolean(ETrue); |
|
875 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNoConnectedCalls, &booleanParam ); |
|
876 |
} |
|
877 |
||
878 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
879 |
callHeaderParam.SetCallState( EPEStateDisconnecting ); |
|
880 |
||
881 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
882 |
LoadResource( labelText, EPhoneInCallDisconnected ); |
|
883 |
||
884 |
callHeaderParam.SetLabelText( labelText ); |
|
885 |
||
886 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
887 |
||
888 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
889 |
&callHeaderParam ); |
|
890 |
||
891 |
CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); |
|
892 |
} |
|
893 |
||
894 |
// ----------------------------------------------------------- |
|
895 |
// CPhoneState::IsCustomizedDialerVisibleL() |
|
896 |
// ----------------------------------------------------------- |
|
897 |
// |
|
898 |
EXPORT_C TBool CPhoneState::IsCustomizedDialerVisibleL() const |
|
899 |
{ |
|
900 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsCustomizedDialerVisibleL( ) "); |
|
901 |
return iViewCommandHandle->HandleCommandL( |
|
902 |
EPhoneIsCustomizedDialerVisible ) == EPhoneViewResponseSuccess; |
|
903 |
} |
|
904 |
||
905 |
// <------------------------------- KEY EVENTS -------------------------------> |
|
906 |
||
907 |
// ----------------------------------------------------------- |
|
908 |
// CPhoneState::HandleKeyMessageL( aMessage, aKeyCode ) |
|
909 |
// ----------------------------------------------------------- |
|
910 |
// |
|
911 |
EXPORT_C void CPhoneState::HandleKeyMessageL( |
|
912 |
TPhoneKeyEventMessages /*aMessage*/, |
|
913 |
TKeyCode /*aKeyCode*/ ) |
|
914 |
{ |
|
915 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyMessageL( ) "); |
|
916 |
} |
|
917 |
||
918 |
// ----------------------------------------------------------- |
|
919 |
// CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ) |
|
920 |
// ----------------------------------------------------------- |
|
921 |
// |
|
922 |
EXPORT_C void CPhoneState::HandleKeyEventL( |
|
923 |
const TKeyEvent& aKeyEvent, |
|
924 |
TEventCode aEventCode ) |
|
925 |
{ |
|
926 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyEventL( ) "); |
|
927 |
if ( ( IsNumberEntryVisibleL() ) || OnlySideVolumeKeySupported() ) |
|
928 |
{ |
|
929 |
// Handle numeric keys when key events are received in single state |
|
930 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
931 |
} |
|
932 |
else if ( aKeyEvent.iScanCode == EStdKeyUpArrow && |
|
933 |
aEventCode == EEventKey ) |
|
934 |
{ |
|
935 |
// Increace audio volume |
|
936 |
IncreaseAudioVolumeL(); |
|
937 |
} |
|
938 |
else if ( aKeyEvent.iScanCode == EStdKeyDownArrow && |
|
939 |
aEventCode == EEventKey ) |
|
940 |
{ |
|
941 |
// Decreace audio volume |
|
942 |
DecreaseAudioVolumeL(); |
|
943 |
} |
|
944 |
else |
|
945 |
{ |
|
946 |
// Handle numeric keys when key events are received in single state |
|
947 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
948 |
} |
|
949 |
} |
|
950 |
||
951 |
// ----------------------------------------------------------- |
|
952 |
// CPhoneState::OnlySideVolumeKeySupported |
|
953 |
// ----------------------------------------------------------- |
|
954 |
// |
|
955 |
TBool CPhoneState::OnlySideVolumeKeySupported() |
|
956 |
{ |
|
957 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::OnlySideVolumeKeySupported( ) "); |
|
958 |
TBool onlySideVolumeKeySupported(EFalse); |
|
959 |
if ( !CPhoneCenRepProxy::Instance()-> |
|
960 |
IsTelephonyFeatureSupported( KTelephonyLVFlagScrollVolumeKeys ) && |
|
961 |
FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys ) ) |
|
962 |
{ |
|
963 |
onlySideVolumeKeySupported = ETrue; |
|
964 |
} |
|
965 |
__PHONELOG1( EBasic, EPhoneControl, |
|
966 |
"OnlySideVolumeKeySupported: %d", |
|
967 |
onlySideVolumeKeySupported ); |
|
968 |
return onlySideVolumeKeySupported; |
|
969 |
} |
|
970 |
||
971 |
// ----------------------------------------------------------- |
|
972 |
// CPhoneState::HandleKeyPressDurationL( aScanCode, aKeyPressDuration ) |
|
973 |
// ----------------------------------------------------------- |
|
974 |
// |
|
975 |
EXPORT_C void CPhoneState::HandleKeyPressDurationL( |
|
976 |
TKeyCode aCode, |
|
977 |
TTimeIntervalMicroSeconds /*aKeyPressDuration*/ ) |
|
978 |
{ |
|
979 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyPressDurationL( ) "); |
|
980 |
||
981 |
if( aCode == KPhoneDtmfHashCharacter ) |
|
982 |
{ |
|
983 |
if( iAlsLineChangeKeyPressTimer ) |
|
984 |
{ |
|
985 |
if( iAlsLineChangeKeyPressTimer->IsActive() ) |
|
986 |
{ |
|
987 |
iAlsLineChangeKeyPressTimer->Cancel(); |
|
988 |
} |
|
989 |
} |
|
990 |
} |
|
991 |
} |
|
992 |
||
993 |
// ----------------------------------------------------------- |
|
994 |
// CPhoneState::IsNoteVisibleL |
|
995 |
// ----------------------------------------------------------- |
|
996 |
// |
|
997 |
EXPORT_C TBool CPhoneState::IsNoteVisibleL() |
|
998 |
{ |
|
999 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteVisibleL( ) "); |
|
1000 |
TPhoneCmdParamBoolean booleanParam; |
|
1001 |
iViewCommandHandle->ExecuteCommandL( |
|
1002 |
EPhoneViewGetIsNoteVisible, &booleanParam ); |
|
1003 |
return booleanParam.Boolean(); |
|
1004 |
} |
|
1005 |
||
1006 |
// ----------------------------------------------------------- |
|
1007 |
// CPhoneState::IsMenuBarVisibleL |
|
1008 |
// ----------------------------------------------------------- |
|
1009 |
// |
|
1010 |
EXPORT_C TBool CPhoneState::IsMenuBarVisibleL() const |
|
1011 |
{ |
|
1012 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsMenuBarVisibleL( ) "); |
|
1013 |
return iViewCommandHandle->HandleCommandL( |
|
1014 |
EPhoneViewIsMenuBarVisible ) == |
|
1015 |
EPhoneViewResponseSuccess; |
|
1016 |
} |
|
1017 |
||
1018 |
// ----------------------------------------------------------- |
|
1019 |
// CPhoneState::HandleNumericKeyEventL |
|
1020 |
// ----------------------------------------------------------- |
|
1021 |
// |
|
1022 |
EXPORT_C void CPhoneState::HandleNumericKeyEventL( |
|
1023 |
const TKeyEvent& aKeyEvent, |
|
1024 |
TEventCode aEventCode ) |
|
1025 |
{ |
|
1026 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) "); |
|
1027 |
||
1028 |
TBool numberEntryUsed = IsNumberEntryUsedL(); |
|
1029 |
||
1030 |
if ( numberEntryUsed && ( aKeyEvent.iRepeats == 0 || |
|
1031 |
aKeyEvent.iScanCode == EStdKeyBackspace || |
|
1032 |
aKeyEvent.iScanCode ==EStdKeyLeftArrow || |
|
1033 |
aKeyEvent.iScanCode ==EStdKeyRightArrow )) |
|
1034 |
{ |
|
1035 |
// Number entry exists but may be hidden |
|
1036 |
KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode ); |
|
1037 |
} |
|
1038 |
||
1039 |
} |
|
1040 |
||
1041 |
// ----------------------------------------------------------------------------- |
|
1042 |
// CPhoneState::IsAnyQueryActiveL |
|
1043 |
// ----------------------------------------------------------------------------- |
|
1044 |
// |
|
1045 |
EXPORT_C TBool CPhoneState::IsAnyQueryActiveL() |
|
1046 |
{ |
|
1047 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAnyQueryActiveL( ) "); |
|
1048 |
TBool isActive( EFalse ); |
|
1049 |
||
1050 |
// If IsNoteDismissableL returns true then shown note is dismissable by key event |
|
1051 |
// and then there is no actual query and IsAnyQueryActiveL returns false. |
|
1052 |
if ( !IsNoteDismissableL() ) |
|
1053 |
{ |
|
1054 |
// Check is query displayed |
|
1055 |
TPhoneCmdParamBoolean isQueryDisplayed; |
|
1056 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewIsQuery, &isQueryDisplayed ); |
|
1057 |
// Check is Blocking Dialog active ( e.g. RFS query ) |
|
1058 |
TPhoneCmdParamBoolean blockingDialogStatus; |
|
1059 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, |
|
1060 |
&blockingDialogStatus ); |
|
1061 |
// Check is note displayed |
|
1062 |
TPhoneCmdParamBoolean isNoteActive; |
|
1063 |
iViewCommandHandle->ExecuteCommandL( |
|
1064 |
EPhoneViewIsNoteActive, &isNoteActive ); |
|
1065 |
||
1066 |
if ( isQueryDisplayed.Boolean() || blockingDialogStatus.Boolean() || isNoteActive.Boolean() ) |
|
1067 |
{ |
|
1068 |
isActive = ETrue; |
|
1069 |
} |
|
1070 |
} |
|
1071 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyQueryActiveL: %d ", isActive ); |
|
1072 |
return isActive; |
|
1073 |
} |
|
1074 |
||
1075 |
// ----------------------------------------------------------------------------- |
|
1076 |
// CPhoneState::IsNoteDismissable |
|
1077 |
// ----------------------------------------------------------------------------- |
|
1078 |
// |
|
1079 |
TBool CPhoneState::IsNoteDismissableL() |
|
1080 |
{ |
|
1081 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteDismissableL( ) "); |
|
1082 |
TBool dismiss = EFalse; |
|
1083 |
if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) || |
|
1084 |
(FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) && |
|
1085 |
SimSecurityStatus() == ESimRejected ) ) |
|
1086 |
{ |
|
1087 |
// Check if note is dismissed by key event. |
|
1088 |
TPhoneCmdParamBoolean isNoteDismissed; |
|
1089 |
iViewCommandHandle->ExecuteCommandL( |
|
1090 |
EPhoneViewIsActiveNoteDissmissableByKeyEvent, &isNoteDismissed ); |
|
1091 |
if ( isNoteDismissed.Boolean() ) |
|
1092 |
{ |
|
1093 |
dismiss = ETrue; |
|
1094 |
} |
|
1095 |
} |
|
1096 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsNoteDismissableL: %d ", dismiss ); |
|
1097 |
return dismiss; |
|
1098 |
} |
|
1099 |
||
1100 |
// ----------------------------------------------------------- |
|
1101 |
// CPhoneState::SendKeyEventL |
|
1102 |
// ----------------------------------------------------------- |
|
1103 |
// |
|
1104 |
void CPhoneState::SendKeyEventL( |
|
1105 |
const TKeyEvent& aKeyEvent, |
|
1106 |
TEventCode aEventCode ) |
|
1107 |
{ |
|
1108 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyEventL( ) "); |
|
1109 |
switch( aEventCode ) |
|
1110 |
{ |
|
1111 |
// EEventKey |
|
1112 |
case EEventKey: |
|
1113 |
// Send the key press to the phone engine, if applicable |
|
1114 |
SendKeyPressL( aKeyEvent, aEventCode ); |
|
1115 |
break; |
|
1116 |
||
1117 |
// EEventKeyUp |
|
1118 |
case EEventKeyUp: |
|
1119 |
// Send a key up event for the last key code sent to |
|
1120 |
// the phone engine |
|
1121 |
iStateMachine->SendPhoneEngineMessage( |
|
1122 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
1123 |
break; |
|
1124 |
||
1125 |
default: |
|
1126 |
break; |
|
1127 |
} |
|
1128 |
} |
|
1129 |
||
1130 |
// ----------------------------------------------------------- |
|
1131 |
// CPhoneState::SendKeyPressL |
|
1132 |
// ----------------------------------------------------------- |
|
1133 |
// |
|
1134 |
void CPhoneState::SendKeyPressL( |
|
1135 |
const TKeyEvent& aKeyEvent, |
|
1136 |
TEventCode aEventCode ) |
|
1137 |
{ |
|
1138 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyPressL( ) "); |
|
1139 |
const TBool dtmfToneKeyEntered = |
|
1140 |
CPhoneKeys::IsDtmfTone( aKeyEvent, aEventCode ); |
|
1141 |
||
1142 |
if ( dtmfToneKeyEntered || |
|
1143 |
aKeyEvent.iCode == EKeyBackspace ) |
|
1144 |
{ |
|
1145 |
// Get the number entry contents, if it exists |
|
1146 |
if ( IsNumberEntryUsedL() ) |
|
1147 |
{ |
|
1148 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
1149 |
// Save the phone number |
|
1150 |
__PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber ); |
|
1151 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
1152 |
||
1153 |
// Convert key code to western. |
|
1154 |
TBuf<1> buffer; // one character |
|
1155 |
buffer.Append( aKeyEvent.iCode ); |
|
1156 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1157 |
"CPhoneState::SendKeyPressL(%S)", |
|
1158 |
&buffer ); |
|
1159 |
AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
1160 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1161 |
"CPhoneState::SendKeyPressL(%S)", |
|
1162 |
&buffer ); |
|
1163 |
TLex code( buffer ); |
|
1164 |
||
1165 |
// Save the key code |
|
1166 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
1167 |
||
1168 |
// Plays a DTMF tone if active call |
|
1169 |
iStateMachine->SendPhoneEngineMessage( |
|
1170 |
MPEPhoneModel::EPEMessagePlayDTMF ); |
|
1171 |
// remove the phone number from the cleanup stack |
|
1172 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
1173 |
} |
|
1174 |
} |
|
1175 |
} |
|
1176 |
||
1177 |
// <------------------------------ SYSTEM EVENTS -----------------------------> |
|
1178 |
||
1179 |
// ----------------------------------------------------------- |
|
1180 |
// CPhoneState::DynInitMenuPaneL |
|
1181 |
// ----------------------------------------------------------- |
|
1182 |
// |
|
1183 |
EXPORT_C void CPhoneState::DynInitMenuPaneL( |
|
1184 |
TInt aResourceId, |
|
1185 |
CEikMenuPane* aMenuPane ) |
|
1186 |
{ |
|
1187 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuPaneL( ) "); |
|
1188 |
__ASSERT_DEBUG( aMenuPane && aResourceId, |
|
1189 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
1190 |
||
1191 |
// Save the number of digits in the number entry before processing |
|
1192 |
// the menu pane |
|
1193 |
if ( IsNumberEntryUsedL() ) |
|
1194 |
{ |
|
1195 |
TPhoneCmdParamBoolean serviceCodeParam; |
|
1196 |
serviceCodeParam.SetBoolean( |
|
1197 |
iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ); |
|
1198 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag, |
|
1199 |
&serviceCodeParam ); |
|
1200 |
} |
|
1201 |
||
1202 |
// Process the menu pane |
|
1203 |
TPhoneCmdParamDynMenu dynMenuPane; |
|
1204 |
dynMenuPane.SetResourceId( aResourceId ); |
|
1205 |
dynMenuPane.SetDynMenu( aMenuPane ); |
|
1206 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane ); |
|
1207 |
||
1208 |
if ( iCustomization ) |
|
1209 |
{ |
|
1210 |
// Menu pane is customized after default items are decided |
|
1211 |
iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane); |
|
1212 |
} |
|
1213 |
} |
|
1214 |
||
1215 |
// ----------------------------------------------------------- |
|
1216 |
// CPhoneState::DynInitMenuBarL |
|
1217 |
// ----------------------------------------------------------- |
|
1218 |
// |
|
1219 |
EXPORT_C void CPhoneState::DynInitMenuBarL( |
|
1220 |
TInt aResourceId, |
|
1221 |
CEikMenuBar* aMenuBar ) |
|
1222 |
{ |
|
1223 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuBarL( ) "); |
|
1224 |
__ASSERT_DEBUG( aMenuBar && aResourceId, |
|
1225 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
1226 |
||
1227 |
TPhoneCmdParamDynMenu dynMenuBar; |
|
1228 |
dynMenuBar.SetResourceId( aResourceId ); |
|
1229 |
dynMenuBar.SetDynMenu( aMenuBar ); |
|
1230 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBar, &dynMenuBar ); |
|
1231 |
||
1232 |
if ( iCustomization ) |
|
1233 |
{ |
|
1234 |
// Menu bar is customized after default items are decided |
|
1235 |
iCustomization->CustomizeMenuBarL(aResourceId, aMenuBar); |
|
1236 |
} |
|
1237 |
||
1238 |
} |
|
1239 |
||
1240 |
// ----------------------------------------------------------- |
|
1241 |
// CPhoneState::HandleSystemEventL |
|
1242 |
// ----------------------------------------------------------- |
|
1243 |
// |
|
1244 |
EXPORT_C void CPhoneState::HandleSystemEventL( const TWsEvent& /*aEvent*/ ) |
|
1245 |
{ |
|
1246 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleSystemEventL( ) "); |
|
1247 |
} |
|
1248 |
||
1249 |
// ----------------------------------------------------------- |
|
1250 |
// CPhoneState::HandleForegroundEventL |
|
1251 |
// ----------------------------------------------------------- |
|
1252 |
// |
|
1253 |
EXPORT_C void CPhoneState::HandleForegroundEventL( TBool aForeground ) |
|
1254 |
{ |
|
1255 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleForegroundEventL( ) "); |
|
1256 |
if ( !aForeground && IsNumberEntryUsedL() ) |
|
1257 |
{ |
|
1258 |
// Going out from foreground and number entry is open. |
|
1259 |
// Make sure that dtmf playing is stopped ( EEventKeyUp may be missed ). |
|
1260 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1261 |
} |
|
1262 |
} |
|
1263 |
||
1264 |
// ----------------------------------------------------------- |
|
1265 |
// CPhoneState::HandlePhoneForegroundEventL |
|
1266 |
// ----------------------------------------------------------- |
|
1267 |
// |
|
1268 |
EXPORT_C void CPhoneState::HandlePhoneForegroundEventL() |
|
1269 |
{ |
|
1270 |
} |
|
1271 |
||
1272 |
// ----------------------------------------------------------- |
|
1273 |
// CPhoneState::HandlePhoneFocusLostEventL |
|
1274 |
// ----------------------------------------------------------- |
|
1275 |
// |
|
1276 |
EXPORT_C void CPhoneState::HandlePhoneFocusLostEventL() |
|
1277 |
{ |
|
1278 |
// Notify that this method is called always when Idle is brought to foreground |
|
1279 |
// See implementation in CPhoneAppUI::HandleWsEventL |
|
1280 |
||
1281 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneFocusLostEventL( ) "); |
|
1282 |
// Phone app focus lost -> close Dtmf dialer when visible |
|
1283 |
if ( IsOnScreenDialerSupported() && IsDTMFEditorVisibleL() ) |
|
1284 |
{ |
|
1285 |
CloseDTMFEditorL(); |
|
1286 |
} |
|
1287 |
else if ( IsOnScreenDialerSupported() && IsCustomizedDialerVisibleL() ) |
|
1288 |
{ |
|
1289 |
CloseCustomizedDialerL(); |
|
1290 |
} |
|
1291 |
} |
|
1292 |
// --------------------------------------------------------- |
|
1293 |
// CPhoneState::HandleIdleForegroundEventL |
|
1294 |
// --------------------------------------------------------- |
|
1295 |
// |
|
1296 |
EXPORT_C void CPhoneState::HandleIdleForegroundEventL() |
|
1297 |
{ |
|
1298 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleIdleForegroundEventL( ) "); |
|
1299 |
// Empty implementation |
|
1300 |
} |
|
1301 |
||
1302 |
// ----------------------------------------------------------- |
|
1303 |
// CPhoneState::HandleEnvironmentChangeL |
|
1304 |
// ----------------------------------------------------------- |
|
1305 |
// |
|
1306 |
EXPORT_C void CPhoneState::HandleEnvironmentChangeL( const TInt aChanges ) |
|
1307 |
{ |
|
1308 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleEnvironmentChangeL( ) "); |
|
1309 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandleEnvironmentChangeL - Changes: %d ", aChanges ); |
|
1310 |
// Update the profile display if required |
|
1311 |
if ( aChanges & |
|
1312 |
( EChangesLocale | EChangesMidnightCrossover | EChangesSystemTime ) ) |
|
1313 |
{ |
|
1314 |
UpdateProfileDisplayL(); |
|
1315 |
} |
|
1316 |
} |
|
1317 |
||
1318 |
// ----------------------------------------------------------- |
|
1319 |
// CPhoneState::HandlePhoneStartupL |
|
1320 |
// ----------------------------------------------------------- |
|
1321 |
// |
|
1322 |
EXPORT_C void CPhoneState::HandlePhoneStartupL() |
|
1323 |
{ |
|
1324 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneStartupL( ) "); |
|
1325 |
// Empty implementation |
|
1326 |
} |
|
1327 |
||
1328 |
// ----------------------------------------------------------- |
|
1329 |
// CPhoneState::HandlePropertyChangedL |
|
1330 |
// ----------------------------------------------------------- |
|
1331 |
// |
|
1332 |
EXPORT_C void CPhoneState::HandlePropertyChangedL( |
|
1333 |
const TUid& aCategory, |
|
1334 |
const TUint aKey, |
|
1335 |
const TInt aValue ) |
|
1336 |
{ |
|
1337 |
||
1338 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePropertyChangedL( ) "); |
|
1339 |
||
1340 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1341 |
"CPhoneState::HandlePropertyChangedL - aCategory= %d", aCategory ); |
|
1342 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1343 |
"CPhoneState::HandlePropertyChangedL - aKey= %d", aKey ); |
|
1344 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1345 |
"CPhoneState::HandlePropertyChangedL - aValue= %d", aValue ); |
|
1346 |
if ( aCategory == KPSUidCtsyCallInformation ) |
|
1347 |
{ |
|
1348 |
// Call state event |
|
1349 |
if ( aKey == KCTsyCallState ) |
|
1350 |
{ |
|
1351 |
// Update the incall indicator |
|
1352 |
UpdateIncallIndicatorL( aValue ); |
|
1353 |
} |
|
1354 |
} |
|
1355 |
||
1356 |
// Telephony information category |
|
1357 |
else if ( aCategory == KPSUidTelInformation |
|
1358 |
&& SimState() == EPESimUsable ) |
|
1359 |
{ |
|
1360 |
// Telephony display event |
|
1361 |
if ( aKey == KTelDisplayInfo ) |
|
1362 |
{ |
|
1363 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::HandlePropertyChangedL - telephony display info received" ); |
|
1364 |
// Update the operator and profile display |
|
1365 |
UpdateProfileDisplayL(); |
|
1366 |
} |
|
1367 |
} |
|
1368 |
else if ( aCategory == KPSUidStartup && aKey == KStartupSimSecurityStatus ) |
|
1369 |
{ |
|
1370 |
// Show security note, SIM is not valid. |
|
1371 |
if ( aValue == ESimRejected || aValue == ESimUnaccepted ) |
|
1372 |
{ |
|
1373 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneStateStartup::HandlePropertyChangedL - SimSecurity status received" ); |
|
1374 |
StartShowSecurityNoteL(); |
|
1375 |
} |
|
1376 |
} |
|
1377 |
else if ( aCategory == KPSUidHWRM && aKey == KHWRMGripStatus ) |
|
1378 |
{ |
|
1379 |
UpdateCbaSwivelStateChangedL(); |
|
1380 |
} |
|
1381 |
} |
|
1382 |
||
1383 |
// ----------------------------------------------------------- |
|
1384 |
// CPhoneState::HandleCenRepChangeL |
|
1385 |
// ----------------------------------------------------------- |
|
1386 |
// |
|
1387 |
EXPORT_C void CPhoneState::HandleCenRepChangeL( |
|
1388 |
const TUid& /*aUid*/, |
|
1389 |
const TUint /*aId*/ ) |
|
1390 |
{ |
|
1391 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCenRepChangeL( ) "); |
|
1392 |
} |
|
1393 |
||
1394 |
// ----------------------------------------------------------- |
|
1395 |
// CPhoneState::NeedToSendToBackgroundL |
|
1396 |
// ----------------------------------------------------------- |
|
1397 |
// |
|
1398 |
EXPORT_C TBool CPhoneState::NeedToSendToBackgroundL() const |
|
1399 |
{ |
|
1400 |
return iViewCommandHandle->HandleCommandL( |
|
1401 |
EPhoneViewGetNeedToSendToBackgroundStatus ) == |
|
1402 |
EPhoneViewResponseSuccess; |
|
1403 |
} |
|
1404 |
||
1405 |
// ----------------------------------------------------------- |
|
1406 |
// CPhoneState::TopAppIsDisplayedL |
|
1407 |
// ----------------------------------------------------------- |
|
1408 |
// |
|
1409 |
EXPORT_C TBool CPhoneState::TopAppIsDisplayedL() const |
|
1410 |
{ |
|
1411 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TopAppIsDisplayedL( ) "); |
|
1412 |
return iViewCommandHandle->HandleCommandL( |
|
1413 |
EPhoneViewGetTopApplicationIsDisplayedStatus ) == |
|
1414 |
EPhoneViewResponseSuccess; |
|
1415 |
} |
|
1416 |
||
1417 |
// ----------------------------------------------------------- |
|
1418 |
// CPhoneState::TitlePaneIsVisibleL |
|
1419 |
// ----------------------------------------------------------- |
|
1420 |
// |
|
1421 |
TBool CPhoneState::TitlePaneIsVisibleL() const |
|
1422 |
{ |
|
1423 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TitlePaneIsVisibleL( ) "); |
|
1424 |
return iViewCommandHandle->HandleCommandL( |
|
1425 |
EPhoneViewGetTitlePaneIsVisibleStatus ) == |
|
1426 |
EPhoneViewResponseSuccess; |
|
1427 |
} |
|
1428 |
||
1429 |
// <---------------------------- MENU AND CBA EVENTS -------------------------> |
|
1430 |
||
1431 |
EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand ) |
|
1432 |
{ |
|
1433 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) "); |
|
1434 |
TBool commandStatus = ETrue; |
|
1435 |
switch( aCommand ) |
|
1436 |
{ |
|
1437 |
case EPhoneEmergencyCmdExit: |
|
1438 |
{ |
|
1439 |
//cancel emergency mode. |
|
1440 |
TPhoneCmdParamBoolean booleanParam; |
|
1441 |
booleanParam.SetBoolean( EFalse ); |
|
1442 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam ); |
|
1443 |
} |
|
1444 |
// this should be bypasses? |
|
1445 |
case EPhoneDialerCallHandling: |
|
1446 |
case EPhoneCmdBack: |
|
1447 |
BeginTransEffectLC( ENumberEntryClose ); |
|
1448 |
// Remove number entry from screen |
|
1449 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1450 |
// Do state-specific behaviour if number entry is cleared |
|
1451 |
HandleNumberEntryClearedL(); |
|
1452 |
EndTransEffect(); |
|
1453 |
break; |
|
1454 |
||
1455 |
case EPhoneDialerCmdTouchInput: |
|
1456 |
OpenVkbL(); |
|
1457 |
break; |
|
1458 |
||
1459 |
case EPhoneNumberAcqCmdSendMessage: |
|
1460 |
// Open the mms editor |
|
1461 |
iViewCommandHandle->ExecuteCommandL( |
|
1462 |
EPhoneViewSendMessage ); |
|
1463 |
if ( !IsOnScreenDialerSupported() ) |
|
1464 |
{ |
|
1465 |
// Remove number entry from screen |
|
1466 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1467 |
// Do state-specific behaviour if number entry is cleared |
|
1468 |
HandleNumberEntryClearedL(); |
|
1469 |
} |
|
1470 |
break; |
|
1471 |
||
1472 |
case EPhoneNumberAcqCmdSave: |
|
1473 |
// Open Create contact |
|
1474 |
iViewCommandHandle->ExecuteCommandL( |
|
1475 |
EPhoneViewAddContact ); |
|
1476 |
break; |
|
1477 |
||
1478 |
case EPhoneNumberAcqCmdAddToName: |
|
1479 |
// Open the message editor |
|
1480 |
iViewCommandHandle->ExecuteCommandL( |
|
1481 |
EPhoneViewUpdateContact ); |
|
1482 |
break; |
|
1483 |
||
1484 |
case EPhoneNumberAcqCmdAddToContacts: |
|
1485 |
{ |
|
1486 |
if ( IsOnScreenDialerSupported() ) |
|
1487 |
{ |
|
1488 |
TPhoneCmdParamQuery queryDialogParam; |
|
1489 |
queryDialogParam.SetQueryType( EPhoneContactsListQuery ); |
|
1490 |
queryDialogParam.SetQueryResourceId( |
|
1491 |
CPhoneMainResourceResolver::Instance()-> |
|
1492 |
ResolveResourceID( EPhoneAddtoContactsListQuery ) ); |
|
1493 |
||
1494 |
// Display dialog |
|
1495 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
1496 |
&queryDialogParam ); |
|
1497 |
} |
|
1498 |
} |
|
1499 |
break; |
|
1500 |
||
1501 |
case EPhoneCmdWaitNoteOk: |
|
1502 |
// Remove number entry from screen |
|
1503 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
1504 |
if ( !IsOnScreenDialerSupported() ) |
|
1505 |
{ |
|
1506 |
HandleNumberEntryClearedL(); |
|
1507 |
} |
|
1508 |
break; |
|
1509 |
||
1510 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
1511 |
DisconnectCallL(); |
|
1512 |
break; |
|
1513 |
||
1514 |
case EPhoneCmdYesAlsLineChange: |
|
1515 |
if( IsAlsLineChangePossible() ) |
|
1516 |
{ |
|
1517 |
ChangeAlsLineL(); |
|
1518 |
} |
|
1519 |
else |
|
1520 |
{ |
|
1521 |
SendGlobalErrorNoteL( EPhoneLineBlockingNote ); |
|
1522 |
HandleNumberEntryClearedL(); // Set back CBAs |
|
1523 |
} |
|
1524 |
break; |
|
1525 |
||
1526 |
case EPhoneCmdNoAlsLineChange: |
|
1527 |
if ( !IsOnScreenDialerSupported() ) |
|
1528 |
{ |
|
1529 |
HandleNumberEntryClearedL(); |
|
1530 |
} |
|
1531 |
break; |
|
1532 |
||
1533 |
case EPhoneCmdYesBtDisconnectQuery: |
|
1534 |
case EPhoneCmdNoBtDisconnectQuery: |
|
1535 |
CPhoneBtaaDisconnectHandler::InstanceL()->HandleQueryDismissL( aCommand ); |
|
1536 |
// Make sure that query is removed |
|
1537 |
// if there has been also another ( by Cover UI ). |
|
1538 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
1539 |
break; |
|
1540 |
||
1541 |
case EPhoneInCallCmdDeactivateIhf: // fall through |
|
1542 |
case EPhoneInCallCmdActivateIhf: |
|
1543 |
SetHandsfreeModeL( aCommand == EPhoneInCallCmdActivateIhf ); |
|
1544 |
break; |
|
1545 |
||
1546 |
case EPhoneInCallCmdHandset: // fall through |
|
1547 |
case EPhoneInCallCmdBtHandsfree: |
|
1548 |
CPhoneState::SetBTHandsfreeModeL( |
|
1549 |
aCommand == EPhoneInCallCmdBtHandsfree ); |
|
1550 |
break; |
|
1551 |
||
1552 |
case EPhoneInCallCmdActivatEPhonebook: |
|
1553 |
{ |
|
1554 |
// Launch Phonebook application |
|
1555 |
TPhoneCmdParamAppInfo appInfoParam; |
|
1556 |
appInfoParam.SetAppUid( KPhoneUidAppPhonebook ); |
|
1557 |
iViewCommandHandle->ExecuteCommandL( |
|
1558 |
EPhoneViewActivateApp, &appInfoParam ); |
|
1559 |
} |
|
1560 |
break; |
|
1561 |
||
1562 |
case EPhoneNumberAcqSecurityDialer: |
|
1563 |
{ |
|
1564 |
if ( IsOnScreenDialerSupported() && !IsNumberEntryUsedL() ) |
|
1565 |
{ |
|
1566 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
1567 |
TPhoneCmdParamBoolean visibleMode; |
|
1568 |
visibleMode.SetBoolean( ETrue ); |
|
1569 |
iViewCommandHandle->ExecuteCommandL( |
|
1570 |
EPhoneViewSetStatusPaneVisible, &visibleMode ); |
|
1571 |
||
1572 |
||
1573 |
// Set emergency CBA, empty - exit |
|
1574 |
iCbaManager->SetCbaL( EPhoneEmergencyModeNoteCBA ); |
|
1575 |
||
1576 |
// Set dialer to restricted mode. |
|
1577 |
TPhoneCmdParamBoolean booleanParam; |
|
1578 |
booleanParam.SetBoolean( ETrue ); |
|
1579 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam ); |
|
1580 |
||
1581 |
NumberEntryManagerL()->CreateNumberEntryL(); |
|
1582 |
} |
|
1583 |
} |
|
1584 |
break; |
|
1585 |
||
1586 |
case EPhoneDialerCmdContacts: |
|
1587 |
{ |
|
1588 |
// Launch Phonebook application |
|
1589 |
TPhoneCmdParamAppInfo appInfoParam; |
|
1590 |
appInfoParam.SetAppUid( KPhoneUidAppPhonebook ); |
|
1591 |
iViewCommandHandle->ExecuteCommandL( |
|
1592 |
EPhoneViewActivateApp, &appInfoParam ); |
|
1593 |
} |
|
1594 |
break; |
|
1595 |
||
1596 |
case EPhoneViewYesSingleItemFetch: |
|
1597 |
{ |
|
1598 |
if ( IsOnScreenDialerSupported() ) |
|
1599 |
{ |
|
1600 |
TBuf<KPhoneNumberEntryBufferSize> fetchContent; |
|
1601 |
fetchContent = iViewCommandHandle->FetchContent(); |
|
1602 |
if ( fetchContent.Length() ) |
|
1603 |
{ |
|
1604 |
iViewCommandHandle->ExecuteCommandL( |
|
1605 |
EPhoneViewSetNumberEntryContent, |
|
1606 |
0, |
|
1607 |
fetchContent ); |
|
1608 |
||
1609 |
CallFromNumberEntryL(); |
|
1610 |
} |
|
1611 |
} |
|
1612 |
} |
|
1613 |
break; |
|
1614 |
case EPhoneNumberAcqCmdToggleNeAlphaMode: |
|
1615 |
case EPhoneNumberAcqCmdToggleNeNumericMode: |
|
1616 |
{ |
|
1617 |
// Toggle mode |
|
1618 |
NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL(); |
|
1619 |
} |
|
1620 |
break; |
|
1621 |
||
1622 |
case EPhoneCmdYesVideoFailedNoMemorySwitchToVoice: |
|
1623 |
DialVoiceCallL(); |
|
1624 |
break; |
|
1625 |
||
1626 |
case EPhoneCmdNoVideoFailedNoMemorySwitchToVoice: |
|
1627 |
if ( IsNumberEntryUsedL() ) |
|
1628 |
{ |
|
1629 |
// Show the number entry if it exists |
|
1630 |
SetNumberEntryVisibilityL(ETrue); |
|
1631 |
} |
|
1632 |
else if ( NeedToSendToBackgroundL() ) |
|
1633 |
{ |
|
1634 |
// Continue displaying current app but set up the |
|
1635 |
// idle screen in the background |
|
1636 |
SetupIdleScreenInBackgroundL(); |
|
1637 |
} |
|
1638 |
else |
|
1639 |
{ |
|
1640 |
// Display idle screen |
|
1641 |
DisplayIdleScreenL(); |
|
1642 |
} |
|
1643 |
break; |
|
1644 |
||
1645 |
case EPhoneInCallCmdSetVolumeLevel: |
|
1646 |
{ |
|
1647 |
// This command comes from ui control, no need to update |
|
1648 |
// value to control (second parameter set false). |
|
1649 |
ChangeAudioVolumeL( GetVolumeLevel(), EFalse ); |
|
1650 |
} |
|
1651 |
break; |
|
1652 |
||
1653 |
case EPhoneDialerCmdHelp: |
|
1654 |
if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) |
|
1655 |
{ |
|
1656 |
TPtrC contextName; |
|
1657 |
contextName.Set( KDATA_DIALER_HLP_MAIN() ); |
|
1658 |
iViewCommandHandle->ExecuteCommandL( |
|
1659 |
EPhoneViewLaunchHelpApplication, 0, contextName ); |
|
1660 |
} |
|
1661 |
break; |
|
1662 |
||
1663 |
case EPhoneCmdVideoCallOutOfMemory: |
|
1664 |
ShowVideoCallOutOfMemoryNoteL(); |
|
1665 |
DisconnectCallL(); |
|
1666 |
break; |
|
1667 |
||
1668 |
case EPhoneCallComingCmdSoftReject: |
|
1669 |
// Open Soft reject message editor |
|
1670 |
OpenSoftRejectMessageEditorL(); |
|
1671 |
break; |
|
1672 |
||
1673 |
case EPhoneInCallCmdContacts: |
|
1674 |
iViewCommandHandle->ExecuteCommand( EPhoneViewOpenContacts ); |
|
1675 |
break; |
|
1676 |
||
1677 |
default: |
|
1678 |
||
1679 |
/*if ( IsOnScreenDialerSupported() ) |
|
1680 |
{ |
|
1681 |
// Offer command to view. |
|
1682 |
TPhoneViewResponseId resId = |
|
1683 |
iViewCommandHandle->HandleCommandL( aCommand ); |
|
1684 |
||
1685 |
if( resId == EPhoneViewResponseFailed ) |
|
1686 |
{ |
|
1687 |
commandStatus = EFalse; |
|
1688 |
} |
|
1689 |
} |
|
1690 |
else*/ |
|
1691 |
||
1692 |
{ |
|
1693 |
commandStatus = EFalse; |
|
1694 |
} |
|
1695 |
break; |
|
1696 |
} |
|
1697 |
||
1698 |
if( !commandStatus && iCustomization ) |
|
1699 |
{ |
|
1700 |
commandStatus = iCustomization->HandleCommandL( aCommand ); |
|
1701 |
} |
|
1702 |
||
1703 |
return commandStatus; |
|
1704 |
} |
|
1705 |
||
1706 |
// ----------------------------------------------------------------------------- |
|
1707 |
// CPhoneState::ProcessCommandL |
|
1708 |
// ----------------------------------------------------------------------------- |
|
1709 |
// |
|
1710 |
EXPORT_C TBool CPhoneState::ProcessCommandL( TInt /*aCommand*/ ) |
|
1711 |
{ |
|
1712 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL() "); |
|
1713 |
// no implementation. |
|
1714 |
return EFalse; |
|
1715 |
} |
|
1716 |
||
1717 |
// <-------------------------- REMOTE CONTROL EVENTS -------------------------> |
|
1718 |
||
1719 |
// ----------------------------------------------------------------------------- |
|
1720 |
// CPhoneState::HandleRemConCommandL |
|
1721 |
// ----------------------------------------------------------------------------- |
|
1722 |
// |
|
1723 |
EXPORT_C TBool CPhoneState::HandleRemConCommandL( |
|
1724 |
TRemConCoreApiOperationId aOperationId, |
|
1725 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
1726 |
{ |
|
1727 |
TBool handled = EFalse; |
|
1728 |
||
1729 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::MrccatoCommand() "); |
|
1730 |
switch ( aOperationId ) |
|
1731 |
{ |
|
1732 |
case ERemConCoreApiVolumeUp: |
|
1733 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeUp" ); |
|
1734 |
IncreaseAudioVolumeL(); |
|
1735 |
handled = ETrue; |
|
1736 |
break; |
|
1737 |
||
1738 |
case ERemConCoreApiVolumeDown: |
|
1739 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeDown" ); |
|
1740 |
DecreaseAudioVolumeL(); |
|
1741 |
handled = ETrue; |
|
1742 |
break; |
|
1743 |
case ERemConCoreApiMute: |
|
1744 |
{ |
|
1745 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiMute" ); |
|
1746 |
iStateMachine->PhoneEngineInfo()->AudioMute() ? |
|
1747 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( EFalse ): |
|
1748 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( ETrue ); |
|
1749 |
iStateMachine->SendPhoneEngineMessage( |
|
1750 |
MPEPhoneModel::EPEMessageSetAudioMute ); |
|
1751 |
handled = ETrue; |
|
1752 |
break; |
|
1753 |
} |
|
1754 |
||
1755 |
default: |
|
1756 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand MrccatoCmd.Other(%d)", aOperationId ); |
|
1757 |
// Other commands ignored. |
|
1758 |
break; |
|
1759 |
} |
|
1760 |
||
1761 |
return handled; |
|
1762 |
} |
|
1763 |
||
1764 |
// ----------------------------------------------------------- |
|
1765 |
// CPhoneState::DecreaseAudioVolume() |
|
1766 |
// ----------------------------------------------------------- |
|
1767 |
// |
|
1768 |
EXPORT_C void CPhoneState::DecreaseAudioVolumeL() |
|
1769 |
{ |
|
1770 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DecreaceAudioVolumeL( ) "); |
|
1771 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1772 |
Panic( EPhoneCtrlInvariant ) ); |
|
1773 |
||
1774 |
TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
1775 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::DecreaseAudioVolumeL - audio output =%d", output ); |
|
1776 |
if( output == EPETTY ) |
|
1777 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1778 |
SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl, ETrue ); |
37 | 1779 |
} |
1780 |
else |
|
1781 |
{ |
|
1782 |
TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() ); |
|
1783 |
audioVolume--; |
|
1784 |
ChangeAudioVolumeL( audioVolume, ETrue ); |
|
1785 |
} |
|
1786 |
} |
|
1787 |
||
1788 |
// ----------------------------------------------------------- |
|
1789 |
// CPhoneState::IncreaceAudioVolume() |
|
1790 |
// ----------------------------------------------------------- |
|
1791 |
// |
|
1792 |
EXPORT_C void CPhoneState::IncreaseAudioVolumeL() |
|
1793 |
{ |
|
1794 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IncreaceAudioVolumeL( ) "); |
|
1795 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1796 |
Panic( EPhoneCtrlInvariant ) ); |
|
1797 |
||
1798 |
TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() ); |
|
1799 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IncreaseAudioVolumeL - audio output =%d", output ); |
|
1800 |
if( output == EPETTY ) |
|
1801 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1802 |
SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl, ETrue ); |
37 | 1803 |
} |
1804 |
else |
|
1805 |
{ |
|
1806 |
TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() ); |
|
1807 |
audioVolume++; |
|
1808 |
ChangeAudioVolumeL( audioVolume, ETrue ); |
|
1809 |
} |
|
1810 |
} |
|
1811 |
||
1812 |
// ----------------------------------------------------------- |
|
1813 |
// CPhoneState::ChangeAudioVolumeL() |
|
1814 |
// ----------------------------------------------------------- |
|
1815 |
// |
|
1816 |
void CPhoneState::ChangeAudioVolumeL( TInt aLevel, TBool aUpdateControl ) |
|
1817 |
{ |
|
1818 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAudioVolumeL( ) "); |
|
1819 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::ChangeAudioVolumeL - set volume =%d", aLevel ); |
|
1820 |
||
1821 |
TInt valueToControl = aLevel; |
|
1822 |
||
1823 |
// sets value between 1 -10 |
|
1824 |
if ( aLevel>=KPhoneVolumeMinValue && aLevel<=KPhoneVolumeMaxValue ) |
|
1825 |
{ |
|
1826 |
iStateMachine->PhoneEngineInfo()->SetAudioVolumeCommand( aLevel ); |
|
1827 |
// Syncronizes audio volume level between engine and ui |
|
1828 |
// causes EPEMessageAudioVolumeChanged message to phoneUI |
|
1829 |
iStateMachine->SendPhoneEngineMessage( |
|
1830 |
MPEPhoneModel::EPEMessageSetAudioVolume ); |
|
1831 |
} |
|
1832 |
||
1833 |
if ( aUpdateControl ) |
|
1834 |
{ |
|
1835 |
// Update the volume display. |
|
1836 |
// Upper max (11) and under min (-1) |
|
1837 |
// values are also updated to volume popup. |
|
1838 |
TPhoneCmdParamInteger volumeParam; |
|
1839 |
volumeParam.SetInteger( valueToControl ); |
|
1840 |
iViewCommandHandle->ExecuteCommandL( |
|
1841 |
EPhoneViewSetNaviPaneAudioVolume, |
|
1842 |
&volumeParam ); |
|
1843 |
} |
|
1844 |
} |
|
1845 |
||
1846 |
// <-------------------------- COMMON STATE FUNCTIONS ------------------------> |
|
1847 |
||
1848 |
// ----------------------------------------------------------- |
|
1849 |
// CPhoneState::DialMultimediaCallL |
|
1850 |
// ----------------------------------------------------------- |
|
1851 |
// |
|
1852 |
EXPORT_C void CPhoneState::DialMultimediaCallL() |
|
1853 |
{ |
|
1854 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() "); |
|
1855 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1856 |
Panic( EPhoneCtrlInvariant ) ); |
|
1857 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVideo ); |
|
1858 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
1859 |
} |
|
1860 |
||
1861 |
// ----------------------------------------------------------- |
|
1862 |
// CPhoneState::DialVoiceCallL |
|
1863 |
// ----------------------------------------------------------- |
|
1864 |
// |
|
1865 |
EXPORT_C void CPhoneState::DialVoiceCallL() |
|
1866 |
{ |
|
1867 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
|
1868 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1869 |
Panic( EPhoneCtrlInvariant ) ); |
|
1870 |
||
1871 |
// Disable global notes |
|
1872 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
1873 |
globalNotifierParam.SetBoolean( ETrue ); |
|
1874 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
1875 |
&globalNotifierParam ); |
|
1876 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
|
1877 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
1878 |
} |
|
1879 |
||
1880 |
// ----------------------------------------------------------- |
|
1881 |
// CPhoneState::DisconnectCallL |
|
1882 |
// ----------------------------------------------------------- |
|
1883 |
// |
|
1884 |
EXPORT_C TBool CPhoneState::DisconnectCallL() |
|
1885 |
{ |
|
1886 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
|
1887 |
TPhoneCmdParamInteger callIdParam; |
|
1888 |
iViewCommandHandle->ExecuteCommandL( |
|
1889 |
EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
|
1890 |
||
1891 |
TBool ret = EFalse; |
|
1892 |
if( callIdParam.Integer() > KErrNotFound ) |
|
1893 |
{ |
|
1894 |
// Release the call |
|
1895 |
iStateMachine->SetCallId( callIdParam.Integer() ); |
|
1896 |
||
1897 |
if( IsVideoCall( callIdParam.Integer() ) ) |
|
1898 |
{ |
|
1899 |
// Video call can be released only after we get response to VT Shutdown Command |
|
1900 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
|
1901 |
KCatPhoneToVideotelCommands, |
|
1902 |
EVtCmdReleaseDataport, |
|
1903 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
1904 |
KPhoneToVideotelCmdVersionMinor, |
|
1905 |
KPhoneToVideotelCmdVersionBuild ), |
|
1906 |
KNullDesC8, |
|
1907 |
CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
|
1908 |
} |
|
1909 |
else |
|
1910 |
{ |
|
1911 |
// Release the call |
|
1912 |
iStateMachine->SendPhoneEngineMessage( |
|
1913 |
MPEPhoneModel::EPEMessageRelease ); |
|
1914 |
} |
|
1915 |
ret = ETrue; |
|
1916 |
} |
|
1917 |
else |
|
1918 |
{ |
|
1919 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
1920 |
"CPhoneState::DisconnectCallL has negative call id!" ); |
|
1921 |
} |
|
1922 |
||
1923 |
return ret; |
|
1924 |
} |
|
1925 |
||
1926 |
// ----------------------------------------------------------- |
|
1927 |
// CPhoneState::DisplayIdleScreenL |
|
1928 |
// ----------------------------------------------------------- |
|
1929 |
// |
|
1930 |
EXPORT_C void CPhoneState::DisplayIdleScreenL() |
|
1931 |
{ |
|
1932 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayIdleScreenL( ) "); |
|
1933 |
||
1934 |
// Don't remove reconnect query if it's shown |
|
1935 |
if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() ) |
|
1936 |
{ |
|
1937 |
// Remove dialogs if necessary |
|
1938 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1939 |
} |
|
1940 |
||
1941 |
// Set Empty CBA |
|
1942 |
iCbaManager->SetCbaL( EPhoneEmptyCBA ); |
|
1943 |
// Bring Idle app to the foreground |
|
1944 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
1945 |
} |
|
1946 |
||
1947 |
// ----------------------------------------------------------- |
|
1948 |
// CPhoneState::SetupIdleScreenInBackgroundL() |
|
1949 |
// ----------------------------------------------------------- |
|
1950 |
// |
|
1951 |
EXPORT_C void CPhoneState::SetupIdleScreenInBackgroundL() |
|
1952 |
{ |
|
1953 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetupIdleScreenInBackgroundL( ) "); |
|
1954 |
// Don't remove reconnect query if it's shown |
|
1955 |
if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() ) |
|
1956 |
{ |
|
1957 |
// Remove dialogs if necessary |
|
1958 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1959 |
} |
|
1960 |
// Return phone to the background |
|
1961 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
1962 |
||
1963 |
// Set Idle app as the top app |
|
1964 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication ); |
|
1965 |
||
1966 |
// Set Empty CBA |
|
1967 |
iCbaManager->SetCbaL( EPhoneEmptyCBA ); |
|
1968 |
} |
|
1969 |
||
1970 |
// --------------------------------------------------------- |
|
1971 |
// CPhoneState::CallFromNumberEntryL |
|
1972 |
// --------------------------------------------------------- |
|
1973 |
// |
|
1974 |
EXPORT_C void CPhoneState::CallFromNumberEntryL() |
|
1975 |
{ |
|
1976 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallFromNumberEntryL( ) "); |
|
1977 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1978 |
Panic( EPhoneCtrlInvariant ) ); |
|
1979 |
||
1980 |
if ( IsOnScreenDialerSupported() ) |
|
1981 |
{ |
|
1982 |
if ( IsDTMFEditorVisibleL() || |
|
1983 |
IsCustomizedDialerVisibleL() ) |
|
1984 |
{ |
|
1985 |
return; |
|
1986 |
} |
|
1987 |
||
1988 |
else if( IsNumberEntryUsedL() ) |
|
1989 |
{ |
|
1990 |
// Query on top of dialer |
|
1991 |
if ( IsAnyQueryActiveL() ) |
|
1992 |
{ |
|
1993 |
return; |
|
1994 |
} |
|
1995 |
else if ( IsMenuBarVisibleL() ) |
|
1996 |
{ |
|
1997 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
1998 |
return; |
|
1999 |
} |
|
2000 |
// Open recent calls list when the number entry is empty |
|
2001 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
2002 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
2003 |
&numberEntryCountParam ); |
|
2004 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
2005 |
TBool startLogs = neLength == 0 ? ETrue : EFalse; |
|
2006 |
||
2007 |
if ( startLogs ) |
|
2008 |
{ |
|
2009 |
iViewCommandHandle->HandleCommandL( |
|
2010 |
EPhoneDialerCmdLog ); |
|
2011 |
return; |
|
2012 |
} |
|
2013 |
} |
|
2014 |
} |
|
2015 |
||
2016 |
// Get the number entry contents |
|
2017 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
2018 |
||
2019 |
// Call the number |
|
2020 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
2021 |
||
2022 |
if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
2023 |
{ |
|
2024 |
// Closing effect is shown when dialer exist. |
|
2025 |
BeginTransEffectLC( ENumberEntryClose ); |
|
2026 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
2027 |
EndTransEffect(); |
|
2028 |
||
2029 |
HandleNumberEntryClearedL(); |
|
2030 |
} |
|
2031 |
||
2032 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
2033 |
||
2034 |
if ( !iCustomization || |
|
2035 |
!iCustomization->HandleCallFromNumberEntryL() ) |
|
2036 |
{ |
|
2037 |
// Customization didn't handle call. Dial voice call |
|
2038 |
// as normally |
|
2039 |
DialVoiceCallL(); |
|
2040 |
} |
|
2041 |
||
2042 |
} |
|
2043 |
||
2044 |
// ----------------------------------------------------------- |
|
2045 |
// CPhoneState::DisplayHeaderForCallComingInL |
|
2046 |
// ----------------------------------------------------------- |
|
2047 |
// |
|
2048 |
EXPORT_C void CPhoneState::DisplayHeaderForCallComingInL( |
|
2049 |
TInt aCallId, |
|
2050 |
TBool aWaitingCall ) |
|
2051 |
{ |
|
2052 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForCallComingInL( ) "); |
|
2053 |
CallheaderManagerL()->DisplayHeaderForCallComingInL( aCallId, aWaitingCall ); |
|
2054 |
} |
|
2055 |
||
2056 |
// ----------------------------------------------------------- |
|
2057 |
// CPhoneState::SetCallHeaderTextsForCallComingInL |
|
2058 |
// ----------------------------------------------------------- |
|
2059 |
// |
|
2060 |
EXPORT_C void CPhoneState::SetCallHeaderTextsForCallComingInL( |
|
2061 |
TInt aCallId, |
|
2062 |
TBool aWaitingCall, |
|
2063 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
2064 |
{ |
|
2065 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetCallHeaderTextsForCallComingInL( ) "); |
|
2066 |
CallheaderManagerL()->SetCallHeaderTextsForCallComingIn( aCallId, aWaitingCall, aCallHeaderData ); |
|
2067 |
} |
|
2068 |
||
2069 |
// ----------------------------------------------------------- |
|
2070 |
// CPhoneState::DisplayHeaderForOutgoingCallL |
|
2071 |
// ----------------------------------------------------------- |
|
2072 |
// |
|
2073 |
EXPORT_C void CPhoneState::DisplayHeaderForOutgoingCallL( |
|
2074 |
TInt aCallId ) |
|
2075 |
{ |
|
2076 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForOutgoingCallL( ) "); |
|
2077 |
CallheaderManagerL()->DisplayHeaderForOutgoingCallL(aCallId); |
|
2078 |
} |
|
2079 |
||
2080 |
// ----------------------------------------------------------- |
|
2081 |
// CPhoneState::UpdateSingleActiveCallL |
|
2082 |
// ----------------------------------------------------------- |
|
2083 |
// |
|
2084 |
EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId ) |
|
2085 |
{ |
|
2086 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) "); |
|
2087 |
||
2088 |
// Stop capturing keys |
|
2089 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
2090 |
||
2091 |
BeginUiUpdateLC(); |
|
2092 |
||
2093 |
// Update call state |
|
2094 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
2095 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
2096 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
2097 |
&callHeaderParam ); |
|
2098 |
||
2099 |
// Update remote info data |
|
2100 |
UpdateRemoteInfoDataL( aCallId ); |
|
2101 |
||
2102 |
// Create call duration label if enabled |
|
2103 |
// This key will be moved to some other area, but since key |
|
2104 |
// is supported we can still use it. |
|
2105 |
TBool callDuration( EFalse ); |
|
2106 |
CPhoneCenRepProxy::Instance()->GetInt( |
|
2107 |
KCRUidLogs, KLogsShowCallDuration, callDuration ); |
|
2108 |
||
2109 |
if ( callDuration ) |
|
2110 |
{ |
|
2111 |
HandleChangedCallDurationL( aCallId ); |
|
2112 |
} |
|
2113 |
||
2114 |
EndUiUpdate(); |
|
2115 |
||
2116 |
// Go to current state implementation |
|
2117 |
iCbaManager->UpdateInCallCbaL(); |
|
2118 |
||
2119 |
//Update state of switch to video or voice call touch button. |
|
2120 |
TPECallType type = iStateMachine->PhoneEngineInfo()->CallType( aCallId ); |
|
2121 |
||
2122 |
if( type == EPECallTypeVideo ) |
|
2123 |
{ |
|
2124 |
TPhoneCmdParamBoolean booleanParam; |
|
2125 |
booleanParam.SetBoolean( ETrue ); |
|
2126 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam ); |
|
2127 |
} |
|
2128 |
else |
|
2129 |
{ |
|
2130 |
TPhoneCmdParamBoolean booleanParam; |
|
2131 |
booleanParam.SetBoolean( EFalse ); |
|
2132 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam ); |
|
2133 |
} |
|
2134 |
||
2135 |
// Go to background if necessary |
|
2136 |
if ( NeedToSendToBackgroundL() || IsAutoLockOn() ) |
|
2137 |
{ |
|
2138 |
// If number entry is used set control and visibility. |
|
2139 |
if ( IsNumberEntryUsedL() ) |
|
2140 |
{ |
|
2141 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility ); |
|
2142 |
} |
|
2143 |
} |
|
2144 |
// If there is no need to send back ground and number entry is used then |
|
2145 |
// we must show number entry. |
|
2146 |
else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() ) |
|
2147 |
{ |
|
2148 |
SetNumberEntryVisibilityL(ETrue); |
|
2149 |
} |
|
2150 |
} |
|
2151 |
||
2152 |
// ----------------------------------------------------------- |
|
2153 |
// CPhoneState::CaptureKeysDuringCallNotificationL |
|
2154 |
// ----------------------------------------------------------- |
|
2155 |
// |
|
2156 |
EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL( |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2157 |
TBool /*aCaptured*/ ) |
37 | 2158 |
{ |
2159 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) "); |
|
2160 |
// 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
|
2161 |
/*const TInt viewCommandId = aCaptured ? |
37 | 2162 |
EPhoneViewStartCapturingKey : |
2163 |
EPhoneViewStopCapturingKey; |
|
2164 |
||
2165 |
// Capture the App key |
|
2166 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
2167 |
appKeyCaptureParam.SetKey( EStdKeyApplication0 ); |
|
2168 |
appKeyCaptureParam.SetKeyCode( EKeyApplication0 ); |
|
2169 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
2170 |
iViewCommandHandle->ExecuteCommandL( viewCommandId, &appKeyCaptureParam ); |
|
2171 |
||
2172 |
// Capture the Camera key, if it exists |
|
2173 |
if ( FeatureManager::FeatureSupported( KFeatureIdCamera ) ) |
|
2174 |
{ |
|
2175 |
TPhoneCmdParamKeyCapture cameraKeyCaptureParam; |
|
2176 |
cameraKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
2177 |
cameraKeyCaptureParam.SetKeyCode( EKeyDevice7 ); |
|
2178 |
cameraKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
2179 |
iViewCommandHandle->ExecuteCommandL( viewCommandId, |
|
2180 |
&cameraKeyCaptureParam ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2181 |
}*/ |
37 | 2182 |
} |
2183 |
||
2184 |
// ----------------------------------------------------------- |
|
2185 |
// CPhoneState::IsWaitingCallL |
|
2186 |
// ----------------------------------------------------------- |
|
2187 |
// |
|
2188 |
TBool CPhoneState::IsWaitingCallL( const TInt aCallId ) |
|
2189 |
{ |
|
2190 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsWaitingCallL( ) "); |
|
2191 |
return CallheaderManagerL()->IsWaitingCallL( aCallId ); |
|
2192 |
} |
|
2193 |
||
2194 |
// ----------------------------------------------------------- |
|
2195 |
// CPhoneState::UpdateCallHeaderInfoL |
|
2196 |
// ----------------------------------------------------------- |
|
2197 |
// |
|
2198 |
TPhoneCmdParamCallHeaderData CPhoneState::UpdateCallHeaderInfoL( TInt aCallId ) |
|
2199 |
{ |
|
2200 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateCallHeaderInfoL( ) "); |
|
2201 |
return CallheaderManagerL()->UpdateCallHeaderInfoL( aCallId ); |
|
2202 |
} |
|
2203 |
||
2204 |
// ----------------------------------------------------------- |
|
2205 |
// CPhoneState::UpdateRemoteInfoDataL |
|
2206 |
// ----------------------------------------------------------- |
|
2207 |
// |
|
2208 |
EXPORT_C void CPhoneState::UpdateRemoteInfoDataL( TInt aCallId ) |
|
2209 |
{ |
|
2210 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::UpdateRemoteInfoDataL() "); |
|
2211 |
TPhoneCmdParamCallHeaderData callHeaderParam = UpdateCallHeaderInfoL( aCallId ); |
|
2212 |
||
2213 |
if( iCustomization ) |
|
2214 |
{ |
|
2215 |
TBuf<KCntMaxTextFieldLength> inCallNumberText( KNullDesC ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2216 |
|
37 | 2217 |
// to check if we have VoIP call in question and fix |
2218 |
// parameters if needed |
|
2219 |
iCustomization->ModifyCallHeaderTexts( aCallId, &callHeaderParam, |
|
2220 |
inCallNumberText ); |
|
2221 |
} |
|
2222 |
||
2223 |
||
2224 |
// Update the remote info data in the call header |
|
2225 |
iViewCommandHandle->ExecuteCommandL( |
|
2226 |
EPhoneViewUpdateCallHeaderRemoteInfoData, |
|
2227 |
aCallId, |
|
2228 |
&callHeaderParam ); |
|
2229 |
} |
|
2230 |
||
2231 |
// ----------------------------------------------------------- |
|
2232 |
// CPhoneState::SetCallHeaderType |
|
2233 |
// ----------------------------------------------------------- |
|
2234 |
// |
|
2235 |
EXPORT_C void CPhoneState::SetCallHeaderType( |
|
2236 |
TInt aCallHeaderType ) |
|
2237 |
{ |
|
2238 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetCallHeaderType() "); |
|
2239 |
TRAP_IGNORE( CallheaderManagerL()->SetCallHeaderType( aCallHeaderType ) ); |
|
2240 |
} |
|
2241 |
||
2242 |
// ----------------------------------------------------------- |
|
2243 |
// CPhoneState::GetRemoteInfoDataL |
|
2244 |
// ----------------------------------------------------------- |
|
2245 |
// |
|
2246 |
EXPORT_C void CPhoneState::GetRemoteInfoDataL( |
|
2247 |
TInt aCallId, |
|
2248 |
TDes& aData ) |
|
2249 |
{ |
|
2250 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::GetRemoteInfoDataL() "); |
|
2251 |
CallheaderManagerL()->GetRemoteInfoDataL( aCallId, aData ); |
|
2252 |
} |
|
2253 |
||
2254 |
// ----------------------------------------------------------- |
|
2255 |
// CPhoneState::UpdateCbaSwivelStateChangedL |
|
2256 |
// ----------------------------------------------------------- |
|
2257 |
// |
|
2258 |
void CPhoneState::UpdateCbaSwivelStateChangedL() |
|
2259 |
{ |
|
2260 |
__LOGMETHODSTARTEND(EPhoneControl,"CPhoneState::UpdateCbaSwivelStateChangedL()" ); |
|
2261 |
||
2262 |
TPhoneCmdParamCallStateData callStateData; |
|
2263 |
callStateData.SetCallState( EPEStateRinging ); |
|
2264 |
iViewCommandHandle->HandleCommandL( |
|
2265 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
2266 |
TInt incomingCall = callStateData.CallId(); |
|
2267 |
||
2268 |
TPhoneCmdParamInteger activeCallCount; |
|
2269 |
iViewCommandHandle->ExecuteCommandL( |
|
2270 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
2271 |
||
2272 |
if ( incomingCall > KErrNotFound ) |
|
2273 |
{ |
|
2274 |
if( activeCallCount.Integer() == ENoActiveCalls ) |
|
2275 |
{ |
|
2276 |
iCbaManager->UpdateIncomingCbaL( incomingCall ); |
|
2277 |
UpdateSilenceButtonDimming(); |
|
2278 |
} |
|
2279 |
else |
|
2280 |
{ |
|
2281 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
2282 |
} |
|
2283 |
} |
|
2284 |
else if ( activeCallCount.Integer() != ENoActiveCalls ) |
|
2285 |
{ |
|
2286 |
iCbaManager->UpdateInCallCbaL(); |
|
2287 |
} |
|
2288 |
} |
|
2289 |
||
2290 |
// ----------------------------------------------------------------------------- |
|
2291 |
// CPhoneState::IsSwivelClosed |
|
2292 |
// This function checks from PubSubProxy that is |
|
2293 |
// Swivel closed or not in product. |
|
2294 |
// |
|
2295 |
// ----------------------------------------------------------------------------- |
|
2296 |
// |
|
2297 |
EXPORT_C TBool CPhoneState::IsSwivelClosed() const |
|
2298 |
{ |
|
2299 |
if( CPhoneCenRepProxy::Instance()-> |
|
2300 |
IsTelephonyFeatureSupported( KTelephonyLVFlagSwivelInDevice )) |
|
2301 |
{ |
|
2302 |
return CPhonePubSubProxy::Instance()-> |
|
2303 |
Value( KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed; |
|
2304 |
} |
|
2305 |
else |
|
2306 |
{ |
|
2307 |
return EFalse; |
|
2308 |
} |
|
2309 |
} |
|
2310 |
||
2311 |
// <-------------------------- CONTEXT MENU -------------------------> |
|
2312 |
||
2313 |
// ----------------------------------------------------------------------------- |
|
2314 |
// CPhoneState::SetContextMenu |
|
2315 |
// ----------------------------------------------------------------------------- |
|
2316 |
// |
|
2317 |
EXPORT_C void CPhoneState::SetContextMenuL( TInt aResourceId ) |
|
2318 |
{ |
|
2319 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetContextMenuL() "); |
|
2320 |
||
2321 |
TPhoneCmdParamInteger integerParam; |
|
2322 |
TInt resId( CPhoneMainResourceResolver::Instance()-> |
|
2323 |
ResolveResourceID( aResourceId ) ); |
|
2324 |
integerParam.SetInteger( resId ); |
|
2325 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2326 |
"CPhoneState::SetContextMenuL : resId =%d",resId ); |
|
2327 |
||
2328 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateContextMenu, |
|
2329 |
&integerParam ); |
|
2330 |
} |
|
2331 |
// ----------------------------------------------------------------------------- |
|
2332 |
// CPhoneState::UpdateInCallContextMenuL |
|
2333 |
// ----------------------------------------------------------------------------- |
|
2334 |
// |
|
2335 |
EXPORT_C void CPhoneState::UpdateInCallContextMenuL() |
|
2336 |
{ |
|
2337 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateInCallContextMenuL() "); |
|
2338 |
||
2339 |
SetContextMenuL( EPhoneNumberAcqMenubar ); |
|
2340 |
||
2341 |
} |
|
2342 |
||
2343 |
// ----------------------------------------------------------------------------- |
|
2344 |
// CPhoneState::UpdateIncomingContextMenuL |
|
2345 |
// ----------------------------------------------------------------------------- |
|
2346 |
// |
|
2347 |
EXPORT_C void CPhoneState::UpdateIncomingContextMenuL( TInt aCallId ) |
|
2348 |
{ |
|
2349 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncomingContextMenuL() "); |
|
2350 |
||
2351 |
if( CPhoneState::IsVideoCall ( aCallId ) ) |
|
2352 |
{ |
|
2353 |
SetContextMenuL( EPhoneIncomingVideoCallMenubar ); |
|
2354 |
} |
|
2355 |
else |
|
2356 |
{ |
|
2357 |
SetContextMenuL( EPhoneIncomingCallMenubar ); |
|
2358 |
} |
|
2359 |
||
2360 |
} |
|
2361 |
||
2362 |
// ----------------------------------------------------------- |
|
2363 |
// CPhoneState::ShowNoteL |
|
2364 |
// ----------------------------------------------------------- |
|
2365 |
// |
|
2366 |
EXPORT_C void CPhoneState::ShowNoteL( TInt aResourceId ) |
|
2367 |
{ |
|
2368 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNoteL( ) "); |
|
2369 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2370 |
TPhoneCmdParamNote noteParam; |
|
2371 |
noteParam.SetType( EPhoneNotePermanent ); |
|
2372 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2373 |
ResolveResourceID( aResourceId ) ); |
|
2374 |
||
2375 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
2376 |
} |
|
2377 |
||
2378 |
// ----------------------------------------------------------- |
|
2379 |
// CPhoneState::ShowQueryL |
|
2380 |
// ----------------------------------------------------------- |
|
2381 |
// |
|
2382 |
EXPORT_C void CPhoneState::ShowQueryL( TInt aResourceId ) |
|
2383 |
{ |
|
2384 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowQueryL( ) "); |
|
2385 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2386 |
TPhoneCmdParamQuery queryParam; |
|
2387 |
queryParam.SetQueryType( EPhoneQueryDialog ); |
|
2388 |
queryParam.SetQueryResourceId( CPhoneMainResourceResolver::Instance()-> |
|
2389 |
ResolveResourceID( aResourceId ) ); |
|
2390 |
||
2391 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParam ); |
|
2392 |
} |
|
2393 |
||
2394 |
// ----------------------------------------------------------- |
|
2395 |
// CPhoneState::ShowTextQueryL |
|
2396 |
// ----------------------------------------------------------- |
|
2397 |
// |
|
2398 |
EXPORT_C void CPhoneState::ShowTextQueryL( |
|
2399 |
TInt aDialogResourceId, |
|
2400 |
TInt aDefaultCbaResourceId, |
|
2401 |
TInt aContentCbaResourceId, |
|
2402 |
TDes* aDataText, |
|
2403 |
TBool aSendKeyEnabled ) |
|
2404 |
{ |
|
2405 |
__ASSERT_DEBUG( aDialogResourceId && |
|
2406 |
aDefaultCbaResourceId && |
|
2407 |
aContentCbaResourceId && |
|
2408 |
aDataText, |
|
2409 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2410 |
TPhoneCmdParamQuery queryDialogParam; |
|
2411 |
queryDialogParam.SetQueryType( EPhoneTextQueryDialog ); |
|
2412 |
queryDialogParam.SetQueryResourceId( aDialogResourceId ); |
|
2413 |
queryDialogParam.SetDefaultCba( aDefaultCbaResourceId ); |
|
2414 |
queryDialogParam.SetContentCba( aContentCbaResourceId ); |
|
2415 |
queryDialogParam.SetDataText( aDataText ); |
|
2416 |
queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled ); |
|
2417 |
||
2418 |
// Display dialog |
|
2419 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
2420 |
&queryDialogParam ); |
|
2421 |
} |
|
2422 |
||
2423 |
// ----------------------------------------------------------- |
|
2424 |
// CPhoneState::DisplayCallTerminationNoteL |
|
2425 |
// ----------------------------------------------------------- |
|
2426 |
// |
|
2427 |
EXPORT_C void CPhoneState::DisplayCallTerminationNoteL() |
|
2428 |
{ |
|
2429 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayCallTerminationNoteL( ) "); |
|
2430 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
2431 |
Panic( EPhoneCtrlInvariant ) ); |
|
2432 |
if ( CheckIfShowCallTerminationNote() ) |
|
2433 |
{ |
|
2434 |
TBuf<KPhoneMaxCharsInNote> noteText; |
|
2435 |
TBuf<KPhoneMaxCharsInNote> postCallLineText; |
|
2436 |
||
2437 |
// Post call Line 1: Call Summary |
|
2438 |
LoadResource( postCallLineText, EPhoneNoteTextCallSummary ); |
|
2439 |
noteText.Append( postCallLineText ); |
|
2440 |
noteText.Append( KPhoneLineFeed ); |
|
2441 |
||
2442 |
// Post call Line 2: Duration |
|
2443 |
LoadResource( postCallLineText, EPhoneNoteTextCallDuration ); |
|
2444 |
noteText.Append( postCallLineText ); |
|
2445 |
noteText.Append( KPhoneLineFeed ); |
|
2446 |
||
2447 |
// Post call Line 3: Time, get the format for last call time. |
|
2448 |
LoadResource( postCallLineText, EPhoneCallDurationFormatString ); |
|
2449 |
TPtrC durationFormat( postCallLineText ); |
|
2450 |
||
2451 |
// Get the last call duration |
|
2452 |
TTime time( 0 ); |
|
2453 |
TTimeIntervalSeconds timeInterval = |
|
2454 |
iStateMachine->PhoneEngineInfo()->CallDuration(); |
|
2455 |
time += timeInterval; |
|
2456 |
||
2457 |
// Format the time |
|
2458 |
TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC ); |
|
2459 |
time.FormatL( timeString, durationFormat ); |
|
2460 |
||
2461 |
AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeString ); |
|
2462 |
||
2463 |
noteText.Append( timeString ); |
|
2464 |
||
2465 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
2466 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
2467 |
globalNoteParam.SetText( noteText ); |
|
2468 |
globalNoteParam.SetTone( CAknNoteDialog::ENoTone ); |
|
2469 |
iViewCommandHandle->ExecuteCommandL( |
|
2470 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2471 |
} |
|
2472 |
} |
|
2473 |
||
2474 |
// --------------------------------------------------------- |
|
2475 |
// CPhoneState::SendGlobalInfoNoteL |
|
2476 |
// --------------------------------------------------------- |
|
2477 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2478 |
EXPORT_C void CPhoneState::SendGlobalInfoNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2479 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2480 |
{ |
2481 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalInfoNoteL( ) "); |
|
2482 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2483 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2484 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
|
2485 |
{ |
|
2486 |
// Re-enable global notes |
|
2487 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2488 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2489 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2490 |
&globalNotifierParam ); |
|
2491 |
||
2492 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
2493 |
||
2494 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
2495 |
globalNoteParam.SetTextResourceId( |
|
2496 |
CPhoneMainResourceResolver::Instance()-> |
|
2497 |
ResolveResourceID( aResourceId ) ); |
|
2498 |
globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2499 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2500 |
|
37 | 2501 |
iViewCommandHandle->ExecuteCommandL( |
2502 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2503 |
} |
|
2504 |
} |
|
2505 |
||
2506 |
// --------------------------------------------------------- |
|
2507 |
// CPhoneUIController::SendGlobalWarningNoteL |
|
2508 |
// --------------------------------------------------------- |
|
2509 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2510 |
EXPORT_C void CPhoneState::SendGlobalWarningNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2511 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2512 |
{ |
2513 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) "); |
|
2514 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2515 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2516 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || |
|
2517 |
SimState() == EPESimReadable ) |
|
2518 |
{ |
|
2519 |
// Re-enable global notes |
|
2520 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2521 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2522 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2523 |
&globalNotifierParam ); |
|
2524 |
||
2525 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
2526 |
globalNoteParam.SetType( EAknGlobalWarningNote ); |
|
2527 |
globalNoteParam.SetTextResourceId( |
|
2528 |
CPhoneMainResourceResolver::Instance()-> |
|
2529 |
ResolveResourceID( aResourceId ) ); |
|
2530 |
globalNoteParam.SetTone( EAvkonSIDWarningTone ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2531 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2532 |
|
37 | 2533 |
iViewCommandHandle->ExecuteCommandL( |
2534 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2535 |
} |
|
2536 |
} |
|
2537 |
||
2538 |
// --------------------------------------------------------- |
|
2539 |
// CPhoneUIController::SendGlobalErrorNoteL |
|
2540 |
// --------------------------------------------------------- |
|
2541 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2542 |
EXPORT_C void CPhoneState::SendGlobalErrorNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2543 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 2544 |
{ |
2545 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) "); |
|
2546 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
2547 |
if ( CPhonePubSubProxy::Instance()->Value( |
|
2548 |
KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ) |
|
2549 |
{ |
|
2550 |
// Re-enable global notes |
|
2551 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
2552 |
globalNotifierParam.SetBoolean( EFalse ); |
|
2553 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
2554 |
&globalNotifierParam ); |
|
2555 |
||
2556 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
2557 |
globalNoteParam.SetType( EAknGlobalErrorNote ); |
|
2558 |
globalNoteParam.SetTextResourceId( |
|
2559 |
CPhoneMainResourceResolver::Instance()-> |
|
2560 |
ResolveResourceID( aResourceId ) ); |
|
2561 |
globalNoteParam.SetTone( CAknNoteDialog::EErrorTone ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2562 |
globalNoteParam.SetNotificationDialog( aNotificationDialog ); |
37 | 2563 |
|
2564 |
iViewCommandHandle->ExecuteCommandL( |
|
2565 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
2566 |
} |
|
2567 |
} |
|
2568 |
||
2569 |
// --------------------------------------------------------- |
|
2570 |
// CPhoneState::SetHandsfreeModeL |
|
2571 |
// --------------------------------------------------------- |
|
2572 |
// |
|
2573 |
EXPORT_C void CPhoneState::SetHandsfreeModeL( TBool aHandsfreeMode ) |
|
2574 |
{ |
|
2575 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetHandsfreeModeL( ) "); |
|
2576 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
2577 |
iViewCommandHandle, iStateMachine, this ); |
|
2578 |
if ( !bt->SetHandsfreeModeL( aHandsfreeMode )) |
|
2579 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2580 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 2581 |
} |
2582 |
CleanupStack::PopAndDestroy( bt ); |
|
2583 |
} |
|
2584 |
||
2585 |
// --------------------------------------------------------- |
|
2586 |
// CPhoneState::SetBTHandsfreeModeL |
|
2587 |
// --------------------------------------------------------- |
|
2588 |
// |
|
2589 |
EXPORT_C void CPhoneState::SetBTHandsfreeModeL( TBool aHandsfreeMode ) |
|
2590 |
{ |
|
2591 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) "); |
|
2592 |
CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC( |
|
2593 |
iViewCommandHandle, iStateMachine, this ); |
|
2594 |
if ( !bt->SetBTHandsfreeModeL( aHandsfreeMode )) |
|
2595 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
2596 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 2597 |
} |
2598 |
CleanupStack::PopAndDestroy( bt ); |
|
2599 |
} |
|
2600 |
||
2601 |
// <-------------------------- INTERNAL FUNCTIONS ------------------------> |
|
2602 |
||
2603 |
// ----------------------------------------------------------- |
|
2604 |
// CPhoneState::UpdateIncallIndicatorL |
|
2605 |
// ----------------------------------------------------------- |
|
2606 |
// |
|
2607 |
void CPhoneState::UpdateIncallIndicatorL( TInt aCallState ) |
|
2608 |
{ |
|
2609 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncallIndicatorL( ) "); |
|
2610 |
TPhoneCmdParamIncallIndicatorData incallIndicatorParam; |
|
2611 |
||
2612 |
// Set the state |
|
2613 |
incallIndicatorParam.SetCallState( aCallState ); |
|
2614 |
||
2615 |
// Set mode |
|
2616 |
incallIndicatorParam.SetMode( |
|
2617 |
CPhonePubSubProxy::Instance()->Value( |
|
2618 |
KPSUidCtsyCallInformation, |
|
2619 |
KCTsyCallType ) ); |
|
2620 |
||
2621 |
TInt activeCallId = GetActiveCallIdL(); |
|
2622 |
if ( activeCallId > KErrNotFound ) |
|
2623 |
{ |
|
2624 |
if ( iStateMachine->PhoneEngineInfo()->CallALSLine( activeCallId ) |
|
2625 |
== CCCECallParameters::ECCELineTypeAux ) |
|
2626 |
{ |
|
2627 |
incallIndicatorParam.SetLine2( ETrue ); |
|
2628 |
} |
|
2629 |
} |
|
2630 |
||
2631 |
// Set the mute status |
|
2632 |
const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute(); |
|
2633 |
incallIndicatorParam.SetMute( audioMute ); |
|
2634 |
||
2635 |
// Set the voice privacy status |
|
2636 |
if ( activeCallId > KErrNotFound && |
|
2637 |
activeCallId != KConferenceCallId ) |
|
2638 |
{ |
|
2639 |
incallIndicatorParam.SetCiphering( |
|
2640 |
iStateMachine->PhoneEngineInfo()->IsSecureCall( activeCallId ) ); |
|
2641 |
} |
|
2642 |
else |
|
2643 |
{ |
|
2644 |
incallIndicatorParam.SetCiphering( ETrue ); |
|
2645 |
} |
|
2646 |
||
2647 |
incallIndicatorParam.SetCipheringIndicatorAllowed( |
|
2648 |
iStateMachine->PhoneEngineInfo()->SecureSpecified() ); |
|
2649 |
||
2650 |
// Set the emergency status |
|
2651 |
if( EPEStateIdle != iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) ) |
|
2652 |
{ |
|
2653 |
incallIndicatorParam.SetEmergency( ETrue ); |
|
2654 |
} |
|
2655 |
||
2656 |
if( aCallState == EPSCTsyCallStateDisconnecting ) |
|
2657 |
{ |
|
2658 |
if ( TopAppIsDisplayedL() ) |
|
2659 |
{ |
|
2660 |
if ( ( !IsOnScreenDialerSupported() ) || |
|
2661 |
( IsOnScreenDialerSupported() && !IsNumberEntryVisibleL() ) ) |
|
2662 |
{ |
|
2663 |
// Phone application is in the foreground so we don't need to |
|
2664 |
// display the little bubble. If we don't hide it here then |
|
2665 |
// it will appear for a short time. We don't want that. |
|
2666 |
incallIndicatorParam.SetLittleBubbleVisible( EFalse ); |
|
2667 |
} |
|
2668 |
} |
|
2669 |
} |
|
2670 |
||
2671 |
// Update the in-call indicator |
|
2672 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateIncallIndicator, |
|
2673 |
&incallIndicatorParam ); |
|
2674 |
} |
|
2675 |
||
2676 |
// ----------------------------------------------------------- |
|
2677 |
// CPhoneState::UpdateProfileDisplayL |
|
2678 |
// ----------------------------------------------------------- |
|
2679 |
// |
|
2680 |
void CPhoneState::UpdateProfileDisplayL() |
|
2681 |
{ |
|
2682 |
} |
|
2683 |
||
2684 |
// ----------------------------------------------------------- |
|
2685 |
// CPhoneState::UpdateOperatorDisplayL |
|
2686 |
// ----------------------------------------------------------- |
|
2687 |
// |
|
2688 |
void CPhoneState::UpdateOperatorDisplayL() |
|
2689 |
{ |
|
2690 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateOperatorDisplayL( ) "); |
|
2691 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::UpdateOperatorDisplayL" ); |
|
2692 |
// Get current title pane content. |
|
2693 |
TTelTitleDisplay titleContent; |
|
2694 |
titleContent.iDisplayTag.Zero(); |
|
2695 |
titleContent.iLogoHandle = 0; |
|
2696 |
TPckg<TTelTitleDisplay> titlePckg( titleContent ); |
|
2697 |
||
2698 |
RProperty::Get( |
|
2699 |
KPSUidTelInformation, |
|
2700 |
KTelDisplayInfo, |
|
2701 |
titlePckg ); |
|
2702 |
||
2703 |
if ( TitlePaneIsVisibleL() ) |
|
2704 |
{ |
|
2705 |
// There is a title pane icon. |
|
2706 |
if ( titleContent.iLogoHandle != 0 ) |
|
2707 |
{ |
|
2708 |
// Set new logo. |
|
2709 |
__PHONELOG( EBasic, EPhoneControl, |
|
2710 |
"CPhoneState::UpdateOperatorDisplayL - logo found" ); |
|
2711 |
||
2712 |
if( iLogoHandle != titleContent.iLogoHandle ) |
|
2713 |
{ |
|
2714 |
__PHONELOG( EBasic, EPhoneControl, |
|
2715 |
"CPhoneState::UpdateOperatorDisplayL - set new logo" ); |
|
2716 |
||
2717 |
TPhoneCmdParamBitmap bitmapParam; |
|
2718 |
||
2719 |
// Duplicate bitmap from handle. |
|
2720 |
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
2721 |
CleanupStack::PushL( bitmap ); |
|
2722 |
User::LeaveIfError( |
|
2723 |
bitmap->Duplicate( titleContent.iLogoHandle ) ); |
|
2724 |
bitmapParam.SetBitmap( bitmap ); |
|
2725 |
||
2726 |
// Duplicate and set bitmap mask if needed |
|
2727 |
CFbsBitmap* maskBitmap = NULL; |
|
2728 |
if( titleContent.iLogoMaskHandle != 0 ) |
|
2729 |
{ |
|
2730 |
maskBitmap = new( ELeave )CFbsBitmap; |
|
2731 |
CleanupStack::PushL( maskBitmap ); |
|
2732 |
User::LeaveIfError( maskBitmap->Duplicate( |
|
2733 |
titleContent.iLogoMaskHandle ) ); |
|
2734 |
bitmapParam.SetMaskBitmap( maskBitmap ); |
|
2735 |
} |
|
2736 |
||
2737 |
iViewCommandHandle->ExecuteCommandL( |
|
2738 |
EPhoneViewSetTitlePanePicture, |
|
2739 |
&bitmapParam ); |
|
2740 |
||
2741 |
// The title pane takes ownership of the bitmaps so no need |
|
2742 |
// to destroy it here. |
|
2743 |
if( maskBitmap ) |
|
2744 |
{ |
|
2745 |
// Pop maskBitmap only, if it has been created |
|
2746 |
CleanupStack::Pop( maskBitmap ); |
|
2747 |
} |
|
2748 |
CleanupStack::Pop( bitmap ); |
|
2749 |
} |
|
2750 |
} |
|
2751 |
else |
|
2752 |
{ |
|
2753 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2754 |
"CPhoneState::UpdateOperatorDisplayL - set text=%S", &titleContent.iDisplayTag ); |
|
2755 |
iLogoHandle = titleContent.iLogoHandle; |
|
2756 |
||
2757 |
iViewCommandHandle->ExecuteCommandL( |
|
2758 |
EPhoneViewSetTitlePaneContent, |
|
2759 |
0, |
|
2760 |
titleContent.iDisplayTag ); |
|
2761 |
} |
|
2762 |
} |
|
2763 |
||
2764 |
// Check background image. |
|
2765 |
TPhoneCmdParamBitmap savedBitmapParam; |
|
2766 |
iViewCommandHandle->ExecuteCommandL( |
|
2767 |
EPhoneViewGetBackgroundImageBitmap, |
|
2768 |
&savedBitmapParam ); |
|
2769 |
||
2770 |
if ( titleContent.iBackgroundImageHandle != |
|
2771 |
savedBitmapParam.Bitmap()->Handle() ) |
|
2772 |
{ |
|
2773 |
__PHONELOG2( EBasic, EPhoneControl, |
|
2774 |
"CPhoneState::UpdateOperatorDisplayL - update background image since different titleContent(%d), saved(%d)", |
|
2775 |
titleContent.iBackgroundImageHandle, savedBitmapParam.Bitmap()->Handle() ); |
|
2776 |
// Background image has changed. Duplicate bitmap from handle if |
|
2777 |
// available; otherwise reset the background image |
|
2778 |
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
2779 |
CleanupStack::PushL( bitmap ); |
|
2780 |
TInt err = KErrNone; |
|
2781 |
if ( titleContent.iBackgroundImageHandle != 0 ) |
|
2782 |
{ |
|
2783 |
err = bitmap->Duplicate( titleContent.iBackgroundImageHandle ); |
|
2784 |
} |
|
2785 |
else |
|
2786 |
{ |
|
2787 |
bitmap->Reset(); |
|
2788 |
} |
|
2789 |
||
2790 |
if ( err == KErrNone ) |
|
2791 |
{ |
|
2792 |
iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter; |
|
2793 |
TPhoneCmdParamBitmap bitmapParam; |
|
2794 |
bitmapParam.SetBitmap( bitmap ); |
|
2795 |
iViewCommandHandle->ExecuteCommandL( |
|
2796 |
EPhoneViewSetBackgroundImageBitmap, |
|
2797 |
&bitmapParam ); |
|
2798 |
} |
|
2799 |
||
2800 |
CleanupStack::PopAndDestroy( bitmap ); |
|
2801 |
} |
|
2802 |
else if ( titleContent.iBackgroundImageRedrawCounter != |
|
2803 |
iBitmapRedrawCounter ) |
|
2804 |
{ |
|
2805 |
iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter; |
|
2806 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateView ); |
|
2807 |
} |
|
2808 |
} |
|
2809 |
||
2810 |
// ----------------------------------------------------------- |
|
2811 |
// CPhoneState::HandleInitiatedEmergencyCallL |
|
2812 |
// Default handling for EPEMessageInitiatedEmergencyCallL message |
|
2813 |
// (other items were commented in a header). |
|
2814 |
// ----------------------------------------------------------- |
|
2815 |
// |
|
2816 |
void CPhoneState::HandleInitiatedEmergencyCallL( TInt /*aCallId*/ ) |
|
2817 |
{ |
|
2818 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyCallL( ) "); |
|
2819 |
||
2820 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
2821 |
||
2822 |
// Stop tone playing, if necessary |
|
2823 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
2824 |
||
2825 |
// Reset Hold flag to view |
|
2826 |
TPhoneCmdParamBoolean holdFlag; |
|
2827 |
holdFlag.SetBoolean( EFalse ); |
|
2828 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
2829 |
||
2830 |
// Undim Answer button for sure. |
|
2831 |
SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer ); |
|
2832 |
||
2833 |
// Go to emergency call state |
|
2834 |
// No need update cba |
|
2835 |
iStateMachine->ChangeState( EPhoneStateEmergency ); |
|
2836 |
} |
|
2837 |
||
2838 |
// ----------------------------------------------------------- |
|
2839 |
// CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL |
|
2840 |
// ----------------------------------------------------------- |
|
2841 |
// |
|
2842 |
void CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL() |
|
2843 |
{ |
|
2844 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) "); |
|
2845 |
||
2846 |
// We have existing video call so need to release dataport before continuing |
|
2847 |
// emergency call. Otherwise we will face problems with dataport use later. |
|
2848 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
|
2849 |
KCatPhoneToVideotelCommands, |
|
2850 |
EVtCmdReleaseDataport, |
|
2851 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
2852 |
KPhoneToVideotelCmdVersionMinor, |
|
2853 |
KPhoneToVideotelCmdVersionBuild ), |
|
2854 |
KNullDesC8, |
|
2855 |
CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) ); |
|
2856 |
} |
|
2857 |
||
2858 |
// ----------------------------------------------------------- |
|
2859 |
// CPhoneState::HandleCallSecureStatusChangeL |
|
2860 |
// ----------------------------------------------------------- |
|
2861 |
// |
|
2862 |
void CPhoneState::HandleCallSecureStatusChangeL( TInt aCallId ) |
|
2863 |
{ |
|
2864 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCallSecureStatusChangeL( ) "); |
|
2865 |
||
2866 |
TBool ciphering( ETrue ); |
|
2867 |
TBool secureSpecified( ETrue ); |
|
2868 |
||
2869 |
if ( aCallId > KErrNotFound ) |
|
2870 |
{ |
|
2871 |
ciphering = iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ); |
|
2872 |
secureSpecified = iStateMachine->PhoneEngineInfo()->SecureSpecified(); |
|
2873 |
} |
|
2874 |
||
2875 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
2876 |
||
2877 |
callHeaderParam.SetCiphering( ciphering ); |
|
2878 |
callHeaderParam.SetCipheringIndicatorAllowed( secureSpecified ); |
|
2879 |
||
2880 |
iViewCommandHandle->ExecuteCommandL( |
|
2881 |
EPhoneViewCipheringInfoChange, |
|
2882 |
aCallId, |
|
2883 |
&callHeaderParam ); |
|
2884 |
} |
|
2885 |
||
2886 |
// --------------------------------------------------------- |
|
2887 |
// CPhoneState::IsVideoCall |
|
2888 |
// --------------------------------------------------------- |
|
2889 |
// |
|
2890 |
EXPORT_C TBool CPhoneState::IsVideoCall( const TInt aCallId ) |
|
2891 |
{ |
|
2892 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsVideoCall( ) "); |
|
2893 |
TBool isVideoCall( EFalse ); |
|
2894 |
TRAP_IGNORE( isVideoCall = CallheaderManagerL()->IsVideoCall( aCallId ) ); |
|
2895 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2896 |
"CPhoneState::IsVideoCall isVideoCall(%d)", |
|
2897 |
isVideoCall ); |
|
2898 |
return isVideoCall; |
|
2899 |
} |
|
2900 |
||
2901 |
// --------------------------------------------------------- |
|
2902 |
// CPhoneState::ChangeAlsLineL |
|
2903 |
// --------------------------------------------------------- |
|
2904 |
// |
|
2905 |
void CPhoneState::ChangeAlsLineL() |
|
2906 |
{ |
|
2907 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAlsLineL( ) "); |
|
2908 |
||
2909 |
if ( !IsOnScreenDialerSupported() ) |
|
2910 |
{ |
|
2911 |
// Do state-specific operation when number entry is cleared |
|
2912 |
HandleNumberEntryClearedL(); |
|
2913 |
} |
|
2914 |
||
2915 |
CCCECallParameters::TCCELineType currentLine; |
|
2916 |
TSSSettingsAlsValue newLine( ESSSettingsAlsPrimary ); |
|
2917 |
||
2918 |
currentLine = iStateMachine->PhoneEngineInfo()->ALSLine(); |
|
2919 |
||
2920 |
if ( currentLine == CCCECallParameters::ECCELineTypePrimary ) |
|
2921 |
{ |
|
2922 |
newLine = ESSSettingsAlsAlternate; |
|
2923 |
} |
|
2924 |
else if ( currentLine == CCCECallParameters::ECCELineTypeAux ) |
|
2925 |
{ |
|
2926 |
newLine = ESSSettingsAlsPrimary; |
|
2927 |
} |
|
2928 |
||
2929 |
RSSSettings ssSettings; |
|
2930 |
TInt retValue = ssSettings.Open(); |
|
2931 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2932 |
"CPhoneState::ChangeAlsLineL : Open %d", retValue ); |
|
2933 |
if ( retValue == KErrNone ) |
|
2934 |
{ |
|
2935 |
retValue = ssSettings.Set( ESSSettingsAls, newLine ); |
|
2936 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2937 |
"CPhoneState::ChangeAlsLineL : Set %d", retValue ); |
|
2938 |
ssSettings.Close(); |
|
2939 |
} |
|
2940 |
} |
|
2941 |
||
2942 |
// --------------------------------------------------------- |
|
2943 |
// CPhoneState::GetActiveCallIdL() |
|
2944 |
// --------------------------------------------------------- |
|
2945 |
// |
|
2946 |
TInt CPhoneState::GetActiveCallIdL() |
|
2947 |
{ |
|
2948 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetActiveCallId()( ) "); |
|
2949 |
||
2950 |
// Fetch active call's id from view |
|
2951 |
TPhoneViewResponseId response; |
|
2952 |
TPhoneCmdParamCallStateData callStateData; |
|
2953 |
callStateData.SetCallState( EPEStateConnected ); |
|
2954 |
response = iViewCommandHandle->HandleCommandL( |
|
2955 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
2956 |
||
2957 |
if ( response == EPhoneViewResponseSuccess && |
|
2958 |
callStateData.CallId() < 0 ) // no connected calls |
|
2959 |
{ |
|
2960 |
// check for held call |
|
2961 |
callStateData.SetCallState( EPEStateHeld ); |
|
2962 |
response = iViewCommandHandle->HandleCommandL( |
|
2963 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
2964 |
} |
|
2965 |
||
2966 |
return callStateData.CallId(); |
|
2967 |
} |
|
2968 |
||
2969 |
// --------------------------------------------------------- |
|
2970 |
// CPhoneState::SimState() |
|
2971 |
// --------------------------------------------------------- |
|
2972 |
// |
|
2973 |
EXPORT_C TPESimState CPhoneState::SimState() const |
|
2974 |
{ |
|
2975 |
||
2976 |
/* |
|
2977 |
SIM states: |
|
2978 |
||
2979 |
EPESimStatusUninitialized = KPEStartupEnumerationFirstValue =100, |
|
2980 |
EPESimUsable, // The Sim card is fully usable. |
|
2981 |
EPESimReadable, // The SIM card is not fully usable, but the emergency number can be read. |
|
2982 |
EPESimNotReady, // The Sim card is present but not ready or usable. |
|
2983 |
EPESimNotPresent, // The Sim card is not present. |
|
2984 |
EPESimNotSupported // SIM/RUIM is not supported. Some CDMA phones do not support a SIM/RUIM at all. |
|
2985 |
*/ |
|
2986 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimState()"); |
|
2987 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
2988 |
Panic( EPhoneCtrlInvariant ) ); |
|
2989 |
TPESimState simState = iStateMachine->PhoneEngineInfo()->SimState(); |
|
2990 |
||
2991 |
__PHONELOG1( EBasic, EPhoneControl, |
|
2992 |
"CPhoneState::SimState - value= %d", simState ); |
|
2993 |
return simState; |
|
2994 |
} |
|
2995 |
||
2996 |
// --------------------------------------------------------- |
|
2997 |
// CPhoneState::IsSimOk() |
|
2998 |
// --------------------------------------------------------- |
|
2999 |
// |
|
3000 |
EXPORT_C TBool CPhoneState::IsSimOk() |
|
3001 |
{ |
|
3002 |
||
3003 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsSimOk()"); |
|
3004 |
// Phone is interested on Sim state and sim security statuses |
|
3005 |
// Check first Sim state status: |
|
3006 |
TBool retVal( ETrue ); |
|
3007 |
switch ( SimState() ) |
|
3008 |
{ |
|
3009 |
case EPESimNotSupported: |
|
3010 |
retVal = EFalse; |
|
3011 |
break; |
|
3012 |
||
3013 |
case EPESimNotPresent: |
|
3014 |
{ |
|
3015 |
if ( !FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) || |
|
3016 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) |
|
3017 |
{ |
|
3018 |
retVal = EFalse; |
|
3019 |
} |
|
3020 |
break; |
|
3021 |
} |
|
3022 |
||
3023 |
default: |
|
3024 |
break; |
|
3025 |
} |
|
3026 |
if ( retVal != EFalse ) |
|
3027 |
{ |
|
3028 |
// Sim state is valid, check also Sim security status |
|
3029 |
switch ( SimSecurityStatus() ) |
|
3030 |
{ |
|
3031 |
case ESimRejected: |
|
3032 |
case ESimUnaccepted: |
|
3033 |
retVal = EFalse; |
|
3034 |
break; |
|
3035 |
||
3036 |
default: |
|
3037 |
break; |
|
3038 |
} |
|
3039 |
} |
|
3040 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3041 |
"CPhoneState::IsSimOK - value= %d", retVal ); |
|
3042 |
return retVal; |
|
3043 |
} |
|
3044 |
||
3045 |
// ----------------------------------------------------------- |
|
3046 |
// CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled |
|
3047 |
// ----------------------------------------------------------- |
|
3048 |
// |
|
3049 |
EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled() |
|
3050 |
{ |
|
3051 |
TPhoneCmdParamBoolean isSecurityMode; |
|
3052 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ) ); |
|
3053 |
if ( SimState() == EPESimNotPresent && isSecurityMode.Boolean() ) |
|
3054 |
{ |
|
3055 |
return ETrue; |
|
3056 |
} |
|
3057 |
else |
|
3058 |
{ |
|
3059 |
return EFalse; |
|
3060 |
} |
|
3061 |
} |
|
3062 |
||
3063 |
// --------------------------------------------------------- |
|
3064 |
// CPhoneState::SetDivertIndication |
|
3065 |
// --------------------------------------------------------- |
|
3066 |
// |
|
3067 |
EXPORT_C void CPhoneState::SetDivertIndication( const TBool aDivertIndication ) |
|
3068 |
{ |
|
3069 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetDivertIndication()"); |
|
3070 |
TRAP_IGNORE( CallheaderManagerL()->SetDivertIndication( aDivertIndication ) ); |
|
3071 |
} |
|
3072 |
||
3073 |
// --------------------------------------------------------- |
|
3074 |
// CPhoneState::StartAlsLineChangeTimerL |
|
3075 |
// --------------------------------------------------------- |
|
3076 |
// |
|
3077 |
EXPORT_C void CPhoneState::StartAlsLineChangeTimerL() |
|
3078 |
{ |
|
3079 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartAlsLineChangeTimerL()"); |
|
3080 |
TBool alsLineAvailable = iStateMachine->PhoneEngineInfo()->ALSLineSupport(); |
|
3081 |
||
3082 |
if( alsLineAvailable ) |
|
3083 |
{ |
|
3084 |
if( !iAlsLineChangeKeyPressTimer ) |
|
3085 |
{ |
|
3086 |
iAlsLineChangeKeyPressTimer = CPhoneTimer::NewL(); |
|
3087 |
} |
|
3088 |
||
3089 |
iAlsLineChangeKeyPressTimer->After( KAlsLineChangeTimerValue, |
|
3090 |
TCallBack( AlsLineChangeTimerCallbackL, this ) ); |
|
3091 |
} |
|
3092 |
else |
|
3093 |
{ |
|
3094 |
// Don't bother launching the timer. ALS not supported. |
|
3095 |
__PHONELOG( EBasic, EPhoneControl, |
|
3096 |
"CPhoneState::StartAlsLineChangeTimerL - ALS not supported " ); |
|
3097 |
} |
|
3098 |
} |
|
3099 |
||
3100 |
// ----------------------------------------------------------------------------- |
|
3101 |
// CPhoneState::StartShowSecurityNoteL |
|
3102 |
// ----------------------------------------------------------------------------- |
|
3103 |
// |
|
3104 |
EXPORT_C void CPhoneState::StartShowSecurityNoteL() |
|
3105 |
{ |
|
3106 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL "); |
|
3107 |
||
3108 |
// Set security mode on. |
|
3109 |
TPhoneCmdParamBoolean securityMode; |
|
3110 |
securityMode.SetBoolean( ETrue ); |
|
3111 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode ); |
|
3112 |
||
3113 |
// Remove number entry from screen |
|
3114 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3115 |
||
3116 |
TPhoneCmdParamBoolean visibleMode; |
|
3117 |
visibleMode.SetBoolean( EFalse ); |
|
3118 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode ); |
|
3119 |
||
3120 |
iCbaManager->UpdateCbaL( EPhoneEmptyCBA ); |
|
3121 |
||
3122 |
TPhoneCmdParamInteger uidParam; |
|
3123 |
// Bring Phone app in the foreground |
|
3124 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
3125 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
3126 |
&uidParam ); |
|
3127 |
||
3128 |
// Set Phone as the top application |
|
3129 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
3130 |
&uidParam ); |
|
3131 |
||
3132 |
TInt resourceId ( KErrNone ); |
|
3133 |
||
3134 |
if ( SimSecurityStatus() == ESimRejected ) |
|
3135 |
{ |
|
3136 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
3137 |
ResolveResourceID( EPhoneSimRejected ); |
|
3138 |
} |
|
3139 |
else if ( SimState() == EPESimNotPresent ) |
|
3140 |
{ |
|
3141 |
// insert sim card -note |
|
3142 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
3143 |
ResolveResourceID( EPhoneSimRemoved ); |
|
3144 |
} |
|
3145 |
else if ( SimSecurityStatus() == ESimUnaccepted ) |
|
3146 |
{ |
|
3147 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
3148 |
ResolveResourceID( EPhoneSimUnaccepted ); |
|
3149 |
} |
|
3150 |
||
3151 |
if ( resourceId != KErrNone ) |
|
3152 |
{ |
|
3153 |
// Add it to the resource string |
|
3154 |
HBufC* buf = StringLoader::LoadLC( resourceId ); |
|
3155 |
||
3156 |
TPhoneCmdParamNote noteParam; |
|
3157 |
||
3158 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3159 |
ResolveResourceID( EPhoneSecurityInformationNote ) ); |
|
3160 |
||
3161 |
noteParam.SetText( *buf ); |
|
3162 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
3163 |
noteParam.SetType( EPhoneNoteSecurity ); |
|
3164 |
// Display note |
|
3165 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3166 |
||
3167 |
CleanupStack::PopAndDestroy( buf ); |
|
3168 |
||
3169 |
||
3170 |
// Capture the App key |
|
3171 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
3172 |
appKeyCaptureParam.SetKey( EStdKeyApplication0 ); |
|
3173 |
appKeyCaptureParam.SetKeyCode( EKeyApplication0 ); |
|
3174 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
3175 |
iViewCommandHandle->ExecuteCommandL( |
|
3176 |
EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
|
3177 |
} |
|
3178 |
} |
|
3179 |
||
3180 |
// --------------------------------------------------------- |
|
3181 |
// CPhoneState::AlsLineChangeTimerCallbackL |
|
3182 |
// --------------------------------------------------------- |
|
3183 |
// |
|
3184 |
TInt CPhoneState::AlsLineChangeTimerCallbackL( TAny* aAny ) |
|
3185 |
{ |
|
3186 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::AlsLineChangeTimerCallbackL()"); |
|
3187 |
||
3188 |
// Send a key up event for stopping keypad tone |
|
3189 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
3190 |
iStateMachine->SendPhoneEngineMessage( |
|
3191 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
3192 |
||
3193 |
if ( !( reinterpret_cast<CPhoneState*>( aAny )-> |
|
3194 |
IsOnScreenDialerSupported() ) ) |
|
3195 |
{ |
|
3196 |
// If dialer is undefined remove the number entry. |
|
3197 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
3198 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3199 |
} |
|
3200 |
else |
|
3201 |
{ |
|
3202 |
// If on screen dialer is in use just clear entry |
|
3203 |
// do not remove dialer. |
|
3204 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
3205 |
NumberEntryClearL(); |
|
3206 |
} |
|
3207 |
||
3208 |
// Show the als line changing confirmation query |
|
3209 |
reinterpret_cast<CPhoneState*>( aAny )-> |
|
3210 |
ShowQueryL( EPhoneAlsLineChangeConfirmationQuery ); |
|
3211 |
||
3212 |
return KErrNone; |
|
3213 |
} |
|
3214 |
||
3215 |
// --------------------------------------------------------- |
|
3216 |
// CPhoneState::ShowWlanMacAddressL |
|
3217 |
// --------------------------------------------------------- |
|
3218 |
// |
|
3219 |
void CPhoneState::ShowWlanMacAddressL() |
|
3220 |
{ |
|
3221 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ShowWlanMacAddressL()"); |
|
3222 |
if ( IsOnScreenDialerSupported() ) |
|
3223 |
{ |
|
3224 |
NumberEntryClearL(); |
|
3225 |
} |
|
3226 |
else |
|
3227 |
{ |
|
3228 |
// Remove number entry from screen |
|
3229 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3230 |
} |
|
3231 |
||
3232 |
// Fetch WLAN MAC address |
|
3233 |
TBuf8<KPhoneWlanMacAddressLength> address; |
|
3234 |
RProperty::Get( |
|
3235 |
KPSUidWlan, |
|
3236 |
KPSWlanMacAddress, |
|
3237 |
address ); |
|
3238 |
||
3239 |
// Format fetched address |
|
3240 |
TBuf<KPhoneWlanMacAddressLength> wlanMACAddress; |
|
3241 |
for ( TInt i( 0 ); i < address.Length(); i++ ) |
|
3242 |
{ |
|
3243 |
// Set separator |
|
3244 |
if( i > 0 ) |
|
3245 |
{ |
|
3246 |
wlanMACAddress.Append( KPhoneWlanSeparator ); |
|
3247 |
} |
|
3248 |
// Set data |
|
3249 |
TBuf<10> tmp; |
|
3250 |
tmp.Format( KWLanMACDataFormat, address[i] ); |
|
3251 |
wlanMACAddress.Append( tmp ); |
|
3252 |
} |
|
3253 |
||
3254 |
// Now we need the localised text |
|
3255 |
HBufC* wlanMacAddress = StringLoader::LoadLC( |
|
3256 |
CPhoneMainResourceResolver::Instance()-> |
|
3257 |
ResolveResourceID( EPhoneWlanMacAddress ), wlanMACAddress ); |
|
3258 |
||
3259 |
TPhoneCmdParamNote noteParam; |
|
3260 |
noteParam.SetType( EPhoneNoteCustom ); |
|
3261 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
3262 |
ResolveResourceID( EPhoneInformationWaitNote ) ); |
|
3263 |
noteParam.SetText( *wlanMacAddress ); |
|
3264 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
3265 |
||
3266 |
// Display note |
|
3267 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
3268 |
||
3269 |
CleanupStack::PopAndDestroy( wlanMacAddress ); |
|
3270 |
} |
|
3271 |
||
3272 |
// ----------------------------------------------------------- |
|
3273 |
// CPhoneState::HandleAudioAvailableOutputChangedL |
|
3274 |
// Default handling for EPEMessageAvailableAudioOutputsChanged message |
|
3275 |
// (other items were commented in a header). |
|
3276 |
// ----------------------------------------------------------- |
|
3277 |
// |
|
3278 |
void CPhoneState::HandleAudioAvailableOutputChangedL() |
|
3279 |
{ |
|
3280 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioAvailableOutputChangedL() "); |
|
3281 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
3282 |
Panic( EPhoneCtrlInvariant ) ); |
|
3283 |
||
3284 |
TPhoneCmdParamAudioAvailability outputParam; |
|
3285 |
||
3286 |
// Output |
|
3287 |
const TPEAudioOutput audioOutput = |
|
3288 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
|
3289 |
||
3290 |
// BT availability |
|
3291 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
3292 |
EPEBTAudioAccessory ); |
|
3293 |
outputParam.SetBTAccAvailable( btAvailable ); |
|
3294 |
||
3295 |
// Wired availability |
|
3296 |
TBool wiredAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
|
3297 |
EPEWiredAudioAccessory ); |
|
3298 |
outputParam.SetWiredAccAvailable( wiredAvailable ); |
|
3299 |
||
3300 |
// BTA disconnect handler check |
|
3301 |
if( btAvailable ) |
|
3302 |
{ |
|
3303 |
CPhoneBtaaDisconnectHandler::InstanceL()->Cancel(); |
|
3304 |
} |
|
3305 |
||
3306 |
// view update |
|
3307 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioAvailabilityUIChanges, |
|
3308 |
&outputParam ); |
|
3309 |
} |
|
3310 |
||
3311 |
||
3312 |
// --------------------------------------------------------- |
|
3313 |
// CPhoneState::IsAlsLineChangePossible |
|
3314 |
// --------------------------------------------------------- |
|
3315 |
// |
|
3316 |
TBool CPhoneState::IsAlsLineChangePossible() |
|
3317 |
{ |
|
3318 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAlsLineChangePossible( ) "); |
|
3319 |
||
3320 |
TBool isAlsLineChangePossible( ETrue ); |
|
3321 |
TSSSettingsAlsBlockingValue AlsBlockingValue( ESSSettingsAlsBlockingNotSupported ); |
|
3322 |
TInt value( 0 ); |
|
3323 |
||
3324 |
RSSSettings ssSettings; |
|
3325 |
TInt retValue = ssSettings.Open(); |
|
3326 |
||
3327 |
if ( retValue == KErrNone ) |
|
3328 |
{ |
|
3329 |
ssSettings.Get( ESSSettingsAlsBlocking, value ); |
|
3330 |
ssSettings.Close(); |
|
3331 |
||
3332 |
AlsBlockingValue = static_cast< TSSSettingsAlsBlockingValue > ( value ); |
|
3333 |
||
3334 |
if( AlsBlockingValue == ESSSettingsAlsAlternate ) |
|
3335 |
{ |
|
3336 |
isAlsLineChangePossible = EFalse; |
|
3337 |
} |
|
3338 |
} |
|
3339 |
||
3340 |
return isAlsLineChangePossible; |
|
3341 |
} |
|
3342 |
||
3343 |
// --------------------------------------------------------- |
|
3344 |
// CPhoneState::ShowNumberBusyNoteL |
|
3345 |
// --------------------------------------------------------- |
|
3346 |
// |
|
3347 |
EXPORT_C void CPhoneState::ShowNumberBusyNoteL() |
|
3348 |
{ |
|
3349 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNumberBusyNoteL( ) "); |
|
3350 |
// Re-enable global notes |
|
3351 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
3352 |
globalNotifierParam.SetBoolean( EFalse ); |
|
3353 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
3354 |
&globalNotifierParam ); |
|
3355 |
||
3356 |
TInt resource( EPhoneNumberBusy ); |
|
3357 |
||
3358 |
if( iCustomization ) |
|
3359 |
{ |
|
3360 |
// Get customized text resource for busy note |
|
3361 |
resource = iCustomization->CustomizeBusyNoteText(); |
|
3362 |
} |
|
3363 |
||
3364 |
// Show number busy note |
|
3365 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
3366 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
3367 |
globalNoteParam.SetTextResourceId( |
|
3368 |
CPhoneMainResourceResolver::Instance()-> |
|
3369 |
ResolveResourceID( resource ) ); |
|
3370 |
globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3371 |
globalNoteParam.SetNotificationDialog( ETrue ); |
37 | 3372 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowGlobalNote, |
3373 |
&globalNoteParam ); |
|
3374 |
} |
|
3375 |
||
3376 |
// --------------------------------------------------------- |
|
3377 |
// CPhoneState::IsAutoLockOn |
|
3378 |
// --------------------------------------------------------- |
|
3379 |
// |
|
3380 |
EXPORT_C TBool CPhoneState::IsAutoLockOn() const |
|
3381 |
{ |
|
3382 |
// Check if phone is locked |
|
3383 |
const TBool phoneIsLocked = |
|
3384 |
CPhonePubSubProxy::Instance()->Value( |
|
3385 |
KPSUidCoreApplicationUIs, |
|
3386 |
KCoreAppUIsAutolockStatus ) > EAutolockOff; |
|
3387 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3388 |
__PHONELOG1( EBasic, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3389 |
EPhoneControl, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3390 |
"CPhoneState::IsAutoLockOn() Status: %d", |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3391 |
phoneIsLocked ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3392 |
|
37 | 3393 |
return phoneIsLocked; |
3394 |
} |
|
3395 |
||
3396 |
// --------------------------------------------------------- |
|
3397 |
// CPhoneState::IsKeyLockOn |
|
3398 |
// --------------------------------------------------------- |
|
3399 |
// |
|
3400 |
EXPORT_C TBool CPhoneState::IsKeyLockOn() const |
|
3401 |
{ |
|
3402 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsKeyLockOn( ) "); |
|
3403 |
TPhoneCmdParamBoolean keyLockStatus; |
|
3404 |
keyLockStatus.SetBoolean( EFalse ); |
|
3405 |
||
3406 |
iViewCommandHandle->ExecuteCommand( |
|
3407 |
EPhoneViewGetKeyLockStatus, |
|
3408 |
&keyLockStatus ); |
|
3409 |
||
3410 |
__PHONELOG1( EBasic, |
|
3411 |
EPhoneControl, |
|
3412 |
"CPhoneState::IsKeyLockOn() Lock Status: %d", |
|
3413 |
keyLockStatus.Boolean() ); |
|
3414 |
return keyLockStatus.Boolean(); |
|
3415 |
} |
|
3416 |
||
3417 |
// --------------------------------------------------------- |
|
3418 |
// CPhoneState::CompleteSatRequestL |
|
3419 |
// --------------------------------------------------------- |
|
3420 |
// |
|
3421 |
EXPORT_C void CPhoneState::CompleteSatRequestL( const TInt aCallId ) |
|
3422 |
{ |
|
3423 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CompleteSatRequestL( ) "); |
|
3424 |
iStateMachine->SetCallId( aCallId ); |
|
3425 |
iStateMachine->SendPhoneEngineMessage( |
|
3426 |
MPEPhoneModel::EPEMessageSatCallRequestCompleted ); |
|
3427 |
} |
|
3428 |
||
3429 |
// --------------------------------------------------------- |
|
3430 |
// CPhoneState::SetTouchPaneButtons |
|
3431 |
// --------------------------------------------------------- |
|
3432 |
// |
|
3433 |
EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ ) |
|
3434 |
{ |
|
3435 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3436 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3437 |
TPhoneCmdParamBoolean muteParam; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3438 |
muteParam.SetBoolean( iStateMachine->PhoneEngineInfo()->AudioMute() ); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3439 |
iViewCommandHandle->ExecuteCommand(EPhoneViewSetMuteFlag,&muteParam); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3440 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3441 |
const TPEAudioOutput audioOutput = |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3442 |
iStateMachine->PhoneEngineInfo()->AudioOutput(); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3443 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3444 |
TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3445 |
EPEBTAudioAccessory ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3446 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3447 |
TPhoneCmdParamBoolean btParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3448 |
btParam.SetBoolean( audioOutput == EPEBTAudioAccessory ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3449 |
iViewCommandHandle->ExecuteCommand(EPhoneViewSetBlueToothFlag,&btParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3450 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3451 |
TPhoneCmdParamBoolean btAvailableParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3452 |
btAvailableParam.SetBoolean( btAvailable ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3453 |
iViewCommandHandle->ExecuteCommand( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3454 |
EPhoneViewSetBluetoothAvailableFlag,&btAvailableParam); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
3455 |
|
37 | 3456 |
TBool emergency( EPEStateIdle != |
3457 |
iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) ); |
|
3458 |
TPhoneCmdParamBoolean booleanParam; |
|
3459 |
booleanParam.SetBoolean( emergency ); |
|
3460 |
||
3461 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3462 |
EPhoneViewSetTouchPaneButtons, |
|
3463 |
&booleanParam ) ); |
|
3464 |
SetTouchPaneVisible( ETrue ); |
|
3465 |
} |
|
3466 |
} |
|
3467 |
||
3468 |
// --------------------------------------------------------- |
|
3469 |
// CPhoneState::DeleteTouchPaneButtons |
|
3470 |
// --------------------------------------------------------- |
|
3471 |
// |
|
3472 |
EXPORT_C void CPhoneState::DeleteTouchPaneButtons() |
|
3473 |
{ |
|
3474 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3475 |
{ |
|
3476 |
TPhoneCmdParamBoolean boolParam; |
|
3477 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3478 |
EPhoneViewSetTouchPaneButtons, |
|
3479 |
&boolParam ) ); |
|
3480 |
SetTouchPaneVisible( EFalse ); |
|
3481 |
} |
|
3482 |
} |
|
3483 |
||
3484 |
// --------------------------------------------------------- |
|
3485 |
// CPhoneState::SetTouchPaneVisible |
|
3486 |
// --------------------------------------------------------- |
|
3487 |
// |
|
3488 |
EXPORT_C void CPhoneState::SetTouchPaneVisible( TBool aVisible ) |
|
3489 |
{ |
|
3490 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3491 |
{ |
|
3492 |
TPhoneCmdParamBoolean booleanParam; |
|
3493 |
booleanParam.SetBoolean( aVisible ); |
|
3494 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
3495 |
EPhoneViewSetTouchPaneVisible, |
|
3496 |
&booleanParam ) ); |
|
3497 |
} |
|
3498 |
} |
|
3499 |
||
3500 |
// ---------------------------------------------------------------------------- |
|
3501 |
// CPhoneState::SetTouchButtonEnabled |
|
3502 |
// ---------------------------------------------------------------------------- |
|
3503 |
// |
|
3504 |
EXPORT_C void CPhoneState::SetTouchPaneButtonEnabled( TInt aCommandId ) |
|
3505 |
{ |
|
3506 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3507 |
{ |
|
3508 |
TPhoneCmdParamInteger commandParam; |
|
3509 |
commandParam.SetInteger( aCommandId ); |
|
3510 |
iViewCommandHandle->ExecuteCommand( EPhoneViewEnableTouchButton, |
|
3511 |
&commandParam ); |
|
3512 |
} |
|
3513 |
} |
|
3514 |
||
3515 |
// ---------------------------------------------------------------------------- |
|
3516 |
// CPhoneState::SetTouchButtonDisabled |
|
3517 |
// ---------------------------------------------------------------------------- |
|
3518 |
// |
|
3519 |
EXPORT_C void CPhoneState::SetTouchPaneButtonDisabled( TInt aCommandId ) |
|
3520 |
{ |
|
3521 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
3522 |
{ |
|
3523 |
TPhoneCmdParamInteger commandParam; |
|
3524 |
commandParam.SetInteger( aCommandId ); |
|
3525 |
||
3526 |
iViewCommandHandle->ExecuteCommand( EPhoneViewDisableTouchButton, |
|
3527 |
&commandParam ); |
|
3528 |
} |
|
3529 |
} |
|
3530 |
||
3531 |
// --------------------------------------------------------- |
|
3532 |
// CPhoneState::HandleLongHashL |
|
3533 |
// --------------------------------------------------------- |
|
3534 |
// |
|
3535 |
EXPORT_C void CPhoneState::HandleLongHashL() |
|
3536 |
{ |
|
3537 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() "); |
|
3538 |
||
3539 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
3540 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
3541 |
&numberEntryCountParam ); |
|
3542 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
3543 |
||
3544 |
if( iCustomization && iCustomization->AllowAlphaNumericMode() ) |
|
3545 |
{ |
|
3546 |
if ( NumberEntryManagerL()->NumberEntryInNumericModeL() ) |
|
3547 |
{ |
|
3548 |
if ( neLength == 0 ) |
|
3549 |
{ |
|
3550 |
OnlyHashInNumberEntryL(); |
|
3551 |
} |
|
3552 |
||
3553 |
if ( neLength == 1 ) |
|
3554 |
{ |
|
3555 |
NumberEntryClearL(); |
|
3556 |
} |
|
3557 |
} |
|
3558 |
NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL(); |
|
3559 |
} |
|
3560 |
else |
|
3561 |
{ |
|
3562 |
if( neLength == 1 ) |
|
3563 |
{ |
|
3564 |
TPhoneCmdParamBoolean isSecurityMode; |
|
3565 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
3566 |
||
3567 |
if ( !isSecurityMode.Boolean() ) |
|
3568 |
{ |
|
3569 |
OnlyHashInNumberEntryL(); |
|
3570 |
} |
|
3571 |
} |
|
3572 |
} |
|
3573 |
} |
|
3574 |
||
3575 |
// ----------------------------------------------------------- |
|
3576 |
// CPhoneState::OpenVKBL |
|
3577 |
// ----------------------------------------------------------- |
|
3578 |
// |
|
3579 |
void CPhoneState::OpenVkbL() |
|
3580 |
{ |
|
3581 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() "); |
|
3582 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard ); |
|
3583 |
} |
|
3584 |
||
3585 |
// ----------------------------------------------------------- |
|
3586 |
// CPhoneState::BeginUiUpdateLC |
|
3587 |
// ----------------------------------------------------------- |
|
3588 |
// |
|
3589 |
EXPORT_C void CPhoneState::BeginUiUpdateLC() |
|
3590 |
{ |
|
3591 |
||
3592 |
iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
|
3593 |
||
3594 |
TCleanupItem operation( UiUpdateCleanup, this ); |
|
3595 |
CleanupStack::PushL( operation ); |
|
3596 |
} |
|
3597 |
||
3598 |
// ----------------------------------------------------------- |
|
3599 |
// CPhoneState::BeginTransEffectLC |
|
3600 |
// ----------------------------------------------------------- |
|
3601 |
// |
|
3602 |
EXPORT_C void CPhoneState::BeginTransEffectLC( TStateTransEffectType aType ) |
|
3603 |
{ |
|
3604 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) "); |
|
3605 |
TPhoneCmdParamTransEffect effectParam; |
|
3606 |
||
3607 |
switch ( aType ) |
|
3608 |
{ |
|
3609 |
case ENumberEntryOpen: |
|
3610 |
effectParam.SetType( EPhoneTransEffectDialerOpen ); |
|
3611 |
break; |
|
3612 |
case ENumberEntryClose: |
|
3613 |
effectParam.SetType( EPhoneTransEffectDialerClose ); |
|
3614 |
break; |
|
3615 |
case ENumberEntryCreate: |
|
3616 |
effectParam.SetType( EPhoneTransEffectDialerCreate ); |
|
3617 |
break; |
|
3618 |
default: |
|
3619 |
effectParam.SetType( EPhoneTransEffectNone ); |
|
3620 |
} |
|
3621 |
||
3622 |
iViewCommandHandle->ExecuteCommand( EPhoneViewBeginTransEffect, &effectParam ); |
|
3623 |
||
3624 |
TCleanupItem operation( EffectCleanup, this ); |
|
3625 |
CleanupStack::PushL( operation ); |
|
3626 |
} |
|
3627 |
||
3628 |
// ----------------------------------------------------------- |
|
3629 |
// CPhoneState::EndUiUpdate |
|
3630 |
// ----------------------------------------------------------- |
|
3631 |
// |
|
3632 |
EXPORT_C void CPhoneState::EndUiUpdate() |
|
3633 |
{ |
|
3634 |
CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
|
3635 |
} |
|
3636 |
||
3637 |
// ----------------------------------------------------------- |
|
3638 |
// CPhoneState::EndTransEffect |
|
3639 |
// ----------------------------------------------------------- |
|
3640 |
// |
|
3641 |
EXPORT_C void CPhoneState::EndTransEffect() |
|
3642 |
{ |
|
3643 |
CleanupStack::PopAndDestroy(); // Call EffectCleanup |
|
3644 |
} |
|
3645 |
||
3646 |
// ----------------------------------------------------------- |
|
3647 |
// CPhoneState::CheckIfShowTerminationNote |
|
3648 |
// This method is intended to be overridden in states |
|
3649 |
// that contain more info about decision. |
|
3650 |
// ----------------------------------------------------------- |
|
3651 |
// |
|
3652 |
EXPORT_C TBool CPhoneState::CheckIfShowCallTerminationNote( ) |
|
3653 |
{ |
|
3654 |
TBool show = EFalse; |
|
3655 |
TInt callSummaryActivated = 0; |
|
3656 |
const TInt err = CPhoneCenRepProxy::Instance()->GetInt( |
|
3657 |
KCRUidCommonTelephonySettings, |
|
3658 |
KSettingsSummaryAfterCall, |
|
3659 |
callSummaryActivated ); |
|
3660 |
||
3661 |
if ( err == KErrNone && callSummaryActivated ) |
|
3662 |
{ |
|
3663 |
show = ETrue; |
|
3664 |
} |
|
3665 |
||
3666 |
return show; |
|
3667 |
} |
|
3668 |
||
3669 |
// ----------------------------------------------------------------------------- |
|
3670 |
// CPhoneState::HandleDtmfKeyTone |
|
3671 |
// Called from KeyEventForwarder |
|
3672 |
// Allow only special characters to pass from |
|
3673 |
// keyEventForwarder to phoneEngine |
|
3674 |
// ----------------------------------------------------------------------------- |
|
3675 |
// |
|
3676 |
||
3677 |
EXPORT_C void CPhoneState::HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent, |
|
3678 |
TEventCode aEventCode ) |
|
3679 |
{ |
|
3680 |
SendDtmfKeyEventL( aKeyEvent, aEventCode ); |
|
3681 |
} |
|
3682 |
||
3683 |
// ----------------------------------------------------------------------------- |
|
3684 |
// CPhoneState::UiUpdateCleanup |
|
3685 |
// ----------------------------------------------------------------------------- |
|
3686 |
// |
|
3687 |
void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
|
3688 |
{ |
|
3689 |
static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3690 |
EPhoneViewEndUpdate ); |
|
3691 |
} |
|
3692 |
||
3693 |
// ----------------------------------------------------------------------------- |
|
3694 |
// CPhoneState::EffectCleanup |
|
3695 |
// ----------------------------------------------------------------------------- |
|
3696 |
// |
|
3697 |
void CPhoneState::EffectCleanup(TAny* aThis ) |
|
3698 |
{ |
|
3699 |
TPhoneCmdParamTransEffect effectParam; |
|
3700 |
effectParam.SetType( EPhoneTransEffectStop ); |
|
3701 |
||
3702 |
static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3703 |
EPhoneViewEndTransEffect, &effectParam ); |
|
3704 |
} |
|
3705 |
||
3706 |
// ----------------------------------------------------------------------------- |
|
3707 |
// CPhoneState::IsDTMFEditorVisibleL |
|
3708 |
// ----------------------------------------------------------------------------- |
|
3709 |
// |
|
3710 |
EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const |
|
3711 |
{ |
|
3712 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsDTMFEditorVisibleL( ) "); |
|
3713 |
return iViewCommandHandle->HandleCommandL( |
|
3714 |
EPhoneViewIsDTMFEditorVisible ) == |
|
3715 |
EPhoneViewResponseSuccess; |
|
3716 |
} |
|
3717 |
||
3718 |
// ----------------------------------------------------------------------------- |
|
3719 |
// CPhoneState::CloseDTMFEditorL |
|
3720 |
// ----------------------------------------------------------------------------- |
|
3721 |
// |
|
3722 |
EXPORT_C void CPhoneState::CloseDTMFEditorL() |
|
3723 |
{ |
|
3724 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()"); |
|
3725 |
if ( iOnScreenDialer ) // Touch |
|
3726 |
{ |
|
3727 |
TPhoneCmdParamBoolean booleanParam; |
|
3728 |
booleanParam.SetBoolean( EFalse ); |
|
3729 |
// Disable dialer DTMF mode |
|
3730 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible, |
|
3731 |
&booleanParam ); |
|
3732 |
||
3733 |
// Closing effect is shown when DTMF dialer exist. |
|
3734 |
BeginTransEffectLC( ENumberEntryClose ); |
|
3735 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3736 |
EndTransEffect(); |
|
3737 |
} |
|
3738 |
else // Non-Touch |
|
3739 |
{ |
|
3740 |
// If dtmf query is visible then remove number entry |
|
3741 |
// because it should not be shown if user has pressed end key. |
|
3742 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
3743 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
3744 |
} |
|
3745 |
||
3746 |
// Do state-specific behaviour if number entry is cleared |
|
3747 |
HandleNumberEntryClearedL(); |
|
3748 |
} |
|
3749 |
||
3750 |
// ----------------------------------------------------------- |
|
3751 |
// CPhoneState::SetDefaultFlagsL() |
|
3752 |
// ----------------------------------------------------------- |
|
3753 |
// |
|
3754 |
EXPORT_C void CPhoneState::SetDefaultFlagsL() |
|
3755 |
{ |
|
3756 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetDefaultFlagsL()"); |
|
3757 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
3758 |
||
3759 |
// Reset Hold flag to view |
|
3760 |
TPhoneCmdParamBoolean holdFlag; |
|
3761 |
holdFlag.SetBoolean( EFalse ); |
|
3762 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
3763 |
||
3764 |
// Update FSW |
|
3765 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
3766 |
||
3767 |
// Re-enable global notes |
|
3768 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
3769 |
globalNotifierParam.SetBoolean( EFalse ); |
|
3770 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
3771 |
&globalNotifierParam ); |
|
3772 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
3773 |
&globalNotifierParam ); |
|
3774 |
||
3775 |
// uncapture App and Camera keys if not security mode |
|
3776 |
TPhoneCmdParamBoolean isSecurityMode; |
|
3777 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
3778 |
if ( !isSecurityMode.Boolean() ) |
|
3779 |
{ |
|
3780 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
3781 |
} |
|
3782 |
||
3783 |
// Restore keylock if phone has been locked before call. |
|
3784 |
if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
3785 |
{ |
|
3786 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock ); |
|
3787 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
3788 |
} |
|
3789 |
} |
|
3790 |
||
3791 |
// ----------------------------------------------------------- |
|
3792 |
// CPhoneState::GetVolumeLevel |
|
3793 |
// ----------------------------------------------------------- |
|
3794 |
// |
|
3795 |
TInt CPhoneState::GetVolumeLevel() |
|
3796 |
{ |
|
3797 |
TPhoneCmdParamInteger integerParam; |
|
3798 |
||
3799 |
iViewCommandHandle->ExecuteCommand( EPhoneViewGetAudioVolumeLevel, |
|
3800 |
&integerParam ); |
|
3801 |
return integerParam.Integer(); |
|
3802 |
} |
|
3803 |
||
3804 |
// ----------------------------------------------------------- |
|
3805 |
// CPhoneState::ShowVideoCallOutOfMemoryNoteL |
|
3806 |
// ----------------------------------------------------------- |
|
3807 |
// |
|
3808 |
void CPhoneState::ShowVideoCallOutOfMemoryNoteL() |
|
3809 |
{ |
|
3810 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
3811 |
"CPhoneState::ShowVideoCallOutOfMemoryNoteL()" ); |
|
3812 |
||
3813 |
// Re-enable global notes |
|
3814 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
3815 |
globalNotifierParam.SetBoolean( EFalse ); |
|
3816 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
3817 |
&globalNotifierParam ); |
|
3818 |
||
3819 |
// Bring Phone app in the foreground |
|
3820 |
TPhoneCmdParamInteger uidParam; |
|
3821 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
3822 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
3823 |
&uidParam ); |
|
3824 |
||
3825 |
// Set Phone as the top application |
|
3826 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
3827 |
&uidParam ); |
|
3828 |
||
3829 |
// Display error note |
|
3830 |
SExtendedError ext; |
|
3831 |
ext.iComponent = KUidPhoneApplication; |
|
3832 |
ext.iErrorNumber = KErrNoMemory; |
|
3833 |
ext.iInformation = EFalse; |
|
3834 |
TBuf<1> ignore; |
|
3835 |
iAvkonAppUi->HandleError( KErrNoMemory, ext, ignore, ignore ); |
|
3836 |
} |
|
3837 |
||
3838 |
// ----------------------------------------------------------------------------- |
|
3839 |
// CPhoneState::SimSecurityStatus |
|
3840 |
// ----------------------------------------------------------------------------- |
|
3841 |
// |
|
3842 |
TInt CPhoneState::SimSecurityStatus() const |
|
3843 |
{ |
|
3844 |
/* |
|
3845 |
Sim security statuses: |
|
3846 |
||
3847 |
ESimSecurityStatusUninitialized = KStartupEnumerationFirstValue, |
|
3848 |
ESimRejected, // The PUK code has been entered incorrectly, so the card is rejected. |
|
3849 |
ESimUnaccepted // The SIM lock is on, so the card is unaccepted. |
|
3850 |
*/ |
|
3851 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimSecurityStatus()" ); |
|
3852 |
return CPhonePubSubProxy::Instance()->Value( |
|
3853 |
KPSUidStartup, KStartupSimSecurityStatus ); |
|
3854 |
} |
|
3855 |
||
3856 |
// ----------------------------------------------------------------------------- |
|
3857 |
// CPhoneState::CallWaitingNoteL |
|
3858 |
// ----------------------------------------------------------------------------- |
|
3859 |
// |
|
3860 |
EXPORT_C void CPhoneState::CallWaitingNoteL( TInt aCallId ) |
|
3861 |
{ |
|
3862 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallWaitingNoteL()" ); |
|
3863 |
||
3864 |
TBuf< KPhoneContactNameMaxLength > callText( KNullDesC ); |
|
3865 |
||
3866 |
// Set CLI text for the call header |
|
3867 |
const TBool contactInfoAvailable = |
|
3868 |
iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() || |
|
3869 |
iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length(); |
|
3870 |
||
3871 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3872 |
"CPhoneState::CallWaitingNoteL - contactInfoAvailable(%d)", contactInfoAvailable ); |
|
3873 |
||
3874 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3875 |
"CPhoneState::CallWaitingNoteL - remote name(%S)", |
|
3876 |
&iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) ); |
|
3877 |
||
3878 |
__PHONELOG1( EBasic, EPhoneControl, |
|
3879 |
"CPhoneState::CallWaitingNoteL - company name(%S)", |
|
3880 |
&iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) ); |
|
3881 |
||
3882 |
if ( contactInfoAvailable ) |
|
3883 |
{ |
|
3884 |
// Set Call Text flag to waiting note |
|
3885 |
callText = iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ); |
|
3886 |
||
3887 |
// if no remote name available then set company name |
|
3888 |
if ( callText == KNullDesC ) |
|
3889 |
{ |
|
3890 |
callText = iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ); |
|
3891 |
} |
|
3892 |
||
3893 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
3894 |
globalNoteParam.SetText( callText ); |
|
3895 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
3896 |
globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
|
3897 |
globalNoteParam.SetTextResourceId( |
|
3898 |
CPhoneMainResourceResolver::Instance()-> |
|
3899 |
ResolveResourceID( EPhoneCallWaitingWithLabel ) ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3900 |
globalNoteParam.SetNotificationDialog( ETrue ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3901 |
|
37 | 3902 |
iViewCommandHandle->ExecuteCommandL( |
3903 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
3904 |
} |
|
3905 |
else |
|
3906 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
3907 |
SendGlobalInfoNoteL( EPhoneCallWaitingWithoutLabel, ETrue ); |
37 | 3908 |
} |
3909 |
} |
|
3910 |
||
3911 |
// ---------------------------------------------------------------------------- |
|
3912 |
// CPhoneState::SetRingingTonePlaybackL() |
|
3913 |
// ---------------------------------------------------------------------------- |
|
3914 |
// |
|
3915 |
EXPORT_C void CPhoneState::SetRingingTonePlaybackL( TInt aCallId ) |
|
3916 |
{ |
|
3917 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
3918 |
"CPhoneState::SetRingingTonePlaybackL()" ); |
|
3919 |
||
3920 |
TPhoneCmdParamRingTone ringToneParam; |
|
3921 |
ringToneParam.SetVolume( |
|
3922 |
iStateMachine->PhoneEngineInfo()->RingingVolume() ); |
|
3923 |
||
3924 |
TArray< TContactItemId > alertGroups = |
|
3925 |
iStateMachine->PhoneEngineInfo()->AlertForGroup(); |
|
3926 |
||
3927 |
TInt alertGroupCount = alertGroups.Count(); |
|
3928 |
TInt contactGroupCount = |
|
3929 |
iStateMachine->PhoneEngineInfo()->ContactGroups( aCallId ).Count(); |
|
3930 |
TBool alertingGroupFound( EFalse ); |
|
3931 |
||
3932 |
// Check contents of both the alerting groups array and call contact group |
|
3933 |
// array, if any of the group ids match then allow playing. |
|
3934 |
if ( alertGroupCount > 0 ) |
|
3935 |
{ |
|
3936 |
for ( TInt i = 0 ; i < alertGroupCount ; i++ ) |
|
3937 |
{ |
|
3938 |
for ( TInt j = 0 ; j < contactGroupCount ; j++ ) |
|
3939 |
{ |
|
3940 |
if ( alertGroups[ i ] == |
|
3941 |
( iStateMachine->PhoneEngineInfo()->ContactGroups( |
|
3942 |
aCallId ) )[ j ] ) |
|
3943 |
{ |
|
3944 |
alertingGroupFound = ETrue; |
|
3945 |
} |
|
3946 |
} |
|
3947 |
} |
|
3948 |
if ( alertingGroupFound == EFalse ) |
|
3949 |
{ |
|
3950 |
ringToneParam.SetRingingType( EProfileRingingTypeSilent ); |
|
3951 |
} |
|
3952 |
else |
|
3953 |
{ |
|
3954 |
ringToneParam.SetRingingType( |
|
3955 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
3956 |
} |
|
3957 |
} |
|
3958 |
else // no alerting groups set |
|
3959 |
{ |
|
3960 |
ringToneParam.SetRingingType( |
|
3961 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
3962 |
} |
|
3963 |
||
3964 |
// Set ring tone |
|
3965 |
if ( iStateMachine->PhoneEngineInfo()->PersonalRingingTone( |
|
3966 |
aCallId ).Length() ) |
|
3967 |
{ |
|
3968 |
// Set the personal ring tone |
|
3969 |
ringToneParam.SetRingTone( |
|
3970 |
iStateMachine->PhoneEngineInfo()->PersonalRingingTone( aCallId ) ); |
|
3971 |
ringToneParam.SetType( EPhoneRingTonePersonal ); |
|
3972 |
} |
|
3973 |
else if ( iStateMachine->PhoneEngineInfo()->RingingTone( |
|
3974 |
aCallId ).Length() ) |
|
3975 |
{ |
|
3976 |
// Set the profile ring tone |
|
3977 |
ringToneParam.SetRingTone( |
|
3978 |
iStateMachine->PhoneEngineInfo()->RingingTone( aCallId ) ); |
|
3979 |
ringToneParam.SetType( EPhoneRingToneProfile ); |
|
3980 |
||
3981 |
if ( ( iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 && |
|
3982 |
BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), |
|
3983 |
iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ) ) ) || |
|
3984 |
iStateMachine->PhoneEngineInfo()->HasCallerThumbnail( aCallId ) ) |
|
3985 |
{ |
|
3986 |
// Caller image set |
|
3987 |
ringToneParam.SetCallerImageStatus( ETrue ); |
|
3988 |
} |
|
3989 |
} |
|
3990 |
||
3991 |
// Set text to say, if enabled |
|
3992 |
if ( iStateMachine->PhoneEngineInfo()->TextToSpeech() ) |
|
3993 |
{ |
|
3994 |
ringToneParam.SetTextToSay( |
|
3995 |
iStateMachine->PhoneEngineInfo()->RemoteTextToSpeechText( |
|
3996 |
aCallId ) ); |
|
3997 |
} |
|
3998 |
||
3999 |
if ( iStateMachine->PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 ) |
|
4000 |
{ |
|
4001 |
ringToneParam.SetCallerTextStatus( ETrue ); |
|
4002 |
} |
|
4003 |
||
4004 |
// Play the ring tone |
|
4005 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewPlayRingTone, &ringToneParam ); |
|
4006 |
} |
|
4007 |
||
4008 |
// ----------------------------------------------------------- |
|
4009 |
// CPhoneState::HandleCugNoteL |
|
4010 |
// ----------------------------------------------------------- |
|
4011 |
// |
|
4012 |
void CPhoneState::HandleCugInUseNoteL() |
|
4013 |
{ |
|
4014 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCugInUseNoteL() "); |
|
4015 |
||
4016 |
TInt cugIndex( 0 ); |
|
4017 |
||
4018 |
RSSSettings ssSettings; |
|
4019 |
TInt retValue = ssSettings.Open(); |
|
4020 |
||
4021 |
if ( retValue == KErrNone ) |
|
4022 |
{ |
|
4023 |
ssSettings.Get( ESSSettingsCug, cugIndex ); |
|
4024 |
} |
|
4025 |
ssSettings.Close(); |
|
4026 |
||
4027 |
if ( cugIndex ) |
|
4028 |
{ |
|
4029 |
// Add it to the resource string |
|
4030 |
HBufC* buf = StringLoader::LoadLC( |
|
4031 |
CPhoneMainResourceResolver::Instance()-> |
|
4032 |
ResolveResourceID( |
|
4033 |
EPhoneInfoCugInUse ), cugIndex ); |
|
4034 |
||
4035 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
4036 |
globalNoteParam.SetText( *buf ); |
|
4037 |
globalNoteParam.SetType( EAknGlobalInformationNote ); |
|
4038 |
globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
|
4039 |
||
4040 |
iViewCommandHandle->ExecuteCommandL( |
|
4041 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
4042 |
||
4043 |
CleanupStack::PopAndDestroy( buf ); |
|
4044 |
} |
|
4045 |
} |
|
4046 |
||
4047 |
// ----------------------------------------------------------- |
|
4048 |
// CPhoneState::CallheaderManagerL |
|
4049 |
// ----------------------------------------------------------- |
|
4050 |
// |
|
4051 |
CPhoneCallHeaderManager* CPhoneState::CallheaderManagerL() |
|
4052 |
{ |
|
4053 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::CallheaderManagerL() "); |
|
4054 |
if ( !iCallHeaderManager ) |
|
4055 |
{ |
|
4056 |
iCallHeaderManager = CPhoneCallHeaderManager::NewL( |
|
4057 |
*iViewCommandHandle, |
|
4058 |
*iStateMachine, |
|
4059 |
iCustomization ); |
|
4060 |
} |
|
4061 |
return iCallHeaderManager; |
|
4062 |
} |
|
4063 |
||
4064 |
// ----------------------------------------------------------------------------- |
|
4065 |
// CPhoneState::CloseCustomizedDialerL |
|
4066 |
// ----------------------------------------------------------------------------- |
|
4067 |
// |
|
4068 |
EXPORT_C void CPhoneState::CloseCustomizedDialerL() |
|
4069 |
{ |
|
4070 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) "); |
|
4071 |
||
4072 |
// Set dialer back to default mode. |
|
4073 |
iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer ); |
|
4074 |
||
4075 |
// Closing effect is shown when customized dialer exist. |
|
4076 |
BeginTransEffectLC( ENumberEntryClose ); |
|
4077 |
||
4078 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
4079 |
||
4080 |
EndTransEffect(); |
|
4081 |
// Do state-specific behaviour if number entry is cleared |
|
4082 |
HandleNumberEntryClearedL(); |
|
4083 |
} |
|
4084 |
||
4085 |
// ----------------------------------------------------------------------------- |
|
4086 |
// CPhoneState::CustomizedDialerMenuResourceId |
|
4087 |
// ----------------------------------------------------------------------------- |
|
4088 |
// |
|
4089 |
EXPORT_C TInt CPhoneState::CustomizedDialerMenuResourceIdL() |
|
4090 |
{ |
|
4091 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
4092 |
"CPhoneState::CustomizedDialerMenuResourceId( ) "); |
|
4093 |
// Get and return customized dialer menu resource id |
|
4094 |
TPhoneCmdParamInteger integerParam; |
|
4095 |
iViewCommandHandle->HandleCommandL( |
|
4096 |
EPhoneViewGetCustomizedDialerMenuResourceId, |
|
4097 |
&integerParam ); |
|
4098 |
return integerParam.Integer(); |
|
4099 |
} |
|
4100 |
||
4101 |
// ----------------------------------------------------------------------------- |
|
4102 |
// CPhoneState::CustomizedDialerCbaResourceId |
|
4103 |
// ----------------------------------------------------------------------------- |
|
4104 |
// |
|
4105 |
EXPORT_C TInt CPhoneState::CustomizedDialerCbaResourceIdL() |
|
4106 |
{ |
|
4107 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
4108 |
"CPhoneState::CustomizedDialerCbaResourceId( ) "); |
|
4109 |
// Get and return customized dialer CBA resource id |
|
4110 |
TPhoneCmdParamInteger integerParam; |
|
4111 |
iViewCommandHandle->HandleCommandL( |
|
4112 |
EPhoneViewGetCustomizedDialerCbaResourceId, |
|
4113 |
&integerParam ); |
|
4114 |
return integerParam.Integer(); |
|
4115 |
} |
|
4116 |
||
4117 |
// ----------------------------------------------------------- |
|
4118 |
// CPhoneState::ShowDtmfDialerL |
|
4119 |
// ----------------------------------------------------------- |
|
4120 |
// |
|
4121 |
void CPhoneState::ShowDtmfDialerL() |
|
4122 |
{ |
|
4123 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
4124 |
"CPhoneState::ShowDtmfDialerL()" ); |
|
4125 |
||
4126 |
// Set dialer to DTMF mode. |
|
4127 |
TPhoneCmdParamBoolean booleanParam; |
|
4128 |
booleanParam.SetBoolean( ETrue ); |
|
4129 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible, |
|
4130 |
&booleanParam ); |
|
4131 |
||
4132 |
BeginTransEffectLC( ENumberEntryCreate ); |
|
4133 |
||
4134 |
if ( IsNumberEntryUsedL() ) |
|
4135 |
{ |
|
4136 |
// Store the number entry content to cache |
|
4137 |
if ( !IsNumberEntryContentStored() ) |
|
4138 |
{ |
|
4139 |
StoreNumberEntryContentL(); |
|
4140 |
} |
|
4141 |
// Clear and display DTMF dialer |
|
4142 |
NumberEntryClearL(); |
|
4143 |
SetNumberEntryVisibilityL(ETrue); |
|
4144 |
} |
|
4145 |
else |
|
4146 |
{ |
|
4147 |
// Create and display DTMF dialer |
|
4148 |
NumberEntryManagerL()->CreateNumberEntryL(); |
|
4149 |
} |
|
4150 |
||
4151 |
EndTransEffect(); |
|
4152 |
||
4153 |
// Update CBA |
|
4154 |
iCbaManager->UpdateInCallCbaL(); |
|
4155 |
} |
|
4156 |
||
4157 |
// ----------------------------------------------------------- |
|
4158 |
// CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer |
|
4159 |
// ----------------------------------------------------------- |
|
4160 |
// |
|
4161 |
EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer() |
|
4162 |
{ |
|
4163 |
if ( IsOnScreenDialerSupported() ) |
|
4164 |
{ |
|
4165 |
TBool isDialerVisible( EFalse ); |
|
4166 |
TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() ); |
|
4167 |
||
4168 |
if ( isDialerVisible ) |
|
4169 |
{ |
|
4170 |
TRAP_IGNORE( CloseDTMFEditorL() ); |
|
4171 |
} |
|
4172 |
||
4173 |
// if the DTMF dialer is used before the idle message, we have to |
|
4174 |
// restore the original content of the number entry |
|
4175 |
if ( IsNumberEntryContentStored() ) |
|
4176 |
{ |
|
4177 |
TBool isNumberEntryUsed( EFalse ); |
|
4178 |
TRAP_IGNORE( isNumberEntryUsed = IsNumberEntryUsedL() ); |
|
4179 |
||
4180 |
if ( !isNumberEntryUsed ) |
|
4181 |
{ |
|
4182 |
TRAP_IGNORE( NumberEntryManagerL()->CreateNumberEntryL() ); |
|
4183 |
} |
|
4184 |
// Restore the number entry content from cache |
|
4185 |
TRAP_IGNORE( RestoreNumberEntryContentL() ); |
|
4186 |
} |
|
4187 |
} |
|
4188 |
} |
|
4189 |
||
4190 |
// ----------------------------------------------------------- |
|
4191 |
// CPhoneState::IsOnScreenDialerSupported |
|
4192 |
// ----------------------------------------------------------- |
|
4193 |
// |
|
4194 |
EXPORT_C TBool CPhoneState::IsOnScreenDialerSupported() const |
|
4195 |
{ |
|
4196 |
return iOnScreenDialer; |
|
4197 |
} |
|
4198 |
||
4199 |
// --------------------------------------------------------------------------- |
|
4200 |
// CPhoneState::LoadResource |
|
4201 |
// --------------------------------------------------------------------------- |
|
4202 |
// |
|
4203 |
void CPhoneState::LoadResource( TDes& aData, const TInt aResource ) const |
|
4204 |
{ |
|
4205 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() "); |
|
4206 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource ); |
|
4207 |
StringLoader::Load( aData, |
|
4208 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), |
|
4209 |
&iEnv ); |
|
4210 |
} |
|
4211 |
||
4212 |
// ----------------------------------------------------------- |
|
4213 |
// CPhoneState::IsAnyConnectedCalls |
|
4214 |
// ----------------------------------------------------------- |
|
4215 |
// |
|
4216 |
TBool CPhoneState::IsAnyConnectedCalls() |
|
4217 |
{ |
|
4218 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAnyConnectedCalls() "); |
|
4219 |
TBool connectedCall(EFalse); |
|
4220 |
if ( iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnected ) || |
|
4221 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnecting ) || |
|
4222 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnectedConference ) ) |
|
4223 |
{ |
|
4224 |
connectedCall = ETrue; |
|
4225 |
} |
|
4226 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyConnectedCalls: (%d)", connectedCall ); |
|
4227 |
return connectedCall; |
|
4228 |
} |
|
4229 |
||
4230 |
// ----------------------------------------------------------- |
|
4231 |
// CPhoneState::NumberEntryContentL |
|
4232 |
// ----------------------------------------------------------- |
|
4233 |
// |
|
4234 |
CPhoneNumberEntryManager* CPhoneState::NumberEntryManagerL() |
|
4235 |
{ |
|
4236 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::NumberEntryContentL() "); |
|
4237 |
if ( !iNumberEntryManager ) |
|
4238 |
{ |
|
4239 |
iNumberEntryManager = CPhoneNumberEntryManager::NewL( |
|
4240 |
this, |
|
4241 |
*iViewCommandHandle, |
|
4242 |
*iStateMachine, |
|
4243 |
iCustomization, |
|
4244 |
*iCbaManager ); |
|
4245 |
} |
|
4246 |
return iNumberEntryManager; |
|
4247 |
} |
|
4248 |
||
4249 |
// ----------------------------------------------------------- |
|
4250 |
// CPhoneState::PhoneNumberFromEntryLC() |
|
4251 |
// ----------------------------------------------------------- |
|
4252 |
// |
|
4253 |
EXPORT_C HBufC* CPhoneState::PhoneNumberFromEntryLC() |
|
4254 |
{ |
|
4255 |
return NumberEntryManagerL()->PhoneNumberFromEntryLC(); |
|
4256 |
} |
|
4257 |
||
4258 |
// ----------------------------------------------------------- |
|
4259 |
// CPhoneState::IsNumberEntryUsedL |
|
4260 |
// ----------------------------------------------------------- |
|
4261 |
// |
|
4262 |
EXPORT_C TBool CPhoneState::IsNumberEntryUsedL() |
|
4263 |
{ |
|
4264 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryUsedL( ) "); |
|
4265 |
return NumberEntryManagerL()->IsNumberEntryUsedL(); |
|
4266 |
} |
|
4267 |
||
4268 |
// ----------------------------------------------------------- |
|
4269 |
// CPhoneState::IsNumberEntryVisibleL |
|
4270 |
// ----------------------------------------------------------- |
|
4271 |
// |
|
4272 |
EXPORT_C TBool CPhoneState::IsNumberEntryVisibleL() |
|
4273 |
{ |
|
4274 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryVisibleL( ) "); |
|
4275 |
return NumberEntryManagerL()->IsNumberEntryVisibleL(); |
|
4276 |
} |
|
4277 |
||
4278 |
// ----------------------------------------------------------- |
|
4279 |
// CPhoneState::KeyEventForExistingNumberEntryL |
|
4280 |
// ----------------------------------------------------------- |
|
4281 |
// |
|
4282 |
void CPhoneState::KeyEventForExistingNumberEntryL( const TKeyEvent& aKeyEvent, |
|
4283 |
TEventCode aEventCode ) |
|
4284 |
{ |
|
4285 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::KeyEventForExistingNumberEntryL( ) "); |
|
4286 |
NumberEntryManagerL()->KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode ); |
|
4287 |
} |
|
4288 |
||
4289 |
// ----------------------------------------------------------- |
|
4290 |
// CPhoneState::HandleNumberEntryClearedL |
|
4291 |
// ----------------------------------------------------------- |
|
4292 |
// |
|
4293 |
EXPORT_C void CPhoneState::HandleNumberEntryClearedL() |
|
4294 |
{ |
|
4295 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumberEntryClearedL( ) "); |
|
4296 |
NumberEntryManagerL()->HandleNumberEntryClearedL(); |
|
4297 |
} |
|
4298 |
||
4299 |
// ----------------------------------------------------------- |
|
4300 |
// CPhoneState::SetNumberEntryVisibilityL |
|
4301 |
// ----------------------------------------------------------- |
|
4302 |
// |
|
4303 |
EXPORT_C void CPhoneState::SetNumberEntryVisibilityL( const TBool aVisible ) |
|
4304 |
{ |
|
4305 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetNumberEntryVisibilityL( ) "); |
|
4306 |
TPhoneCmdParamBoolean booleanParam; |
|
4307 |
booleanParam.SetBoolean( ETrue ); |
|
4308 |
if ( !aVisible ) |
|
4309 |
{ |
|
4310 |
booleanParam.SetBoolean( EFalse ); |
|
4311 |
} |
|
4312 |
NumberEntryManagerL()->SetNumberEntryVisibilityL( booleanParam ); |
|
4313 |
} |
|
4314 |
||
4315 |
// --------------------------------------------------------- |
|
4316 |
// CPhoneState::HandleCreateNumberEntryL |
|
4317 |
// --------------------------------------------------------- |
|
4318 |
// |
|
4319 |
EXPORT_C void CPhoneState::HandleCreateNumberEntryL( |
|
4320 |
const TKeyEvent& /*aKeyEvent*/, |
|
4321 |
TEventCode /*aEventCode*/ ) |
|
4322 |
{ |
|
4323 |
NumberEntryManagerL()->HandleCreateNumberEntryL(); |
|
4324 |
} |
|
4325 |
||
4326 |
// ----------------------------------------------------------- |
|
4327 |
// CPhoneState::IsNumberEntryContentStored |
|
4328 |
// ----------------------------------------------------------- |
|
4329 |
// |
|
4330 |
EXPORT_C TBool CPhoneState::IsNumberEntryContentStored() |
|
4331 |
{ |
|
4332 |
TBool isNumberEntryContentStored( EFalse ); |
|
4333 |
TRAP_IGNORE( isNumberEntryContentStored = NumberEntryManagerL()->IsNumberEntryContentStored() ); |
|
4334 |
return isNumberEntryContentStored; |
|
4335 |
} |
|
4336 |
||
4337 |
// ----------------------------------------------------------- |
|
4338 |
// CPhoneState::StoreNumberEntryContentL |
|
4339 |
// ----------------------------------------------------------- |
|
4340 |
// |
|
4341 |
EXPORT_C void CPhoneState::StoreNumberEntryContentL() |
|
4342 |
{ |
|
4343 |
NumberEntryManagerL()->StoreNumberEntryContentL(); |
|
4344 |
} |
|
4345 |
||
4346 |
// ----------------------------------------------------------- |
|
4347 |
// CPhoneState::RestoreNumberEntryContentL |
|
4348 |
// ----------------------------------------------------------- |
|
4349 |
// |
|
4350 |
EXPORT_C void CPhoneState::RestoreNumberEntryContentL() |
|
4351 |
{ |
|
4352 |
NumberEntryManagerL()->RestoreNumberEntryContentL(); |
|
4353 |
} |
|
4354 |
||
4355 |
// ----------------------------------------------------------- |
|
4356 |
// CPhoneState::ClearNumberEntryContentCache |
|
4357 |
// ----------------------------------------------------------- |
|
4358 |
// |
|
4359 |
EXPORT_C void CPhoneState::ClearNumberEntryContentCache() |
|
4360 |
{ |
|
4361 |
TRAP_IGNORE( NumberEntryManagerL()->ClearNumberEntryContentCache() ); |
|
4362 |
} |
|
4363 |
||
4364 |
// ----------------------------------------------------------- |
|
4365 |
// CPhoneState::HandleNumberEntryEdited |
|
4366 |
// ----------------------------------------------------------- |
|
4367 |
// |
|
4368 |
EXPORT_C void CPhoneState::HandleNumberEntryEdited() |
|
4369 |
{ |
|
4370 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleNumberEntryEdited() "); |
|
4371 |
TRAP_IGNORE( NumberEntryManagerL()->HandleNumberEntryEdited() ); |
|
4372 |
} |
|
4373 |
||
4374 |
// ----------------------------------------------------------------------------- |
|
4375 |
// CPhoneState::IsAlphanumericSupportedAndCharInput |
|
4376 |
// ----------------------------------------------------------------------------- |
|
4377 |
// |
|
4378 |
EXPORT_C TBool CPhoneState::IsAlphanumericSupportedAndCharInput( |
|
4379 |
const TKeyEvent& aKeyEvent ) |
|
4380 |
{ |
|
4381 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAlphanumericSupportedAndCharInput() "); |
|
4382 |
TBool alphaNumericSupport(EFalse); |
|
4383 |
TRAP_IGNORE( alphaNumericSupport = NumberEntryManagerL()->IsAlphanumericSupportedAndCharInput( aKeyEvent ) ); |
|
4384 |
return alphaNumericSupport; |
|
4385 |
} |
|
4386 |
||
4387 |
// --------------------------------------------------------- |
|
4388 |
// CPhoneState::OnlyHashInNumberEntryL |
|
4389 |
// --------------------------------------------------------- |
|
4390 |
// |
|
4391 |
EXPORT_C void CPhoneState::OnlyHashInNumberEntryL() |
|
4392 |
{ |
|
4393 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OnlyHashInNumberEntryL( ) "); |
|
4394 |
// 0.8 seconds has passed, start ALS line change timer |
|
4395 |
StartAlsLineChangeTimerL(); |
|
4396 |
} |
|
4397 |
||
4398 |
// ----------------------------------------------------------- |
|
4399 |
// CPhoneState::NumberEntryClearL |
|
4400 |
// ----------------------------------------------------------- |
|
4401 |
// |
|
4402 |
void CPhoneState::NumberEntryClearL() |
|
4403 |
{ |
|
4404 |
NumberEntryManagerL()->NumberEntryClearL(); |
|
4405 |
} |
|
4406 |
||
4407 |
// ----------------------------------------------------------- |
|
4408 |
// CPhoneState::UpdateSilenceButtonDimming |
|
4409 |
// ----------------------------------------------------------- |
|
4410 |
// |
|
4411 |
EXPORT_C void CPhoneState::UpdateSilenceButtonDimming() |
|
4412 |
{ |
|
4413 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
4414 |
{ |
|
4415 |
const TProfileRingingType ringingType = |
|
4416 |
iStateMachine->PhoneEngineInfo()->RingingType(); |
|
4417 |
||
4418 |
TBool callIsAlerting = |
|
4419 |
!(( ringingType == EProfileRingingTypeSilent ) || |
|
4420 |
( ringingType == EProfileRingingTypeBeepOnce )); |
|
4421 |
||
4422 |
if ( !callIsAlerting ) |
|
4423 |
{ |
|
4424 |
SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent ); |
|
4425 |
} |
|
4426 |
} |
|
4427 |
} |
|
4428 |
||
4429 |
// ----------------------------------------------------------- |
|
4430 |
// CPhoneState::GetBlockedKeyList |
|
4431 |
// ----------------------------------------------------------- |
|
4432 |
// |
|
4433 |
EXPORT_C const RArray<TInt>& CPhoneState::GetBlockedKeyList() const |
|
4434 |
{ |
|
4435 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetBlockedKeyList( ) "); |
|
4436 |
return iStateMachine->PhoneStorage()->GetBlockedKeyList(); |
|
4437 |
} |
|
4438 |
||
4439 |
// ----------------------------------------------------------- |
|
4440 |
// CPhoneState::DisableHWKeysL |
|
4441 |
// ----------------------------------------------------------- |
|
4442 |
// |
|
4443 |
EXPORT_C void CPhoneState::DisableHWKeysL() |
|
4444 |
{ |
|
4445 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableHWKeysL( ) "); |
|
4446 |
||
4447 |
if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
4448 |
{ |
|
4449 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableHWKeysL HW Keys Disabled " ); |
|
4450 |
||
4451 |
iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyNo ); |
|
4452 |
iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyYes ); |
|
4453 |
} |
|
4454 |
} |
|
4455 |
||
4456 |
// ----------------------------------------------------------- |
|
4457 |
// CPhoneState::DisableCallUIL |
|
4458 |
// ----------------------------------------------------------- |
|
4459 |
// |
|
4460 |
EXPORT_C void CPhoneState::DisableCallUIL() |
|
4461 |
{ |
|
4462 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableCallUIL( ) "); |
|
4463 |
||
4464 |
// Set Call UI state to storage |
|
4465 |
if( !iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
4466 |
{ |
|
4467 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableCallUIL CallUI Disabled " ); |
|
4468 |
||
4469 |
// Show keys locked note |
|
4470 |
TPhoneCmdParamNote noteParam; |
|
4471 |
noteParam.SetType( EPhoneNoteUIDisabled ); |
|
4472 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
4473 |
ResolveResourceID( EPhoneInformationNote ) ); |
|
4474 |
||
4475 |
HBufC* noteText = StringLoader::LoadLC( |
|
4476 |
CPhoneMainResourceResolver::Instance()-> |
|
4477 |
ResolveResourceID( EPhoneIncomingCallKeysLocked ) ); |
|
4478 |
noteParam.SetText( *noteText ); |
|
4479 |
||
4480 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
4481 |
CleanupStack::PopAndDestroy( noteText ); |
|
4482 |
||
4483 |
// Start capturing the key guard key |
|
4484 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
4485 |
appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
4486 |
appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
|
4487 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
4488 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
|
4489 |
||
4490 |
// Set Call UI state to storage |
|
4491 |
iStateMachine->PhoneStorage()->SetScreenLocked( ETrue ); |
|
4492 |
} |
|
4493 |
} |
|
4494 |
||
4495 |
// ----------------------------------------------------------- |
|
4496 |
// CPhoneState::EnableCallUIL |
|
4497 |
// ----------------------------------------------------------- |
|
4498 |
// |
|
4499 |
EXPORT_C void CPhoneState::EnableCallUIL() |
|
4500 |
{ |
|
4501 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EnableCallUIL( ) "); |
|
4502 |
||
4503 |
if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
4504 |
{ |
|
4505 |
__PHONELOG( EBasic, EPhoneControl, " CPhoneState::EnableCallUIL CallUI Enabled " ); |
|
4506 |
||
4507 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
4508 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote ); |
|
4509 |
||
4510 |
// Stop capturing the key guard key |
|
4511 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
4512 |
appKeyCaptureParam.SetKey( EStdKeyDevice7 ); |
|
4513 |
appKeyCaptureParam.SetKeyCode( EKeyDeviceF ); |
|
4514 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
4515 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopCapturingKey, &appKeyCaptureParam ); |
|
4516 |
||
4517 |
iStateMachine->PhoneStorage()->SetScreenLocked( EFalse ); |
|
4518 |
} |
|
4519 |
} |
|
4520 |
||
4521 |
// ----------------------------------------------------------- |
|
4522 |
// CPhoneState::CheckDisableHWKeysAndCallUIL |
|
4523 |
// ----------------------------------------------------------- |
|
4524 |
// |
|
4525 |
EXPORT_C void CPhoneState::CheckDisableHWKeysAndCallUIL() |
|
4526 |
{ |
|
4527 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::CheckDisableHWKeysAndCallUIL( ) "); |
|
4528 |
||
4529 |
if( IsKeyLockOn() || IsAutoLockOn() ) |
|
4530 |
{ |
|
4531 |
// Disable HW keys if needed |
|
4532 |
if( CPhoneCenRepProxy::Instance()-> |
|
4533 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
4534 |
{ |
|
4535 |
DisableHWKeysL(); |
|
4536 |
} |
|
4537 |
||
4538 |
// Disable Call UI if needed |
|
4539 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
4540 |
&& !CPhoneCenRepProxy::Instance()-> |
|
4541 |
IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
4542 |
{ |
|
4543 |
DisableCallUIL(); |
|
4544 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( ETrue ); |
|
4545 |
} |
|
4546 |
} |
|
4547 |
} |
|
4548 |
||
4549 |
// ----------------------------------------------------------- |
|
4550 |
// CPhoneState::HandleHoldSwitchL |
|
4551 |
// ----------------------------------------------------------- |
|
4552 |
// |
|
4553 |
EXPORT_C void CPhoneState::HandleHoldSwitchL() |
|
4554 |
{ |
|
4555 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::HandleHoldSwitchL( ) "); |
|
4556 |
||
4557 |
if( CPhoneCenRepProxy::Instance()-> |
|
4558 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
4559 |
{ |
|
4560 |
if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() ) |
|
4561 |
{ |
|
4562 |
// Disable HW Keys if needed |
|
4563 |
DisableHWKeysL(); |
|
4564 |
} |
|
4565 |
else |
|
4566 |
{ |
|
4567 |
// Reset blocked keys list |
|
4568 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
4569 |
} |
|
4570 |
} |
|
4571 |
||
4572 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
4573 |
&& !CPhoneCenRepProxy::Instance()-> |
|
4574 |
IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) ) |
|
4575 |
{ |
|
4576 |
if( iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
4577 |
{ |
|
4578 |
// Enable Call |
|
4579 |
EnableCallUIL(); |
|
4580 |
} |
|
4581 |
else |
|
4582 |
{ |
|
4583 |
// Set keylock enabled |
|
4584 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
4585 |
// Disable Call |
|
4586 |
DisableCallUIL(); |
|
4587 |
} |
|
4588 |
} |
|
4589 |
||
4590 |
// Stop ringingtone |
|
4591 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
4592 |
} |
|
4593 |
||
4594 |
// ----------------------------------------------------------- |
|
4595 |
// CPhoneState::RetainPreviousKeylockStateL |
|
4596 |
// ----------------------------------------------------------- |
|
4597 |
// |
|
4598 |
EXPORT_C void CPhoneState::RetainPreviousKeylockStateL() |
|
4599 |
{ |
|
4600 |
// Lock keypad, if keylock was enabled before incoming call. |
|
4601 |
// Also reset PhoneStorage keylock status. |
|
4602 |
if ( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) && |
|
4603 |
iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
4604 |
{ |
|
4605 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
4606 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); |
|
4607 |
} |
|
4608 |
} |
|
4609 |
||
4610 |
// --------------------------------------------------------- |
|
4611 |
// CPhoneState::HandleKeyLockEnabledL |
|
4612 |
// --------------------------------------------------------- |
|
4613 |
// |
|
4614 |
EXPORT_C void CPhoneState::HandleKeyLockEnabled( TBool aKeylockEnabled ) |
|
4615 |
{ |
|
4616 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyLockEnabledL( ) "); |
|
4617 |
if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
4618 |
&& CPhoneCenRepProxy::Instance()-> |
|
4619 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) ) |
|
4620 |
{ |
|
4621 |
if( !aKeylockEnabled ) |
|
4622 |
{ |
|
4623 |
// Keylock disabled |
|
4624 |
// Reset blocked keys list |
|
4625 |
iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
4626 |
} |
|
4627 |
} |
|
4628 |
} |
|
4629 |
||
4630 |
// --------------------------------------------------------- |
|
4631 |
// CPhoneState::SetToolbarDimming |
|
4632 |
// --------------------------------------------------------- |
|
4633 |
// |
|
4634 |
EXPORT_C void CPhoneState::SetToolbarDimming( TBool aDimmed ) |
|
4635 |
{ |
|
4636 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
4637 |
{ |
|
4638 |
TPhoneCmdParamBoolean booleanParam; |
|
4639 |
booleanParam.SetBoolean( aDimmed ); |
|
4640 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
4641 |
EPhoneViewSetToolbarDimming, &booleanParam )); |
|
4642 |
} |
|
4643 |
} |
|
4644 |
||
4645 |
// --------------------------------------------------------- |
|
4646 |
// CPhoneState::SetToolbarButtonLoudspeakerEnabled |
|
4647 |
// --------------------------------------------------------- |
|
4648 |
// |
|
4649 |
EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled() |
|
4650 |
{ |
|
4651 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
4652 |
{ |
|
4653 |
TPhoneCmdParamInteger integerParam; |
|
4654 |
integerParam.SetInteger( EPhoneInCallCmdActivateIhf ); |
|
4655 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
4656 |
EPhoneViewEnableToolbarButton, &integerParam )); |
|
4657 |
} |
|
4658 |
} |
|
4659 |
||
4660 |
// --------------------------------------------------------- |
|
4661 |
// CPhoneState::SetToolbarDimming |
|
4662 |
// --------------------------------------------------------- |
|
4663 |
// |
|
4664 |
EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive ) |
|
4665 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
4666 |
if(IsAutoLockOn() && aActive) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
4667 |
// keep back button dimmed device lock case |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
4668 |
return; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
4669 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
4670 |
|
37 | 4671 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
4672 |
{ |
|
4673 |
TPhoneCmdParamBoolean booleanParam; |
|
4674 |
booleanParam.SetBoolean( aActive ); |
|
4675 |
iViewCommandHandle->ExecuteCommand( |
|
4676 |
EPhoneViewBackButtonActive, &booleanParam ); |
|
4677 |
} |
|
4678 |
} |
|
4679 |
||
4680 |
// ----------------------------------------------------------- |
|
4681 |
// CPhoneState::OpenSoftRejectMessageEditorL |
|
4682 |
// ----------------------------------------------------------- |
|
4683 |
// |
|
4684 |
EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
|
4685 |
{ |
|
4686 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
4687 |
"CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
|
4688 |
||
4689 |
// Fetch incoming call's id from view |
|
4690 |
TPhoneCmdParamCallStateData callStateData; |
|
4691 |
callStateData.SetCallState( EPEStateRinging ); |
|
4692 |
iViewCommandHandle->HandleCommandL( |
|
4693 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
4694 |
||
4695 |
TInt ringingCallId( KErrNotFound ); |
|
4696 |
// Do nothing if negative incoming call id |
|
4697 |
if( callStateData.CallId() > KErrNotFound ) |
|
4698 |
{ |
|
4699 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
4700 |
||
4701 |
ringingCallId = callStateData.CallId(); |
|
4702 |
} |
|
4703 |
||
4704 |
||
4705 |
TPhoneCmdParamSfiData sfiDataParam; |
|
4706 |
||
4707 |
if (KErrNotFound != ringingCallId) |
|
4708 |
{ |
|
4709 |
if ( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ).Length() ) |
|
4710 |
{ |
|
4711 |
// store both the name and the number |
|
4712 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
4713 |
sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) ); |
|
4714 |
} |
|
4715 |
else |
|
4716 |
{ |
|
4717 |
// store the number |
|
4718 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
4719 |
} |
|
4720 |
} |
|
4721 |
||
4722 |
iViewCommandHandle->ExecuteCommandL( |
|
4723 |
EPhoneViewOpenSoftRejectEditor, &sfiDataParam ); |
|
4724 |
} |
|
4725 |
||
4726 |
// End of File |
|
4727 |