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