author | hgs |
Mon, 04 Oct 2010 16:06:10 +0300 | |
changeset 76 | cfea66083b62 |
parent 74 | d1c62c765e48 |
child 78 | baacf668fe89 |
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 <telephonyvariant.hrh> |
|
33 |
#include <aknsoundsystem.h> |
|
34 |
#include <wlaninternalpskeys.h> |
|
35 |
#include <btengdomainpskeys.h> |
|
36 |
#include <btengdomaincrkeys.h> |
|
37 |
#include <settingsinternalcrkeys.h> |
|
38 |
#include <starterclient.h> |
|
39 |
#include <rsssettings.h> |
|
40 |
#include <telephonydomainpstypes.h> |
|
41 |
#include <telinformationpskeys.h> |
|
42 |
#include <coreapplicationuisdomainpskeys.h> |
|
43 |
#include <mccecall.h> |
|
44 |
#include <ccpdefs.h> |
|
45 |
#include <LogsDomainCRKeys.h> |
|
46 |
#include <spsettings.h> |
|
47 |
#include <startupdomainpskeys.h> |
|
48 |
#include <MediatorDomainUIDs.h> |
|
49 |
#include <videotelcontrolmediatorapi.h> |
|
50 |
#include <textresolver.h> |
|
51 |
#include <phoneappvoipcommands.hrh> |
|
52 |
#include <hwrmdomainpskeys.h> |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
53 |
#include <hal.h> |
37 | 54 |
|
55 |
#include "phoneui.pan" |
|
56 |
#include "cphonestate.h" |
|
57 |
#include "mphonestatemachine.h" |
|
58 |
#include "mphoneviewcommandhandle.h" |
|
59 |
#include "tphonecmdparamboolean.h" |
|
60 |
#include "tphonecmdparaminteger.h" |
|
61 |
#include "tphonecmdparamkeyevent.h" |
|
62 |
#include "tphonecmdparamdynmenu.h" |
|
63 |
#include "tphonecmdparamcallheaderdata.h" |
|
64 |
#include "tphonecmdparamincallindicatordata.h" |
|
65 |
#include "tphonecmdparamnote.h" |
|
66 |
#include "tphonecmdparamkeycapture.h" |
|
67 |
#include "tphonecmdparamglobalnote.h" |
|
68 |
#include "tphonecmdparamquery.h" |
|
69 |
#include "tphonecmdparamstring.h" |
|
70 |
#include "tphonecmdparamcallstatedata.h" |
|
71 |
#include "tphonecmdparambitmap.h" |
|
72 |
#include "tphonecmdparamappinfo.h" |
|
73 |
#include "tphonecmdparamtranseffect.h" |
|
74 |
#include "tphonecmdparamringtone.h" |
|
75 |
#include "tphonecmdparamcustomdialer.h" |
|
76 |
#include "cphonekeys.h" |
|
77 |
#include "phoneui.hrh" |
|
78 |
#include "phonerssbase.h" |
|
79 |
#include "cphonebtaadisconnecthandler.h" |
|
80 |
#include "cphonemainresourceresolver.h" |
|
81 |
#include "cphonecenrepproxy.h" |
|
82 |
#include "cphonepubsubproxy.h" |
|
83 |
#include "phoneviewcommanddefinitions.h" |
|
84 |
#include "phonelogger.h" |
|
85 |
#include "phonestatedefinitions.h" |
|
86 |
#include "cphonetimer.h" |
|
87 |
#include "mphoneerrormessageshandler.h" |
|
88 |
#include "cphoneclearblacklist.h" |
|
89 |
#include "mphonecustomization.h" |
|
90 |
#include "cphonemainerrormessageshandler.h" |
|
91 |
#include "cphoneaccessorybthandler.h" |
|
92 |
#include "cphonemediatorfactory.h" |
|
93 |
#include "mphonemediatormessage.h" |
|
94 |
#include "cphonemediatorsender.h" |
|
95 |
#include "cphonereleasecommand.h" |
|
96 |
#include "cphonecontinueemergencycallcommand.h" |
|
97 |
#include "tphonecmdparamsfidata.h" |
|
98 |
#include "mphonestorage.h" |
|
99 |
#include "phoneconstants.h" |
|
100 |
#include "cphoneclearblacklist.h" |
|
76 | 101 |
#include "phonenoteutil.h" |
102 |
#include "phoneaudioutil.h" |
|
37 | 103 |
|
104 |
// ================= MEMBER FUNCTIONS ======================= |
|
105 |
||
106 |
EXPORT_C CPhoneState::CPhoneState( |
|
107 |
MPhoneStateMachine* aStateMachine, |
|
108 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
109 |
MPhoneCustomization* aCustomization) : |
|
110 |
iStateMachine( aStateMachine ), |
|
111 |
iViewCommandHandle( aViewCommandHandle ), |
|
74 | 112 |
iCustomization( aCustomization ) |
37 | 113 |
{ |
114 |
// Need to get current SimState for inherited classis |
|
115 |
iPreviousSimState = SimState(); |
|
116 |
__ASSERT_ALWAYS( |
|
117 |
aStateMachine && aViewCommandHandle, |
|
118 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
119 |
} |
|
120 |
||
121 |
EXPORT_C void CPhoneState::BaseConstructL() |
|
122 |
{ |
|
123 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::BaseConstructL() "); |
|
74 | 124 |
if ( !iUiCommandManager ) |
37 | 125 |
{ |
74 | 126 |
iUiCommandManager = CPhoneUiCommandManager::NewL( |
37 | 127 |
this, |
128 |
*iViewCommandHandle, |
|
129 |
*iStateMachine ); |
|
130 |
} |
|
74 | 131 |
|
132 |
if ( !iNumberEntryManager ) |
|
133 |
{ |
|
134 |
iNumberEntryManager = CPhoneNumberEntryManager::NewL( |
|
135 |
this, |
|
136 |
*iViewCommandHandle, |
|
137 |
*iStateMachine, |
|
138 |
iCustomization, |
|
139 |
*iUiCommandManager ); |
|
140 |
} |
|
141 |
||
37 | 142 |
} |
143 |
||
144 |
EXPORT_C CPhoneState::~CPhoneState() |
|
145 |
{ |
|
146 |
delete iNumberEntryManager; |
|
74 | 147 |
delete iUiCommandManager; |
148 |
} |
|
149 |
||
150 |
// ----------------------------------------------------------- |
|
151 |
// CPhoneState::EikonEnv |
|
152 |
// ----------------------------------------------------------- |
|
153 |
// |
|
154 |
EXPORT_C CEikonEnv* CPhoneState::EikonEnv() const |
|
155 |
{ |
|
156 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EikonEnv( ) "); |
|
157 |
return iEnv; |
|
158 |
} |
|
159 |
||
160 |
// ----------------------------------------------------------- |
|
161 |
// CPhoneState::SetEikonEnv |
|
162 |
// ----------------------------------------------------------- |
|
163 |
// |
|
164 |
EXPORT_C void CPhoneState::SetEikonEnv( CEikonEnv* aEnv ) |
|
165 |
{ |
|
166 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetEikonEnv( ) "); |
|
167 |
iEnv = aEnv; |
|
37 | 168 |
} |
169 |
||
170 |
// <-------------------------- PHONE ENGINE EVENTS ---------------------------> |
|
171 |
// ----------------------------------------------------------- |
|
172 |
// CPhoneState::HandlePhoneEngineMessageL |
|
173 |
// Default handling for Phone Engine messages |
|
174 |
// (other items were commented in a header). |
|
175 |
// ----------------------------------------------------------- |
|
176 |
// |
|
177 |
EXPORT_C void CPhoneState::HandlePhoneEngineMessageL( |
|
178 |
const TInt aMessage, |
|
179 |
TInt aCallId ) |
|
180 |
{ |
|
181 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL() "); |
|
182 |
CPhoneAccessoryBTHandler* accessoryBtHandler; |
|
183 |
switch ( aMessage ) |
|
184 |
{ |
|
185 |
case MEngineMonitor::EPEMessageNetworkRegistrationStatusChange: |
|
186 |
{ |
|
187 |
__PHONELOG1( EBasic, EPhoneControl, |
|
188 |
"PHONEUI_ERROR: EPEMessageNetworkRegistrationStatusChange - RegistrationStatus =%d ", |
|
189 |
iStateMachine->PhoneEngineInfo()->NetworkRegistrationStatus()); |
|
190 |
} |
|
191 |
break; |
|
192 |
||
193 |
case MEngineMonitor::EPEMessageAudioMuteChanged: |
|
194 |
HandleAudioMuteChangedL(); |
|
195 |
break; |
|
196 |
||
197 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
198 |
HandleAudioOutputChangedL(); |
|
74 | 199 |
UpdateUiCommands(); |
37 | 200 |
break; |
201 |
||
202 |
case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged: |
|
203 |
HandleAudioAvailableOutputChangedL(); |
|
204 |
if ( iStateMachine->PhoneEngineInfo()->AudioOutput() != EPENotActive ) |
|
205 |
{ |
|
74 | 206 |
UpdateUiCommands(); |
37 | 207 |
} |
208 |
break; |
|
209 |
||
210 |
case MEngineMonitor::EPEMessageChangedCallDuration: |
|
211 |
HandleChangedCallDurationL( aCallId ); |
|
212 |
break; |
|
213 |
||
214 |
case MEngineMonitor::EPEMessageRemoteBusy: |
|
76 | 215 |
PhoneNoteUtil::HandleRemoteBusyNoteL( aCallId ); |
37 | 216 |
break; |
217 |
||
218 |
case MEngineMonitor::EPEMessageCallWaiting: |
|
219 |
case MEngineMonitor::EPEMessageProfileChanged: |
|
220 |
break; |
|
221 |
||
222 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
223 |
/* Flow through */ |
|
224 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
225 |
HandleDisconnectingL( aCallId ); |
|
226 |
break; |
|
227 |
||
228 |
case MEngineMonitor::EPEMessageTransferDone: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
229 |
SendGlobalInfoNoteL( EPhoneInCallTransferred, ETrue ); |
37 | 230 |
break; |
231 |
||
232 |
case MEngineMonitor::EPEMessageInitiatedEmergencyCall: |
|
233 |
HandleInitiatedEmergencyCallL( aCallId ); |
|
234 |
break; |
|
235 |
||
236 |
case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo: |
|
237 |
HandleInitiatedEmergencyWhileActiveVideoL(); |
|
238 |
break; |
|
239 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
240 |
case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
241 |
HandleCallSecureStatusChangeL( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
242 |
if ( iCustomization ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
243 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
244 |
iCustomization->HandlePhoneEngineMessageL( aMessage, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
245 |
aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
246 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
247 |
break; |
37 | 248 |
|
249 |
case MEngineMonitor::EPEMessageIssuingUSSDRequest: |
|
250 |
{ |
|
251 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
252 |
globalNotifierParam.SetBoolean( EFalse ); |
|
253 |
iViewCommandHandle->ExecuteCommandL( |
|
254 |
EPhoneViewSetGlobalNotifiersDisabled, |
|
255 |
&globalNotifierParam ); |
|
74 | 256 |
iNumberEntryManager->NumberEntryClearL(); |
37 | 257 |
} |
258 |
break; |
|
259 |
||
260 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
74 | 261 |
UpdateUiCommands(); |
37 | 262 |
break; |
263 |
||
264 |
// *#9990# |
|
265 |
case MEngineMonitor::EPEMessageShowBTLoopback: |
|
266 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
267 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
76 | 268 |
iViewCommandHandle, iStateMachine ); |
37 | 269 |
accessoryBtHandler->ShowBTLoopbackL(); |
270 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
271 |
break; |
|
272 |
||
273 |
// *#2820# |
|
274 |
case MEngineMonitor::EPEMessageShowBTDeviceAddress: |
|
275 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
276 |
accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC( |
|
76 | 277 |
iViewCommandHandle, iStateMachine ); |
37 | 278 |
accessoryBtHandler->ShowBTAddressL(); |
279 |
CleanupStack::PopAndDestroy( accessoryBtHandler ); |
|
280 |
break; |
|
281 |
||
282 |
// *#7370# |
|
283 |
case MEngineMonitor::EPEMessageActivateRfsDeep: |
|
284 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
285 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsDeep ); |
|
286 |
break; |
|
287 |
||
288 |
// *#7780# |
|
289 |
case MEngineMonitor::EPEMessageActivateRfsNormal: |
|
290 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
291 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsNormal ); |
|
292 |
break; |
|
65 | 293 |
|
37 | 294 |
// *#62209526# |
295 |
case MEngineMonitor::EPEMessageShowWlanMacAddress: |
|
296 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
297 |
ShowWlanMacAddressL(); |
|
298 |
break; |
|
299 |
||
300 |
case MEngineMonitor::EPEMessageThumbnailLoadingCompleted: |
|
301 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
76 | 302 |
UpdateCallHeader( aCallId ); |
37 | 303 |
break; |
304 |
||
305 |
case MEngineMonitor::EPEMessageSIMStateChanged: |
|
306 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL - simStateChanged =%d", SimState() ); |
|
307 |
HandleSimStateChangedL(); |
|
308 |
break; |
|
309 |
||
310 |
case MEngineMonitor::EPEMessageShowIncCallGroupIndex: |
|
311 |
HandleCugInUseNoteL(); |
|
312 |
break; |
|
313 |
||
314 |
default: |
|
315 |
TBool handled( EFalse ); |
|
316 |
if ( iCustomization ) |
|
317 |
{ |
|
318 |
handled = iCustomization->HandlePhoneEngineMessageL( |
|
319 |
aMessage, aCallId ); |
|
320 |
} |
|
321 |
if ( EFalse == handled ) |
|
322 |
{ |
|
323 |
MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId ); |
|
324 |
if( mediatorMessage ) |
|
325 |
{ |
|
326 |
CleanupDeletePushL( mediatorMessage ); |
|
327 |
mediatorMessage->ExecuteL(); |
|
328 |
CleanupStack::PopAndDestroy( mediatorMessage ); |
|
329 |
mediatorMessage = NULL; |
|
330 |
} |
|
331 |
} |
|
332 |
break; |
|
333 |
} |
|
334 |
} |
|
335 |
||
336 |
// ----------------------------------------------------------- |
|
337 |
// CPhoneState::HandleAudioMuteChangedL |
|
338 |
// Default handling for EPEMessageAudioMuteChanged message |
|
339 |
// (other items were commented in a header). |
|
340 |
// ----------------------------------------------------------- |
|
341 |
// |
|
342 |
EXPORT_C void CPhoneState::HandleAudioMuteChangedL() |
|
343 |
{ |
|
344 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioMuteChangedL() "); |
|
345 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
346 |
Panic( EPhoneCtrlInvariant ) ); |
|
76 | 347 |
PhoneAudioUtil::HandleAudioMuteChangedL(); |
74 | 348 |
UpdateUiCommands(); |
37 | 349 |
} |
350 |
||
351 |
// ----------------------------------------------------------- |
|
352 |
// CPhoneState::HandleAudioOutputChangedL |
|
353 |
// Default handling for EPEMessageAudioOutputChanged message |
|
354 |
// (other items were commented in a header). |
|
355 |
// ----------------------------------------------------------- |
|
356 |
// |
|
357 |
EXPORT_C void CPhoneState::HandleAudioOutputChangedL() |
|
358 |
{ |
|
359 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioOutputChangedL() "); |
|
65 | 360 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
76 | 361 |
PhoneAudioUtil::HandleAudioOutputChangedL(); |
37 | 362 |
} |
363 |
||
364 |
// ----------------------------------------------------------- |
|
365 |
// CPhoneState::HandleSimStateChangedL |
|
366 |
// Handles changes in the SIM card state. |
|
367 |
// ----------------------------------------------------------- |
|
368 |
// |
|
369 |
void CPhoneState::HandleSimStateChangedL() |
|
370 |
{ |
|
371 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleSimStateChangedL()" ); |
|
372 |
CPhoneMainResourceResolver& resolver = *CPhoneMainResourceResolver::Instance(); |
|
373 |
TPESimState simState = SimState(); |
|
374 |
__PHONELOG2( EBasic, EPhoneControl, "SIM state was changed from %d to %d", iPreviousSimState, simState ); |
|
375 |
switch ( simState ) |
|
376 |
{ |
|
377 |
case EPESimUsable: // Falls through. |
|
378 |
case EPESimReadable: // Falls through. |
|
379 |
case EPESimNotReady: |
|
380 |
{ |
|
381 |
if ( iPreviousSimState == EPESimNotPresent ) |
|
382 |
{ |
|
383 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was inserted, rebooting the phone" ); |
|
384 |
RStarterSession starterSession; |
|
385 |
User::LeaveIfError( starterSession.Connect() ); |
|
386 |
CleanupClosePushL( starterSession ); |
|
65 | 387 |
|
37 | 388 |
HBufC* queryText = StringLoader::LoadLC( resolver.ResolveResourceID( EPhoneRebootRequired ) ); |
389 |
TPhoneCmdParamQuery queryParams; |
|
390 |
queryParams.SetCommandParamId( TPhoneCommandParam::EPhoneParamRebootQuery ); |
|
391 |
queryParams.SetQueryPrompt( *queryText ); |
|
392 |
queryParams.SetDefaultCba( R_AVKON_SOFTKEYS_OK_EMPTY ); |
|
393 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParams ); |
|
394 |
starterSession.Reset( RStarterSession::ESIMStatusChangeReset ); |
|
395 |
CleanupStack::PopAndDestroy( 2, &starterSession ); // queryText |
|
396 |
} |
|
397 |
break; |
|
398 |
} |
|
399 |
case EPESimNotPresent: |
|
400 |
{ |
|
401 |
if ( iPreviousSimState == EPESimUsable || |
|
402 |
iPreviousSimState == EPESimReadable || |
|
403 |
iPreviousSimState == EPESimNotReady ) |
|
404 |
{ |
|
405 |
__PHONELOG( EBasic, EPhoneControl, "SIM card was removed" ); |
|
406 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
53 | 407 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
37 | 408 |
globalNoteParam.SetTextResourceId( |
409 |
CPhoneMainResourceResolver::Instance()-> |
|
410 |
ResolveResourceID( EPhoneSimRemoved ) ); |
|
411 |
iViewCommandHandle->ExecuteCommandL( |
|
412 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
413 |
} |
|
414 |
// Show security note, if SIM not present and KFeatureIdFfSimlessOfflineSupport is disabled. |
|
415 |
else if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) && |
|
416 |
( iPreviousSimState != EPESimNotSupported ) ) |
|
417 |
{ |
|
418 |
StartShowSecurityNoteL(); |
|
419 |
} |
|
420 |
break; |
|
421 |
} |
|
422 |
default: |
|
423 |
break; |
|
424 |
} |
|
425 |
iPreviousSimState = simState; |
|
426 |
} |
|
427 |
||
428 |
// ----------------------------------------------------------------------------- |
|
429 |
// CPhoneState::SendDtmfKeyEventL |
|
430 |
// send dtmf event when, |
|
431 |
// -touch dtmf dialer is NOT visible |
|
432 |
// -query is not active |
|
433 |
// -menubar is not open |
|
434 |
// ----------------------------------------------------------------------------- |
|
435 |
// |
|
436 |
void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent, |
|
437 |
TEventCode aEventCode ) |
|
438 |
{ |
|
74 | 439 |
// Send the key event to the phone engine. |
440 |
SendKeyEventL( aKeyEvent, aEventCode ); |
|
37 | 441 |
} |
442 |
||
443 |
// ----------------------------------------------------------- |
|
444 |
// CPhoneState::HandleErrorL |
|
445 |
// Default handling for HandleError message |
|
446 |
// (other items were commented in a header). |
|
447 |
// ----------------------------------------------------------- |
|
448 |
// |
|
449 |
EXPORT_C void CPhoneState::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
450 |
{ |
|
451 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleErrorL()"); |
|
452 |
__PHONELOG1( EBasic, EPhoneControl, |
|
453 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
454 |
aErrorInfo.iErrorCode ); |
|
455 |
__PHONELOG1( EBasic, EPhoneControl, |
|
456 |
"PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ", |
|
457 |
aErrorInfo.iCallId ); |
|
458 |
// Do the common error handling (display proper notes etc) |
|
76 | 459 |
PhoneNoteUtil::HandleErrorL( aErrorInfo ); |
37 | 460 |
} |
461 |
||
462 |
// ----------------------------------------------------------- |
|
463 |
// CPhoneState::HandleChangedCallDurationL |
|
464 |
// Default handling for EPEMessageChangedCallDuration message |
|
465 |
// (other items were commented in a header). |
|
466 |
// ----------------------------------------------------------- |
|
467 |
void CPhoneState::HandleChangedCallDurationL( TInt aCallId ) |
|
468 |
{ |
|
469 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() "); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
470 |
TInt ret = KErrNone; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
471 |
TInt isDisplayOn; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
472 |
ret = HAL::Get( HALData::EDisplayState, isDisplayOn ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
473 |
// 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
|
474 |
// 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
|
475 |
if ( ret || isDisplayOn ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
476 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
477 |
// Get the call duration |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
478 |
TTimeIntervalSeconds seconds = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
479 |
iStateMachine->PhoneEngineInfo()->CallDuration( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
480 |
TPhoneCmdParamInteger time; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
481 |
time.SetInteger(seconds.Int()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
482 |
iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
483 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
484 |
} |
37 | 485 |
|
486 |
// ----------------------------------------------------------- |
|
487 |
// CPhoneState::HandleDisconnectingL |
|
488 |
// ----------------------------------------------------------- |
|
489 |
// |
|
490 |
EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId ) |
|
491 |
{ |
|
492 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) "); |
|
493 |
||
494 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
76 | 495 |
UpdateCallHeader( aCallId ); |
37 | 496 |
|
497 |
CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); |
|
498 |
} |
|
499 |
||
500 |
// <------------------------------- KEY EVENTS -------------------------------> |
|
501 |
// ----------------------------------------------------------- |
|
502 |
// CPhoneState::HandleKeyMessageL( aMessage, aKeyCode ) |
|
503 |
// ----------------------------------------------------------- |
|
504 |
// |
|
505 |
EXPORT_C void CPhoneState::HandleKeyMessageL( |
|
506 |
TPhoneKeyEventMessages /*aMessage*/, |
|
507 |
TKeyCode /*aKeyCode*/ ) |
|
508 |
{ |
|
509 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyMessageL( ) "); |
|
510 |
} |
|
511 |
||
512 |
// ----------------------------------------------------------- |
|
513 |
// CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ) |
|
514 |
// ----------------------------------------------------------- |
|
515 |
// |
|
516 |
EXPORT_C void CPhoneState::HandleKeyEventL( |
|
517 |
const TKeyEvent& aKeyEvent, |
|
518 |
TEventCode aEventCode ) |
|
519 |
{ |
|
520 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyEventL( ) "); |
|
65 | 521 |
if ( aKeyEvent.iScanCode == EStdKeyUpArrow && |
522 |
aEventCode == EEventKey ) |
|
37 | 523 |
{ |
524 |
// Increace audio volume |
|
525 |
IncreaseAudioVolumeL(); |
|
526 |
} |
|
527 |
else if ( aKeyEvent.iScanCode == EStdKeyDownArrow && |
|
528 |
aEventCode == EEventKey ) |
|
529 |
{ |
|
530 |
// Decreace audio volume |
|
531 |
DecreaseAudioVolumeL(); |
|
532 |
} |
|
533 |
} |
|
534 |
||
535 |
// ----------------------------------------------------------- |
|
536 |
// CPhoneState::OnlySideVolumeKeySupported |
|
537 |
// ----------------------------------------------------------- |
|
538 |
// |
|
539 |
TBool CPhoneState::OnlySideVolumeKeySupported() |
|
540 |
{ |
|
541 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::OnlySideVolumeKeySupported( ) "); |
|
542 |
TBool onlySideVolumeKeySupported(EFalse); |
|
543 |
if ( !CPhoneCenRepProxy::Instance()-> |
|
544 |
IsTelephonyFeatureSupported( KTelephonyLVFlagScrollVolumeKeys ) && |
|
65 | 545 |
FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys ) ) |
37 | 546 |
{ |
547 |
onlySideVolumeKeySupported = ETrue; |
|
548 |
} |
|
549 |
__PHONELOG1( EBasic, EPhoneControl, |
|
550 |
"OnlySideVolumeKeySupported: %d", |
|
551 |
onlySideVolumeKeySupported ); |
|
552 |
return onlySideVolumeKeySupported; |
|
553 |
} |
|
554 |
||
555 |
// ----------------------------------------------------------- |
|
556 |
// CPhoneState::SendKeyEventL |
|
557 |
// ----------------------------------------------------------- |
|
558 |
// |
|
559 |
void CPhoneState::SendKeyEventL( |
|
560 |
const TKeyEvent& aKeyEvent, |
|
561 |
TEventCode aEventCode ) |
|
562 |
{ |
|
563 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyEventL( ) "); |
|
564 |
switch( aEventCode ) |
|
565 |
{ |
|
566 |
case EEventKey: |
|
567 |
// Send the key press to the phone engine, if applicable |
|
568 |
SendKeyPressL( aKeyEvent, aEventCode ); |
|
569 |
break; |
|
570 |
||
571 |
case EEventKeyUp: |
|
572 |
// Send a key up event for the last key code sent to |
|
573 |
// the phone engine |
|
574 |
iStateMachine->SendPhoneEngineMessage( |
|
575 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
576 |
break; |
|
577 |
||
578 |
default: |
|
579 |
break; |
|
580 |
} |
|
581 |
} |
|
582 |
||
583 |
// ----------------------------------------------------------- |
|
584 |
// CPhoneState::SendKeyPressL |
|
585 |
// ----------------------------------------------------------- |
|
586 |
// |
|
587 |
void CPhoneState::SendKeyPressL( |
|
588 |
const TKeyEvent& aKeyEvent, |
|
589 |
TEventCode aEventCode ) |
|
590 |
{ |
|
591 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyPressL( ) "); |
|
592 |
const TBool dtmfToneKeyEntered = |
|
593 |
CPhoneKeys::IsDtmfTone( aKeyEvent, aEventCode ); |
|
594 |
||
595 |
if ( dtmfToneKeyEntered || |
|
596 |
aKeyEvent.iCode == EKeyBackspace ) |
|
597 |
{ |
|
65 | 598 |
// Get the number entry contents and store, if it exists |
74 | 599 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 600 |
{ |
74 | 601 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 602 |
__PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber ); |
603 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
604 |
||
605 |
// Convert key code to western. |
|
606 |
TBuf<1> buffer; // one character |
|
607 |
buffer.Append( aKeyEvent.iCode ); |
|
608 |
__PHONELOG1( EBasic, EPhoneControl, |
|
609 |
"CPhoneState::SendKeyPressL(%S)", |
|
610 |
&buffer ); |
|
74 | 611 |
|
37 | 612 |
// Save the key code |
65 | 613 |
TLex code( buffer ); |
37 | 614 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
615 |
||
616 |
// Plays a DTMF tone if active call |
|
617 |
iStateMachine->SendPhoneEngineMessage( |
|
618 |
MPEPhoneModel::EPEMessagePlayDTMF ); |
|
619 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
620 |
} |
|
621 |
} |
|
622 |
} |
|
623 |
||
624 |
// <------------------------------ SYSTEM EVENTS -----------------------------> |
|
625 |
||
626 |
// ----------------------------------------------------------- |
|
627 |
// CPhoneState::HandlePhoneStartupL |
|
628 |
// ----------------------------------------------------------- |
|
629 |
// |
|
630 |
EXPORT_C void CPhoneState::HandlePhoneStartupL() |
|
631 |
{ |
|
632 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneStartupL( ) "); |
|
633 |
// Empty implementation |
|
634 |
} |
|
635 |
||
636 |
// ----------------------------------------------------------- |
|
637 |
// CPhoneState::HandlePropertyChangedL |
|
638 |
// ----------------------------------------------------------- |
|
639 |
// |
|
640 |
EXPORT_C void CPhoneState::HandlePropertyChangedL( |
|
641 |
const TUid& aCategory, |
|
642 |
const TUint aKey, |
|
643 |
const TInt aValue ) |
|
644 |
{ |
|
645 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePropertyChangedL( ) "); |
|
74 | 646 |
if ( ( aCategory == KPSUidStartup ) && |
647 |
( aKey == KStartupSimSecurityStatus ) && |
|
648 |
( aValue == ESimRejected || aValue == ESimUnaccepted ) ) |
|
37 | 649 |
{ |
74 | 650 |
|
651 |
__PHONELOG3( EBasic, EPhoneControl, |
|
652 |
"CPhoneState::HandlePropertyChangedL -aCategory= %d, aKey= %d, aValue= %d", |
|
653 |
aCategory, aKey, aValue ); |
|
37 | 654 |
// Show security note, SIM is not valid. |
74 | 655 |
StartShowSecurityNoteL(); |
37 | 656 |
} |
657 |
} |
|
658 |
||
659 |
// <---------------------------- MENU AND CBA EVENTS -------------------------> |
|
660 |
EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand ) |
|
661 |
{ |
|
662 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) "); |
|
663 |
TBool commandStatus = ETrue; |
|
664 |
switch( aCommand ) |
|
665 |
{ |
|
666 |
case EPhoneEmergencyCmdExit: |
|
667 |
case EPhoneDialerCallHandling: |
|
668 |
case EPhoneCmdBack: |
|
669 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
670 |
// Do state-specific behaviour if number entry is cleared |
|
671 |
HandleNumberEntryClearedL(); |
|
672 |
break; |
|
673 |
||
674 |
case EPhoneDialerCmdTouchInput: |
|
675 |
case EPhoneNumberAcqCmdSave: |
|
676 |
case EPhoneNumberAcqCmdAddToName: |
|
677 |
break; |
|
678 |
||
679 |
case EPhoneNumberAcqCmdAddToContacts: |
|
680 |
{ |
|
65 | 681 |
TPhoneCmdParamQuery queryDialogParam; |
682 |
queryDialogParam.SetQueryType( EPhoneContactsListQuery ); |
|
683 |
queryDialogParam.SetQueryResourceId( |
|
684 |
CPhoneMainResourceResolver::Instance()-> |
|
685 |
ResolveResourceID( EPhoneAddtoContactsListQuery ) ); |
|
686 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
687 |
&queryDialogParam ); |
|
37 | 688 |
} |
689 |
break; |
|
690 |
||
691 |
case EPhoneCmdWaitNoteOk: |
|
692 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
693 |
break; |
|
694 |
||
695 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
696 |
DisconnectCallL(); |
|
697 |
break; |
|
698 |
||
699 |
case EPhoneCmdYesBtDisconnectQuery: |
|
700 |
case EPhoneCmdNoBtDisconnectQuery: |
|
701 |
CPhoneBtaaDisconnectHandler::InstanceL()->HandleQueryDismissL( aCommand ); |
|
702 |
// Make sure that query is removed |
|
703 |
// if there has been also another ( by Cover UI ). |
|
704 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
705 |
break; |
|
706 |
||
707 |
case EPhoneInCallCmdDeactivateIhf: // fall through |
|
708 |
case EPhoneInCallCmdActivateIhf: |
|
76 | 709 |
SetHandsfreeModeL( aCommand == EPhoneInCallCmdActivateIhf ); |
37 | 710 |
break; |
711 |
||
712 |
case EPhoneInCallCmdHandset: // fall through |
|
713 |
case EPhoneInCallCmdBtHandsfree: |
|
714 |
CPhoneState::SetBTHandsfreeModeL( |
|
715 |
aCommand == EPhoneInCallCmdBtHandsfree ); |
|
716 |
break; |
|
717 |
||
718 |
case EPhoneInCallCmdActivatEPhonebook: |
|
719 |
case EPhoneNumberAcqSecurityDialer: |
|
720 |
case EPhoneDialerCmdContacts: |
|
721 |
case EPhoneNumberAcqCmdToggleNeAlphaMode: |
|
722 |
case EPhoneNumberAcqCmdToggleNeNumericMode: |
|
723 |
break; |
|
74 | 724 |
|
37 | 725 |
case EPhoneInCallCmdSetVolumeLevel: |
726 |
{ |
|
727 |
// This command comes from ui control, no need to update |
|
728 |
// value to control (second parameter set false). |
|
76 | 729 |
PhoneAudioUtil::ChangeAudioVolumeL( |
730 |
PhoneAudioUtil::GetVolumeLevel(), EFalse ); |
|
37 | 731 |
} |
732 |
break; |
|
733 |
||
734 |
case EPhoneCmdVideoCallOutOfMemory: |
|
735 |
ShowVideoCallOutOfMemoryNoteL(); |
|
736 |
DisconnectCallL(); |
|
737 |
break; |
|
738 |
||
739 |
case EPhoneCallComingCmdSoftReject: |
|
740 |
OpenSoftRejectMessageEditorL(); |
|
741 |
break; |
|
742 |
||
743 |
case EPhoneInCallCmdContacts: |
|
744 |
iViewCommandHandle->ExecuteCommand( EPhoneViewOpenContacts ); |
|
745 |
break; |
|
746 |
||
747 |
default: |
|
65 | 748 |
{ |
749 |
commandStatus = EFalse; |
|
750 |
} |
|
37 | 751 |
break; |
752 |
} |
|
65 | 753 |
|
37 | 754 |
if( !commandStatus && iCustomization ) |
755 |
{ |
|
756 |
commandStatus = iCustomization->HandleCommandL( aCommand ); |
|
757 |
} |
|
758 |
return commandStatus; |
|
759 |
} |
|
760 |
||
761 |
// ----------------------------------------------------------------------------- |
|
762 |
// CPhoneState::ProcessCommandL |
|
763 |
// ----------------------------------------------------------------------------- |
|
764 |
// |
|
765 |
EXPORT_C TBool CPhoneState::ProcessCommandL( TInt /*aCommand*/ ) |
|
766 |
{ |
|
767 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL() "); |
|
768 |
// no implementation. |
|
769 |
return EFalse; |
|
770 |
} |
|
771 |
||
772 |
// <-------------------------- REMOTE CONTROL EVENTS -------------------------> |
|
773 |
||
774 |
// ----------------------------------------------------------------------------- |
|
775 |
// CPhoneState::HandleRemConCommandL |
|
776 |
// ----------------------------------------------------------------------------- |
|
777 |
// |
|
778 |
EXPORT_C TBool CPhoneState::HandleRemConCommandL( |
|
779 |
TRemConCoreApiOperationId aOperationId, |
|
780 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
781 |
{ |
|
782 |
TBool handled = EFalse; |
|
783 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::MrccatoCommand() "); |
|
784 |
switch ( aOperationId ) |
|
785 |
{ |
|
786 |
case ERemConCoreApiVolumeUp: |
|
787 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeUp" ); |
|
788 |
IncreaseAudioVolumeL(); |
|
789 |
handled = ETrue; |
|
790 |
break; |
|
791 |
||
792 |
case ERemConCoreApiVolumeDown: |
|
793 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeDown" ); |
|
794 |
DecreaseAudioVolumeL(); |
|
795 |
handled = ETrue; |
|
796 |
break; |
|
797 |
case ERemConCoreApiMute: |
|
798 |
{ |
|
799 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiMute" ); |
|
76 | 800 |
PhoneAudioUtil::ToggleMute(); |
37 | 801 |
handled = ETrue; |
802 |
break; |
|
803 |
} |
|
804 |
||
805 |
default: |
|
806 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand MrccatoCmd.Other(%d)", aOperationId ); |
|
807 |
// Other commands ignored. |
|
808 |
break; |
|
809 |
} |
|
810 |
return handled; |
|
811 |
} |
|
812 |
||
813 |
// ----------------------------------------------------------- |
|
814 |
// CPhoneState::DecreaseAudioVolume() |
|
815 |
// ----------------------------------------------------------- |
|
816 |
// |
|
817 |
EXPORT_C void CPhoneState::DecreaseAudioVolumeL() |
|
818 |
{ |
|
819 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DecreaceAudioVolumeL( ) "); |
|
76 | 820 |
PhoneAudioUtil::DecreaseAudioVolumeL(); |
37 | 821 |
} |
822 |
||
823 |
// ----------------------------------------------------------- |
|
824 |
// CPhoneState::IncreaceAudioVolume() |
|
825 |
// ----------------------------------------------------------- |
|
826 |
// |
|
827 |
EXPORT_C void CPhoneState::IncreaseAudioVolumeL() |
|
828 |
{ |
|
829 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IncreaceAudioVolumeL( ) "); |
|
76 | 830 |
PhoneAudioUtil::IncreaseAudioVolumeL(); |
37 | 831 |
} |
832 |
||
833 |
// <-------------------------- COMMON STATE FUNCTIONS ------------------------> |
|
834 |
// ----------------------------------------------------------- |
|
835 |
// CPhoneState::DialMultimediaCallL |
|
836 |
// ----------------------------------------------------------- |
|
837 |
// |
|
838 |
EXPORT_C void CPhoneState::DialMultimediaCallL() |
|
839 |
{ |
|
840 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() "); |
|
841 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
842 |
Panic( EPhoneCtrlInvariant ) ); |
|
843 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVideo ); |
|
844 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
845 |
} |
|
846 |
||
847 |
// ----------------------------------------------------------- |
|
848 |
// CPhoneState::DialVoiceCallL |
|
849 |
// ----------------------------------------------------------- |
|
850 |
// |
|
851 |
EXPORT_C void CPhoneState::DialVoiceCallL() |
|
852 |
{ |
|
853 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
|
65 | 854 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 855 |
TPhoneCmdParamBoolean globalNotifierParam; |
856 |
globalNotifierParam.SetBoolean( ETrue ); |
|
857 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
858 |
&globalNotifierParam ); |
|
76 | 859 |
iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
37 | 860 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
861 |
} |
|
862 |
||
863 |
// ----------------------------------------------------------- |
|
864 |
// CPhoneState::DisconnectCallL |
|
865 |
// ----------------------------------------------------------- |
|
866 |
// |
|
867 |
EXPORT_C TBool CPhoneState::DisconnectCallL() |
|
868 |
{ |
|
869 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
|
870 |
TPhoneCmdParamInteger callIdParam; |
|
74 | 871 |
iViewCommandHandle->ExecuteCommand( |
37 | 872 |
EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
873 |
TBool ret = EFalse; |
|
874 |
if( callIdParam.Integer() > KErrNotFound ) |
|
875 |
{ |
|
876 |
iStateMachine->SetCallId( callIdParam.Integer() ); |
|
877 |
if( IsVideoCall( callIdParam.Integer() ) ) |
|
878 |
{ |
|
879 |
// Video call can be released only after we get response to VT Shutdown Command |
|
65 | 880 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
881 |
KMediatorVideoTelephonyDomain, |
|
882 |
KCatPhoneToVideotelCommands, |
|
883 |
EVtCmdReleaseDataport, |
|
884 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
885 |
KPhoneToVideotelCmdVersionMinor, |
|
886 |
KPhoneToVideotelCmdVersionBuild ), |
|
887 |
KNullDesC8, |
|
888 |
CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
|
37 | 889 |
} |
890 |
else |
|
891 |
{ |
|
892 |
iStateMachine->SendPhoneEngineMessage( |
|
893 |
MPEPhoneModel::EPEMessageRelease ); |
|
894 |
} |
|
895 |
ret = ETrue; |
|
896 |
} |
|
897 |
else |
|
898 |
{ |
|
899 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
900 |
"CPhoneState::DisconnectCallL has negative call id!" ); |
|
901 |
} |
|
902 |
return ret; |
|
903 |
} |
|
904 |
||
905 |
// ----------------------------------------------------------- |
|
74 | 906 |
// CPhoneState::RemoveDialogsAndSendPhoneToBackgroundL() |
37 | 907 |
// ----------------------------------------------------------- |
908 |
// |
|
74 | 909 |
EXPORT_C void CPhoneState::RemoveDialogsAndSendPhoneToBackgroundL() |
37 | 910 |
{ |
74 | 911 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::RemoveDialogsAndSendPhoneToBackgroundL( ) "); |
65 | 912 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
37 | 913 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
74 | 914 |
UpdateUiCommands(); |
37 | 915 |
} |
916 |
||
917 |
// ----------------------------------------------------------- |
|
918 |
// CPhoneState::UpdateSingleActiveCallL |
|
919 |
// ----------------------------------------------------------- |
|
920 |
// |
|
921 |
EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId ) |
|
922 |
{ |
|
923 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) "); |
|
924 |
BeginUiUpdateLC(); |
|
74 | 925 |
|
76 | 926 |
UpdateCallHeaderAndUiCommandsL( aCallId ); |
37 | 927 |
|
928 |
// Create call duration label if enabled |
|
929 |
// This key will be moved to some other area, but since key |
|
930 |
// is supported we can still use it. |
|
931 |
TBool callDuration( EFalse ); |
|
932 |
CPhoneCenRepProxy::Instance()->GetInt( |
|
933 |
KCRUidLogs, KLogsShowCallDuration, callDuration ); |
|
934 |
||
935 |
if ( callDuration ) |
|
936 |
{ |
|
937 |
HandleChangedCallDurationL( aCallId ); |
|
938 |
} |
|
76 | 939 |
|
37 | 940 |
EndUiUpdate(); |
74 | 941 |
|
37 | 942 |
// If there is no need to send back ground and number entry is used then |
943 |
// we must show number entry. |
|
74 | 944 |
if ( iNumberEntryManager->IsNumberEntryUsedL() && !IsAutoLockOn() ) |
37 | 945 |
{ |
74 | 946 |
iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
37 | 947 |
} |
948 |
} |
|
949 |
||
950 |
// ----------------------------------------------------------- |
|
951 |
// CPhoneState::IsWaitingCallL |
|
952 |
// ----------------------------------------------------------- |
|
953 |
// |
|
954 |
TBool CPhoneState::IsWaitingCallL( const TInt aCallId ) |
|
955 |
{ |
|
956 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsWaitingCallL( ) "); |
|
74 | 957 |
TBool waiting( EFalse ); |
958 |
if ( aCallId >= 0 && |
|
959 |
iStateMachine->PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging ) |
|
960 |
{ |
|
961 |
TPhoneCmdParamInteger activeCallCount; |
|
962 |
iViewCommandHandle->ExecuteCommandL( |
|
963 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
964 |
||
965 |
if( activeCallCount.Integer() > 0 ) |
|
966 |
{ |
|
967 |
waiting = ETrue; |
|
968 |
} |
|
969 |
} |
|
970 |
||
971 |
return waiting; |
|
37 | 972 |
} |
973 |
||
974 |
// ----------------------------------------------------------- |
|
76 | 975 |
// CPhoneState::UpdateCallHeader |
37 | 976 |
// ----------------------------------------------------------- |
977 |
// |
|
76 | 978 |
EXPORT_C void CPhoneState::UpdateCallHeader( TInt aCallId ) |
37 | 979 |
{ |
76 | 980 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::UpdateCallHeader() "); |
37 | 981 |
iViewCommandHandle->ExecuteCommandL( |
76 | 982 |
EPhoneViewUpdateBubble, |
74 | 983 |
aCallId ); |
984 |
||
37 | 985 |
} |
986 |
||
76 | 987 |
// ----------------------------------------------------------- |
988 |
// CPhoneState::UpdateCallHeaderAndUiCommandsL |
|
989 |
// ----------------------------------------------------------- |
|
990 |
// |
|
991 |
EXPORT_C void CPhoneState::UpdateCallHeaderAndUiCommandsL( TInt aCallId ) |
|
992 |
{ |
|
993 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
994 |
"CPhoneState::UpdateCallHeaderAndUiCommandsL() "); |
|
995 |
BeginUiUpdateLC(); |
|
996 |
UpdateCallHeader( aCallId ); |
|
997 |
UpdateUiCommands(); |
|
998 |
EndUiUpdate(); |
|
999 |
} |
|
1000 |
||
37 | 1001 |
// <-------------------------- CONTEXT MENU -------------------------> |
1002 |
||
1003 |
// ----------------------------------------------------------- |
|
1004 |
// CPhoneState::ShowNoteL |
|
1005 |
// ----------------------------------------------------------- |
|
1006 |
// |
|
1007 |
EXPORT_C void CPhoneState::ShowNoteL( TInt aResourceId ) |
|
1008 |
{ |
|
1009 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNoteL( ) "); |
|
1010 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1011 |
PhoneNoteUtil::ShowNoteL( aResourceId ); |
37 | 1012 |
} |
1013 |
||
1014 |
// ----------------------------------------------------------- |
|
1015 |
// CPhoneState::ShowQueryL |
|
1016 |
// ----------------------------------------------------------- |
|
1017 |
// |
|
1018 |
EXPORT_C void CPhoneState::ShowQueryL( TInt aResourceId ) |
|
1019 |
{ |
|
1020 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowQueryL( ) "); |
|
1021 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1022 |
PhoneNoteUtil::ShowQueryL( aResourceId ); |
37 | 1023 |
} |
1024 |
||
1025 |
// ----------------------------------------------------------- |
|
1026 |
// CPhoneState::ShowTextQueryL |
|
1027 |
// ----------------------------------------------------------- |
|
1028 |
// |
|
1029 |
EXPORT_C void CPhoneState::ShowTextQueryL( |
|
1030 |
TInt aDialogResourceId, |
|
1031 |
TInt aDefaultCbaResourceId, |
|
1032 |
TInt aContentCbaResourceId, |
|
1033 |
TDes* aDataText, |
|
1034 |
TBool aSendKeyEnabled ) |
|
1035 |
{ |
|
1036 |
__ASSERT_DEBUG( aDialogResourceId && |
|
1037 |
aDefaultCbaResourceId && |
|
1038 |
aContentCbaResourceId && |
|
1039 |
aDataText, |
|
1040 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1041 |
|
1042 |
PhoneNoteUtil::ShowTextQueryL( |
|
1043 |
aDialogResourceId, |
|
1044 |
aDefaultCbaResourceId, |
|
1045 |
aContentCbaResourceId, |
|
1046 |
aDataText, |
|
1047 |
aSendKeyEnabled ); |
|
1048 |
||
37 | 1049 |
} |
1050 |
||
1051 |
// ----------------------------------------------------------- |
|
1052 |
// CPhoneState::DisplayCallTerminationNoteL |
|
1053 |
// ----------------------------------------------------------- |
|
1054 |
// |
|
1055 |
EXPORT_C void CPhoneState::DisplayCallTerminationNoteL() |
|
1056 |
{ |
|
1057 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayCallTerminationNoteL( ) "); |
|
1058 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1059 |
Panic( EPhoneCtrlInvariant ) ); |
|
1060 |
if ( CheckIfShowCallTerminationNote() ) |
|
1061 |
{ |
|
1062 |
TBuf<KPhoneMaxCharsInNote> noteText; |
|
1063 |
TBuf<KPhoneMaxCharsInNote> postCallLineText; |
|
1064 |
||
1065 |
// Post call Line 1: Call Summary |
|
1066 |
LoadResource( postCallLineText, EPhoneNoteTextCallSummary ); |
|
1067 |
noteText.Append( postCallLineText ); |
|
1068 |
noteText.Append( KPhoneLineFeed ); |
|
1069 |
||
1070 |
// Post call Line 2: Duration |
|
1071 |
LoadResource( postCallLineText, EPhoneNoteTextCallDuration ); |
|
1072 |
noteText.Append( postCallLineText ); |
|
1073 |
noteText.Append( KPhoneLineFeed ); |
|
1074 |
||
1075 |
// Post call Line 3: Time, get the format for last call time. |
|
1076 |
LoadResource( postCallLineText, EPhoneCallDurationFormatString ); |
|
1077 |
TPtrC durationFormat( postCallLineText ); |
|
1078 |
||
1079 |
// Get the last call duration |
|
1080 |
TTime time( 0 ); |
|
1081 |
TTimeIntervalSeconds timeInterval = |
|
1082 |
iStateMachine->PhoneEngineInfo()->CallDuration(); |
|
1083 |
time += timeInterval; |
|
1084 |
||
1085 |
// Format the time |
|
1086 |
TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC ); |
|
1087 |
time.FormatL( timeString, durationFormat ); |
|
1088 |
||
1089 |
noteText.Append( timeString ); |
|
1090 |
||
76 | 1091 |
PhoneNoteUtil::SendGlobalNoteL( |
1092 |
EPhoneMessageBoxInformation, noteText); |
|
37 | 1093 |
} |
1094 |
} |
|
1095 |
||
1096 |
// --------------------------------------------------------- |
|
1097 |
// CPhoneState::SendGlobalInfoNoteL |
|
1098 |
// --------------------------------------------------------- |
|
1099 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1100 |
EXPORT_C void CPhoneState::SendGlobalInfoNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1101 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 1102 |
{ |
1103 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalInfoNoteL( ) "); |
|
1104 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1105 |
PhoneNoteUtil::SendGlobalInfoNoteL( aResourceId, aNotificationDialog ); |
37 | 1106 |
} |
1107 |
||
1108 |
// --------------------------------------------------------- |
|
1109 |
// CPhoneUIController::SendGlobalWarningNoteL |
|
1110 |
// --------------------------------------------------------- |
|
1111 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1112 |
EXPORT_C void CPhoneState::SendGlobalWarningNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1113 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 1114 |
{ |
1115 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) "); |
|
1116 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1117 |
PhoneNoteUtil::SendGlobalWarningNoteL( aResourceId, aNotificationDialog ); |
37 | 1118 |
} |
1119 |
||
1120 |
// --------------------------------------------------------- |
|
1121 |
// CPhoneUIController::SendGlobalErrorNoteL |
|
1122 |
// --------------------------------------------------------- |
|
1123 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1124 |
EXPORT_C void CPhoneState::SendGlobalErrorNoteL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1125 |
TInt aResourceId, TBool aNotificationDialog ) |
37 | 1126 |
{ |
1127 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) "); |
|
1128 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
76 | 1129 |
PhoneNoteUtil::SendGlobalErrorNoteL( aResourceId, aNotificationDialog ); |
37 | 1130 |
} |
1131 |
||
1132 |
// --------------------------------------------------------- |
|
1133 |
// CPhoneState::SetHandsfreeModeL |
|
1134 |
// --------------------------------------------------------- |
|
1135 |
// |
|
1136 |
EXPORT_C void CPhoneState::SetHandsfreeModeL( TBool aHandsfreeMode ) |
|
1137 |
{ |
|
1138 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetHandsfreeModeL( ) "); |
|
76 | 1139 |
PhoneAudioUtil::SetHandsfreeModeL( aHandsfreeMode ); |
37 | 1140 |
} |
1141 |
||
1142 |
// --------------------------------------------------------- |
|
1143 |
// CPhoneState::SetBTHandsfreeModeL |
|
1144 |
// --------------------------------------------------------- |
|
1145 |
// |
|
1146 |
EXPORT_C void CPhoneState::SetBTHandsfreeModeL( TBool aHandsfreeMode ) |
|
1147 |
{ |
|
1148 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) "); |
|
76 | 1149 |
PhoneAudioUtil::SetBtHandsfreeModeL( aHandsfreeMode ); |
37 | 1150 |
} |
1151 |
||
1152 |
// <-------------------------- INTERNAL FUNCTIONS ------------------------> |
|
1153 |
// ----------------------------------------------------------- |
|
1154 |
// CPhoneState::HandleInitiatedEmergencyCallL |
|
1155 |
// Default handling for EPEMessageInitiatedEmergencyCallL message |
|
1156 |
// (other items were commented in a header). |
|
1157 |
// ----------------------------------------------------------- |
|
1158 |
// |
|
1159 |
void CPhoneState::HandleInitiatedEmergencyCallL( TInt /*aCallId*/ ) |
|
1160 |
{ |
|
1161 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyCallL( ) "); |
|
1162 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1163 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
65 | 1164 |
|
37 | 1165 |
iStateMachine->ChangeState( EPhoneStateEmergency ); |
1166 |
} |
|
1167 |
||
1168 |
// ----------------------------------------------------------- |
|
1169 |
// CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL |
|
1170 |
// ----------------------------------------------------------- |
|
1171 |
// |
|
1172 |
void CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL() |
|
1173 |
{ |
|
1174 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) "); |
|
65 | 1175 |
// We have existing video call so need to release dataport before continuings |
37 | 1176 |
// emergency call. Otherwise we will face problems with dataport use later. |
65 | 1177 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
1178 |
KMediatorVideoTelephonyDomain, |
|
1179 |
KCatPhoneToVideotelCommands, |
|
1180 |
EVtCmdReleaseDataport, |
|
1181 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
1182 |
KPhoneToVideotelCmdVersionMinor, |
|
1183 |
KPhoneToVideotelCmdVersionBuild ), |
|
1184 |
KNullDesC8, |
|
1185 |
CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) ); |
|
37 | 1186 |
} |
1187 |
||
1188 |
// ----------------------------------------------------------- |
|
1189 |
// CPhoneState::HandleCallSecureStatusChangeL |
|
1190 |
// ----------------------------------------------------------- |
|
1191 |
// |
|
1192 |
void CPhoneState::HandleCallSecureStatusChangeL( TInt aCallId ) |
|
1193 |
{ |
|
1194 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCallSecureStatusChangeL( ) "); |
|
1195 |
iViewCommandHandle->ExecuteCommandL( |
|
1196 |
EPhoneViewCipheringInfoChange, |
|
74 | 1197 |
aCallId); |
37 | 1198 |
} |
1199 |
||
1200 |
// --------------------------------------------------------- |
|
1201 |
// CPhoneState::IsVideoCall |
|
1202 |
// --------------------------------------------------------- |
|
1203 |
// |
|
1204 |
EXPORT_C TBool CPhoneState::IsVideoCall( const TInt aCallId ) |
|
1205 |
{ |
|
1206 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsVideoCall( ) "); |
|
74 | 1207 |
if ( aCallId < 0 ) |
37 | 1208 |
{ |
74 | 1209 |
return EFalse; |
37 | 1210 |
} |
1211 |
||
74 | 1212 |
return EPECallTypeVideo == iStateMachine->PhoneEngineInfo()->CallType( aCallId ); |
37 | 1213 |
} |
1214 |
||
1215 |
// --------------------------------------------------------- |
|
1216 |
// CPhoneState::SimState() |
|
1217 |
// --------------------------------------------------------- |
|
1218 |
// |
|
1219 |
EXPORT_C TPESimState CPhoneState::SimState() const |
|
1220 |
{ |
|
1221 |
/* |
|
1222 |
SIM states: |
|
1223 |
EPESimStatusUninitialized = KPEStartupEnumerationFirstValue =100, |
|
1224 |
EPESimUsable, // The Sim card is fully usable. |
|
1225 |
EPESimReadable, // The SIM card is not fully usable, but the emergency number can be read. |
|
1226 |
EPESimNotReady, // The Sim card is present but not ready or usable. |
|
1227 |
EPESimNotPresent, // The Sim card is not present. |
|
1228 |
EPESimNotSupported // SIM/RUIM is not supported. Some CDMA phones do not support a SIM/RUIM at all. |
|
1229 |
*/ |
|
1230 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimState()"); |
|
1231 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
1232 |
Panic( EPhoneCtrlInvariant ) ); |
|
1233 |
TPESimState simState = iStateMachine->PhoneEngineInfo()->SimState(); |
|
1234 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1235 |
"CPhoneState::SimState - value= %d", simState ); |
|
1236 |
return simState; |
|
1237 |
} |
|
1238 |
||
1239 |
// --------------------------------------------------------- |
|
1240 |
// CPhoneState::IsSimOk() |
|
1241 |
// --------------------------------------------------------- |
|
1242 |
// |
|
1243 |
EXPORT_C TBool CPhoneState::IsSimOk() |
|
1244 |
{ |
|
1245 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsSimOk()"); |
|
1246 |
// Phone is interested on Sim state and sim security statuses |
|
1247 |
// Check first Sim state status: |
|
1248 |
TBool retVal( ETrue ); |
|
1249 |
switch ( SimState() ) |
|
1250 |
{ |
|
1251 |
case EPESimNotSupported: |
|
1252 |
retVal = EFalse; |
|
1253 |
break; |
|
1254 |
||
1255 |
case EPESimNotPresent: |
|
1256 |
{ |
|
1257 |
if ( !FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) || |
|
1258 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) |
|
1259 |
{ |
|
1260 |
retVal = EFalse; |
|
1261 |
} |
|
1262 |
break; |
|
1263 |
} |
|
1264 |
||
1265 |
default: |
|
1266 |
break; |
|
1267 |
} |
|
1268 |
if ( retVal != EFalse ) |
|
1269 |
{ |
|
1270 |
// Sim state is valid, check also Sim security status |
|
1271 |
switch ( SimSecurityStatus() ) |
|
1272 |
{ |
|
1273 |
case ESimRejected: |
|
1274 |
case ESimUnaccepted: |
|
1275 |
retVal = EFalse; |
|
1276 |
break; |
|
1277 |
||
1278 |
default: |
|
1279 |
break; |
|
1280 |
} |
|
1281 |
} |
|
1282 |
__PHONELOG1( EBasic, EPhoneControl, |
|
1283 |
"CPhoneState::IsSimOK - value= %d", retVal ); |
|
1284 |
return retVal; |
|
1285 |
} |
|
1286 |
||
1287 |
// ----------------------------------------------------------- |
|
1288 |
// CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled |
|
1289 |
// ----------------------------------------------------------- |
|
1290 |
// |
|
1291 |
EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled() |
|
1292 |
{ |
|
1293 |
TPhoneCmdParamBoolean isSecurityMode; |
|
65 | 1294 |
TBool retValue(EFalse); |
37 | 1295 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ) ); |
1296 |
if ( SimState() == EPESimNotPresent && isSecurityMode.Boolean() ) |
|
1297 |
{ |
|
65 | 1298 |
retValue = ETrue; |
37 | 1299 |
} |
65 | 1300 |
return retValue; |
37 | 1301 |
} |
1302 |
||
1303 |
// ----------------------------------------------------------------------------- |
|
1304 |
// CPhoneState::StartShowSecurityNoteL |
|
1305 |
// ----------------------------------------------------------------------------- |
|
1306 |
// |
|
1307 |
EXPORT_C void CPhoneState::StartShowSecurityNoteL() |
|
1308 |
{ |
|
1309 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL "); |
|
1310 |
TPhoneCmdParamBoolean securityMode; |
|
1311 |
securityMode.SetBoolean( ETrue ); |
|
1312 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode ); |
|
1313 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
74 | 1314 |
UpdateUiCommands(); |
37 | 1315 |
|
74 | 1316 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
37 | 1317 |
TInt resourceId ( KErrNone ); |
1318 |
if ( SimSecurityStatus() == ESimRejected ) |
|
1319 |
{ |
|
1320 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
1321 |
ResolveResourceID( EPhoneSimRejected ); |
|
1322 |
} |
|
1323 |
else if ( SimState() == EPESimNotPresent ) |
|
1324 |
{ |
|
1325 |
// insert sim card -note |
|
1326 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
1327 |
ResolveResourceID( EPhoneSimRemoved ); |
|
1328 |
} |
|
1329 |
else if ( SimSecurityStatus() == ESimUnaccepted ) |
|
1330 |
{ |
|
1331 |
resourceId = CPhoneMainResourceResolver::Instance()-> |
|
1332 |
ResolveResourceID( EPhoneSimUnaccepted ); |
|
1333 |
} |
|
1334 |
||
1335 |
if ( resourceId != KErrNone ) |
|
1336 |
{ |
|
1337 |
// Add it to the resource string |
|
1338 |
HBufC* buf = StringLoader::LoadLC( resourceId ); |
|
1339 |
TPhoneCmdParamNote noteParam; |
|
1340 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
1341 |
ResolveResourceID( EPhoneSecurityInformationNote ) ); |
|
1342 |
noteParam.SetText( *buf ); |
|
1343 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
1344 |
noteParam.SetType( EPhoneNoteSecurity ); |
|
1345 |
// Display note |
|
1346 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
1347 |
CleanupStack::PopAndDestroy( buf ); |
|
1348 |
// Capture the App key |
|
1349 |
TPhoneCmdParamKeyCapture appKeyCaptureParam; |
|
1350 |
appKeyCaptureParam.SetKey( EStdKeyApplication0 ); |
|
1351 |
appKeyCaptureParam.SetKeyCode( EKeyApplication0 ); |
|
1352 |
appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents ); |
|
1353 |
iViewCommandHandle->ExecuteCommandL( |
|
1354 |
EPhoneViewStartCapturingKey, &appKeyCaptureParam ); |
|
1355 |
} |
|
1356 |
} |
|
1357 |
||
1358 |
// --------------------------------------------------------- |
|
1359 |
// CPhoneState::ShowWlanMacAddressL |
|
1360 |
// --------------------------------------------------------- |
|
1361 |
// |
|
1362 |
void CPhoneState::ShowWlanMacAddressL() |
|
1363 |
{ |
|
1364 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ShowWlanMacAddressL()"); |
|
74 | 1365 |
iNumberEntryManager->NumberEntryClearL(); |
37 | 1366 |
// Fetch WLAN MAC address |
1367 |
TBuf8<KPhoneWlanMacAddressLength> address; |
|
1368 |
RProperty::Get( |
|
1369 |
KPSUidWlan, |
|
1370 |
KPSWlanMacAddress, |
|
1371 |
address ); |
|
1372 |
// Format fetched address |
|
1373 |
TBuf<KPhoneWlanMacAddressLength> wlanMACAddress; |
|
1374 |
for ( TInt i( 0 ); i < address.Length(); i++ ) |
|
1375 |
{ |
|
1376 |
// Set separator |
|
1377 |
if( i > 0 ) |
|
1378 |
{ |
|
1379 |
wlanMACAddress.Append( KPhoneWlanSeparator ); |
|
1380 |
} |
|
1381 |
// Set data |
|
1382 |
TBuf<10> tmp; |
|
1383 |
tmp.Format( KWLanMACDataFormat, address[i] ); |
|
1384 |
wlanMACAddress.Append( tmp ); |
|
1385 |
} |
|
1386 |
||
1387 |
// Now we need the localised text |
|
1388 |
HBufC* wlanMacAddress = StringLoader::LoadLC( |
|
1389 |
CPhoneMainResourceResolver::Instance()-> |
|
1390 |
ResolveResourceID( EPhoneWlanMacAddress ), wlanMACAddress ); |
|
1391 |
TPhoneCmdParamNote noteParam; |
|
1392 |
noteParam.SetType( EPhoneNoteCustom ); |
|
1393 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
1394 |
ResolveResourceID( EPhoneInformationWaitNote ) ); |
|
1395 |
noteParam.SetText( *wlanMacAddress ); |
|
1396 |
noteParam.SetTone( CAknNoteDialog::EConfirmationTone ); |
|
1397 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
1398 |
CleanupStack::PopAndDestroy( wlanMacAddress ); |
|
1399 |
} |
|
1400 |
||
1401 |
// ----------------------------------------------------------- |
|
1402 |
// CPhoneState::HandleAudioAvailableOutputChangedL |
|
1403 |
// Default handling for EPEMessageAvailableAudioOutputsChanged message |
|
1404 |
// (other items were commented in a header). |
|
1405 |
// ----------------------------------------------------------- |
|
1406 |
// |
|
1407 |
void CPhoneState::HandleAudioAvailableOutputChangedL() |
|
1408 |
{ |
|
1409 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioAvailableOutputChangedL() "); |
|
65 | 1410 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
76 | 1411 |
PhoneAudioUtil::HandleAudioAvailableOutputChangedL(); |
37 | 1412 |
} |
1413 |
||
1414 |
// --------------------------------------------------------- |
|
1415 |
// CPhoneState::ShowNumberBusyNoteL |
|
1416 |
// --------------------------------------------------------- |
|
1417 |
// |
|
1418 |
EXPORT_C void CPhoneState::ShowNumberBusyNoteL() |
|
1419 |
{ |
|
1420 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNumberBusyNoteL( ) "); |
|
1421 |
||
1422 |
TInt resource( EPhoneNumberBusy ); |
|
1423 |
if( iCustomization ) |
|
1424 |
{ |
|
1425 |
// Get customized text resource for busy note |
|
1426 |
resource = iCustomization->CustomizeBusyNoteText(); |
|
1427 |
} |
|
53 | 1428 |
|
76 | 1429 |
PhoneNoteUtil::SendGlobalNoteL( resource, ETrue ); |
37 | 1430 |
} |
1431 |
||
1432 |
// --------------------------------------------------------- |
|
1433 |
// CPhoneState::IsAutoLockOn |
|
1434 |
// --------------------------------------------------------- |
|
1435 |
// |
|
1436 |
EXPORT_C TBool CPhoneState::IsAutoLockOn() const |
|
1437 |
{ |
|
1438 |
const TBool phoneIsLocked = |
|
1439 |
CPhonePubSubProxy::Instance()->Value( |
|
1440 |
KPSUidCoreApplicationUIs, |
|
1441 |
KCoreAppUIsAutolockStatus ) > EAutolockOff; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1442 |
__PHONELOG1( EBasic, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1443 |
EPhoneControl, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1444 |
"CPhoneState::IsAutoLockOn() Status: %d", |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1445 |
phoneIsLocked ); |
37 | 1446 |
return phoneIsLocked; |
1447 |
} |
|
1448 |
||
1449 |
// --------------------------------------------------------- |
|
1450 |
// CPhoneState::DeleteTouchPaneButtons |
|
1451 |
// --------------------------------------------------------- |
|
1452 |
// |
|
1453 |
EXPORT_C void CPhoneState::DeleteTouchPaneButtons() |
|
1454 |
{ |
|
74 | 1455 |
/*TPhoneCmdParamBoolean boolParam; |
1456 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommand( |
|
65 | 1457 |
EPhoneViewSetTouchPaneButtons, |
74 | 1458 |
&boolParam ) );*/ |
37 | 1459 |
} |
1460 |
||
1461 |
// ----------------------------------------------------------- |
|
1462 |
// CPhoneState::BeginUiUpdateLC |
|
1463 |
// ----------------------------------------------------------- |
|
1464 |
// |
|
1465 |
EXPORT_C void CPhoneState::BeginUiUpdateLC() |
|
1466 |
{ |
|
1467 |
iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
|
1468 |
TCleanupItem operation( UiUpdateCleanup, this ); |
|
1469 |
CleanupStack::PushL( operation ); |
|
1470 |
} |
|
1471 |
||
1472 |
// ----------------------------------------------------------- |
|
1473 |
// CPhoneState::EndUiUpdate |
|
1474 |
// ----------------------------------------------------------- |
|
1475 |
// |
|
1476 |
EXPORT_C void CPhoneState::EndUiUpdate() |
|
1477 |
{ |
|
1478 |
CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
|
1479 |
} |
|
1480 |
||
1481 |
// ----------------------------------------------------------- |
|
1482 |
// CPhoneState::CheckIfShowTerminationNote |
|
1483 |
// This method is intended to be overridden in states |
|
1484 |
// that contain more info about decision. |
|
1485 |
// ----------------------------------------------------------- |
|
1486 |
// |
|
1487 |
EXPORT_C TBool CPhoneState::CheckIfShowCallTerminationNote( ) |
|
1488 |
{ |
|
1489 |
TBool show = EFalse; |
|
1490 |
TInt callSummaryActivated = 0; |
|
1491 |
const TInt err = CPhoneCenRepProxy::Instance()->GetInt( |
|
1492 |
KCRUidCommonTelephonySettings, |
|
1493 |
KSettingsSummaryAfterCall, |
|
1494 |
callSummaryActivated ); |
|
1495 |
if ( err == KErrNone && callSummaryActivated ) |
|
1496 |
{ |
|
1497 |
show = ETrue; |
|
1498 |
} |
|
1499 |
return show; |
|
1500 |
} |
|
1501 |
||
1502 |
// ----------------------------------------------------------------------------- |
|
1503 |
// CPhoneState::HandleDtmfKeyTone |
|
1504 |
// Called from KeyEventForwarder |
|
1505 |
// Allow only special characters to pass from |
|
1506 |
// keyEventForwarder to phoneEngine |
|
1507 |
// ----------------------------------------------------------------------------- |
|
1508 |
// |
|
1509 |
EXPORT_C void CPhoneState::HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent, |
|
1510 |
TEventCode aEventCode ) |
|
1511 |
{ |
|
1512 |
SendDtmfKeyEventL( aKeyEvent, aEventCode ); |
|
1513 |
} |
|
1514 |
||
1515 |
// ----------------------------------------------------------------------------- |
|
1516 |
// CPhoneState::UiUpdateCleanup |
|
1517 |
// ----------------------------------------------------------------------------- |
|
1518 |
// |
|
1519 |
void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
|
1520 |
{ |
|
1521 |
static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
1522 |
EPhoneViewEndUpdate ); |
|
1523 |
} |
|
1524 |
||
1525 |
// ----------------------------------------------------------- |
|
1526 |
// CPhoneState::SetDefaultFlagsL() |
|
1527 |
// ----------------------------------------------------------- |
|
1528 |
// |
|
1529 |
EXPORT_C void CPhoneState::SetDefaultFlagsL() |
|
1530 |
{ |
|
1531 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetDefaultFlagsL()"); |
|
1532 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
65 | 1533 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
1534 |
||
37 | 1535 |
TPhoneCmdParamBoolean globalNotifierParam; |
1536 |
globalNotifierParam.SetBoolean( EFalse ); |
|
1537 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
1538 |
&globalNotifierParam ); |
|
65 | 1539 |
|
37 | 1540 |
// Restore keylock if phone has been locked before call. |
1541 |
if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() ) |
|
1542 |
{ |
|
1543 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock ); |
|
1544 |
iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse ); |
|
1545 |
} |
|
1546 |
} |
|
1547 |
||
1548 |
// ----------------------------------------------------------- |
|
1549 |
// CPhoneState::ShowVideoCallOutOfMemoryNoteL |
|
1550 |
// ----------------------------------------------------------- |
|
1551 |
// |
|
1552 |
void CPhoneState::ShowVideoCallOutOfMemoryNoteL() |
|
1553 |
{ |
|
1554 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
1555 |
"CPhoneState::ShowVideoCallOutOfMemoryNoteL()" ); |
|
1556 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
1557 |
globalNotifierParam.SetBoolean( EFalse ); |
|
1558 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
1559 |
&globalNotifierParam ); |
|
65 | 1560 |
|
74 | 1561 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
1562 |
||
37 | 1563 |
// Display error note |
76 | 1564 |
/*SExtendedError ext; |
37 | 1565 |
ext.iComponent = KUidPhoneApplication; |
1566 |
ext.iErrorNumber = KErrNoMemory; |
|
1567 |
ext.iInformation = EFalse; |
|
1568 |
TBuf<1> ignore; |
|
76 | 1569 |
iAvkonAppUi->HandleError( KErrNoMemory, ext, ignore, ignore );*/ |
1570 |
//TODO show note |
|
37 | 1571 |
} |
1572 |
||
1573 |
// ----------------------------------------------------------------------------- |
|
1574 |
// CPhoneState::SimSecurityStatus |
|
1575 |
// ----------------------------------------------------------------------------- |
|
1576 |
// |
|
1577 |
TInt CPhoneState::SimSecurityStatus() const |
|
1578 |
{ |
|
1579 |
/* |
|
1580 |
Sim security statuses: |
|
1581 |
ESimSecurityStatusUninitialized = KStartupEnumerationFirstValue, |
|
1582 |
ESimRejected, // The PUK code has been entered incorrectly, so the card is rejected. |
|
1583 |
ESimUnaccepted // The SIM lock is on, so the card is unaccepted. |
|
1584 |
*/ |
|
1585 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimSecurityStatus()" ); |
|
1586 |
return CPhonePubSubProxy::Instance()->Value( |
|
1587 |
KPSUidStartup, KStartupSimSecurityStatus ); |
|
1588 |
} |
|
1589 |
||
1590 |
// ---------------------------------------------------------------------------- |
|
1591 |
// CPhoneState::SetRingingTonePlaybackL() |
|
1592 |
// ---------------------------------------------------------------------------- |
|
1593 |
// |
|
1594 |
EXPORT_C void CPhoneState::SetRingingTonePlaybackL( TInt aCallId ) |
|
1595 |
{ |
|
65 | 1596 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetRingingTonePlaybackL()" ); |
37 | 1597 |
TPhoneCmdParamRingTone ringToneParam; |
1598 |
ringToneParam.SetVolume( |
|
1599 |
iStateMachine->PhoneEngineInfo()->RingingVolume() ); |
|
1600 |
||
1601 |
TArray< TContactItemId > alertGroups = |
|
1602 |
iStateMachine->PhoneEngineInfo()->AlertForGroup(); |
|
65 | 1603 |
|
37 | 1604 |
TInt alertGroupCount = alertGroups.Count(); |
1605 |
TInt contactGroupCount = |
|
1606 |
iStateMachine->PhoneEngineInfo()->ContactGroups( aCallId ).Count(); |
|
1607 |
TBool alertingGroupFound( EFalse ); |
|
1608 |
||
1609 |
// Check contents of both the alerting groups array and call contact group |
|
1610 |
// array, if any of the group ids match then allow playing. |
|
1611 |
if ( alertGroupCount > 0 ) |
|
1612 |
{ |
|
1613 |
for ( TInt i = 0 ; i < alertGroupCount ; i++ ) |
|
1614 |
{ |
|
1615 |
for ( TInt j = 0 ; j < contactGroupCount ; j++ ) |
|
1616 |
{ |
|
1617 |
if ( alertGroups[ i ] == |
|
1618 |
( iStateMachine->PhoneEngineInfo()->ContactGroups( |
|
1619 |
aCallId ) )[ j ] ) |
|
1620 |
{ |
|
1621 |
alertingGroupFound = ETrue; |
|
1622 |
} |
|
1623 |
} |
|
1624 |
} |
|
1625 |
if ( alertingGroupFound == EFalse ) |
|
1626 |
{ |
|
1627 |
ringToneParam.SetRingingType( EProfileRingingTypeSilent ); |
|
1628 |
} |
|
1629 |
else |
|
1630 |
{ |
|
1631 |
ringToneParam.SetRingingType( |
|
1632 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
1633 |
} |
|
1634 |
} |
|
1635 |
else // no alerting groups set |
|
1636 |
{ |
|
1637 |
ringToneParam.SetRingingType( |
|
1638 |
iStateMachine->PhoneEngineInfo()->RingingType() ); |
|
1639 |
} |
|
1640 |
||
1641 |
// Set ring tone |
|
1642 |
if ( iStateMachine->PhoneEngineInfo()->PersonalRingingTone( |
|
1643 |
aCallId ).Length() ) |
|
1644 |
{ |
|
1645 |
// Set the personal ring tone |
|
1646 |
ringToneParam.SetRingTone( |
|
1647 |
iStateMachine->PhoneEngineInfo()->PersonalRingingTone( aCallId ) ); |
|
1648 |
ringToneParam.SetType( EPhoneRingTonePersonal ); |
|
1649 |
} |
|
1650 |
else if ( iStateMachine->PhoneEngineInfo()->RingingTone( |
|
1651 |
aCallId ).Length() ) |
|
1652 |
{ |
|
1653 |
// Set the profile ring tone |
|
1654 |
ringToneParam.SetRingTone( |
|
1655 |
iStateMachine->PhoneEngineInfo()->RingingTone( aCallId ) ); |
|
1656 |
ringToneParam.SetType( EPhoneRingToneProfile ); |
|
1657 |
||
1658 |
if ( ( iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 && |
|
1659 |
BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), |
|
1660 |
iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ) ) ) || |
|
1661 |
iStateMachine->PhoneEngineInfo()->HasCallerThumbnail( aCallId ) ) |
|
1662 |
{ |
|
1663 |
// Caller image set |
|
1664 |
ringToneParam.SetCallerImageStatus( ETrue ); |
|
1665 |
} |
|
1666 |
} |
|
1667 |
||
1668 |
// Set text to say, if enabled |
|
1669 |
if ( iStateMachine->PhoneEngineInfo()->TextToSpeech() ) |
|
1670 |
{ |
|
1671 |
ringToneParam.SetTextToSay( |
|
1672 |
iStateMachine->PhoneEngineInfo()->RemoteTextToSpeechText( |
|
1673 |
aCallId ) ); |
|
1674 |
} |
|
1675 |
||
1676 |
if ( iStateMachine->PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 ) |
|
1677 |
{ |
|
1678 |
ringToneParam.SetCallerTextStatus( ETrue ); |
|
65 | 1679 |
} |
37 | 1680 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewPlayRingTone, &ringToneParam ); |
1681 |
} |
|
1682 |
||
1683 |
// ----------------------------------------------------------- |
|
1684 |
// CPhoneState::HandleCugNoteL |
|
1685 |
// ----------------------------------------------------------- |
|
1686 |
// |
|
1687 |
void CPhoneState::HandleCugInUseNoteL() |
|
1688 |
{ |
|
1689 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCugInUseNoteL() "); |
|
1690 |
TInt cugIndex( 0 ); |
|
1691 |
RSSSettings ssSettings; |
|
1692 |
TInt retValue = ssSettings.Open(); |
|
1693 |
if ( retValue == KErrNone ) |
|
1694 |
{ |
|
1695 |
ssSettings.Get( ESSSettingsCug, cugIndex ); |
|
1696 |
} |
|
1697 |
ssSettings.Close(); |
|
1698 |
if ( cugIndex ) |
|
1699 |
{ |
|
1700 |
// Add it to the resource string |
|
1701 |
HBufC* buf = StringLoader::LoadLC( |
|
1702 |
CPhoneMainResourceResolver::Instance()-> |
|
1703 |
ResolveResourceID( |
|
1704 |
EPhoneInfoCugInUse ), cugIndex ); |
|
76 | 1705 |
|
1706 |
PhoneNoteUtil::SendGlobalNoteL( |
|
1707 |
EPhoneMessageBoxInformation, *buf ); |
|
1708 |
||
37 | 1709 |
CleanupStack::PopAndDestroy( buf ); |
1710 |
} |
|
1711 |
} |
|
1712 |
||
1713 |
// --------------------------------------------------------------------------- |
|
1714 |
// CPhoneState::LoadResource |
|
1715 |
// --------------------------------------------------------------------------- |
|
1716 |
// |
|
1717 |
void CPhoneState::LoadResource( TDes& aData, const TInt aResource ) const |
|
1718 |
{ |
|
1719 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() "); |
|
1720 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource ); |
|
74 | 1721 |
StringLoader::Load( |
1722 |
aData, |
|
1723 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), |
|
1724 |
EikonEnv() ); |
|
37 | 1725 |
} |
1726 |
||
1727 |
// ----------------------------------------------------------- |
|
1728 |
// CPhoneState::IsAnyConnectedCalls |
|
1729 |
// ----------------------------------------------------------- |
|
1730 |
// |
|
1731 |
TBool CPhoneState::IsAnyConnectedCalls() |
|
1732 |
{ |
|
1733 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAnyConnectedCalls() "); |
|
1734 |
TBool connectedCall(EFalse); |
|
1735 |
if ( iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnected ) || |
|
1736 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnecting ) || |
|
1737 |
iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnectedConference ) ) |
|
1738 |
{ |
|
1739 |
connectedCall = ETrue; |
|
1740 |
} |
|
1741 |
__PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyConnectedCalls: (%d)", connectedCall ); |
|
1742 |
return connectedCall; |
|
1743 |
} |
|
1744 |
||
1745 |
// --------------------------------------------------------- |
|
1746 |
// CPhoneState::SetToolbarButtonLoudspeakerEnabled |
|
1747 |
// --------------------------------------------------------- |
|
1748 |
// |
|
1749 |
EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled() |
|
1750 |
{ |
|
65 | 1751 |
TPhoneCmdParamInteger integerParam; |
1752 |
integerParam.SetInteger( EPhoneInCallCmdActivateIhf ); |
|
1753 |
TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
|
1754 |
EPhoneViewEnableToolbarButton, &integerParam )); |
|
37 | 1755 |
} |
1756 |
||
1757 |
// --------------------------------------------------------- |
|
50 | 1758 |
// CPhoneState::SetBackButtonActive |
37 | 1759 |
// --------------------------------------------------------- |
1760 |
// |
|
1761 |
EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive ) |
|
1762 |
{ |
|
65 | 1763 |
if( IsAutoLockOn() && aActive ) |
1764 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1765 |
// keep back button dimmed device lock case |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1766 |
return; |
37 | 1767 |
} |
65 | 1768 |
TPhoneCmdParamBoolean booleanParam; |
1769 |
booleanParam.SetBoolean( aActive ); |
|
1770 |
iViewCommandHandle->ExecuteCommand( |
|
1771 |
EPhoneViewBackButtonActive, &booleanParam ); |
|
37 | 1772 |
} |
1773 |
||
1774 |
// ----------------------------------------------------------- |
|
1775 |
// CPhoneState::OpenSoftRejectMessageEditorL |
|
1776 |
// ----------------------------------------------------------- |
|
1777 |
// |
|
1778 |
EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
|
1779 |
{ |
|
1780 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
1781 |
"CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
|
74 | 1782 |
iUiCommandManager->SetSoftRejectStatus( EFalse ); |
37 | 1783 |
TPhoneCmdParamCallStateData callStateData; |
1784 |
callStateData.SetCallState( EPEStateRinging ); |
|
1785 |
iViewCommandHandle->HandleCommandL( |
|
1786 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
1787 |
||
1788 |
TInt ringingCallId( KErrNotFound ); |
|
1789 |
// Do nothing if negative incoming call id |
|
1790 |
if( callStateData.CallId() > KErrNotFound ) |
|
1791 |
{ |
|
1792 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
1793 |
ringingCallId = callStateData.CallId(); |
|
1794 |
} |
|
1795 |
||
1796 |
TPhoneCmdParamSfiData sfiDataParam; |
|
1797 |
if (KErrNotFound != ringingCallId) |
|
1798 |
{ |
|
65 | 1799 |
if ( iStateMachine->PhoneEngineInfo()-> |
1800 |
RemoteName( ringingCallId ).Length() ) |
|
37 | 1801 |
{ |
1802 |
// store both the name and the number |
|
65 | 1803 |
sfiDataParam.SetNumber( |
1804 |
iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
1805 |
sfiDataParam.SetName( |
|
1806 |
iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) ); |
|
37 | 1807 |
} |
1808 |
else |
|
1809 |
{ |
|
1810 |
// store the number |
|
65 | 1811 |
sfiDataParam.SetNumber( |
1812 |
iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) ); |
|
37 | 1813 |
} |
1814 |
} |
|
74 | 1815 |
UpdateUiCommands(); |
1816 |
iViewCommandHandle->ExecuteCommandL( |
|
1817 |
EPhoneViewOpenSoftRejectEditor, |
|
1818 |
&sfiDataParam ); |
|
1819 |
} |
|
65 | 1820 |
|
74 | 1821 |
// ----------------------------------------------------------- |
1822 |
// CPhoneState::DisplayCallHeaderL() |
|
1823 |
// ----------------------------------------------------------- |
|
1824 |
// |
|
1825 |
EXPORT_C void CPhoneState::DisplayCallHeaderL( |
|
1826 |
TInt aCallId, |
|
1827 |
TNumberEntrySetRule aRule ) |
|
1828 |
{ |
|
1829 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
1830 |
"CPhoneState::BringIncomingCallHeaderToForegroundL( ) "); |
|
1831 |
BeginUiUpdateLC(); |
|
1832 |
switch ( aRule ) |
|
1833 |
{ |
|
1834 |
case ESetNEVisibilityFalse: |
|
1835 |
iNumberEntryManager-> |
|
1836 |
SetNumberEntryVisibilityL( EFalse ); |
|
1837 |
break; |
|
1838 |
case ECheckIfNEUsedBeforeSettingVisibilityFalse: |
|
1839 |
iNumberEntryManager-> |
|
1840 |
SetVisibilityIfNumberEntryUsedL(EFalse); |
|
1841 |
break; |
|
1842 |
default: // by default do nothing. |
|
1843 |
break; |
|
1844 |
} |
|
1845 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
1846 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
|
1847 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateCallHeader, aCallId ); |
|
1848 |
UpdateUiCommands(); |
|
1849 |
EndUiUpdate(); |
|
1850 |
} |
|
1851 |
||
1852 |
// --------------------------------------------------------- |
|
1853 |
// CPhoneState::SetTouchPaneButtons |
|
1854 |
// --------------------------------------------------------- |
|
1855 |
// |
|
1856 |
EXPORT_C void CPhoneState::UpdateUiCommands() |
|
1857 |
{ |
|
1858 |
iUiCommandManager->UpdateUiCommands(); |
|
1859 |
} |
|
1860 |
||
1861 |
// ----------------------------------------------------------- |
|
1862 |
// CPhoneState::HandleNumberEntryClearedL |
|
1863 |
// ----------------------------------------------------------- |
|
1864 |
// |
|
1865 |
EXPORT_C void CPhoneState::HandleNumberEntryClearedL() |
|
1866 |
{ |
|
1867 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumberEntryClearedL( ) "); |
|
1868 |
} |
|
1869 |
||
1870 |
// ----------------------------------------------------------- |
|
1871 |
// CPhoneState::IsCustomizedDialerVisibleL() |
|
1872 |
// ----------------------------------------------------------- |
|
1873 |
// |
|
1874 |
EXPORT_C TBool CPhoneState::IsCustomizedDialerVisibleL() const |
|
1875 |
{ |
|
1876 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsCustomizedDialerVisibleL( ) "); |
|
1877 |
return iNumberEntryManager->IsCustomizedDialerVisibleL(); |
|
37 | 1878 |
} |
1879 |
||
1880 |
// End of File |