37
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-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 CPhoneVccHandler class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDES
|
|
19 |
#include "phoneresourceids.h"
|
|
20 |
#include <StringLoader.h>
|
|
21 |
#include <avkon.rsg>
|
|
22 |
#include <mpeengineinfo.h>
|
|
23 |
#include <eikmenup.h>
|
|
24 |
#include <vccuipsproperty.h>
|
|
25 |
#include "cphonevcchandler.h"
|
|
26 |
#include "cphonetimer.h"
|
|
27 |
#include "cphonestate.h"
|
|
28 |
#include "cphonemainresourceresolver.h"
|
|
29 |
#include "phonelogger.h"
|
|
30 |
#include "cphonelogger.h"
|
|
31 |
#include "mphoneviewcommandhandle.h"
|
|
32 |
#include "mphonestatemachine.h"
|
|
33 |
#include "phonerssvoip.h"
|
|
34 |
#include "phoneappvoipcommands.hrh"
|
|
35 |
#include "tphonecmdparamglobalnote.h"
|
|
36 |
|
|
37 |
// For HO notification tone setting read
|
|
38 |
#include <spproperty.h>
|
|
39 |
#include <spsettings.h>
|
|
40 |
#include <spentry.h>
|
|
41 |
#include <spdefinitions.h>
|
|
42 |
|
|
43 |
|
|
44 |
// CONSTANTS
|
|
45 |
// 1,5 Second in microseconds
|
|
46 |
const TInt KPhoneShowNoteTime = 1500000;
|
|
47 |
|
|
48 |
// ================= MEMBER FUNCTIONS =======================
|
|
49 |
|
|
50 |
// C++ default constructor can NOT contain any code, that
|
|
51 |
// might leave.
|
|
52 |
//
|
|
53 |
CPhoneVccHandler::CPhoneVccHandler(
|
|
54 |
MPhoneStateMachine& aStateMachine,
|
|
55 |
MPhoneViewCommandHandle& aViewCommandHandle ) :
|
|
56 |
iStateMachine( aStateMachine ),
|
|
57 |
iViewCommandHandle( aViewCommandHandle ), iVccHoReady( ETrue )
|
|
58 |
{
|
|
59 |
}
|
|
60 |
|
|
61 |
// -----------------------------------------------------------
|
|
62 |
// CPhoneVccHandler::~CPhoneStateIdleVoIP()
|
|
63 |
// Destructor
|
|
64 |
// -----------------------------------------------------------
|
|
65 |
//
|
|
66 |
CPhoneVccHandler::~CPhoneVccHandler()
|
|
67 |
{
|
|
68 |
delete iPropListener;
|
|
69 |
TRAPD( err, CancelHandoverNoteTimerL() );
|
|
70 |
if ( err != KErrNone )
|
|
71 |
{
|
|
72 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
73 |
"CPhoneVccHandler::~CPhoneVccHandler, leave" );
|
|
74 |
}
|
|
75 |
}
|
|
76 |
|
|
77 |
// -----------------------------------------------------------
|
|
78 |
// CPhoneVccHandler::ConstructL()
|
|
79 |
// Constructor
|
|
80 |
// -----------------------------------------------------------
|
|
81 |
//
|
|
82 |
void CPhoneVccHandler::ConstructL()
|
|
83 |
{
|
|
84 |
iPropListener = CVccUiPsPropertyListener::NewL( KVccPropKeyHoStatus );
|
|
85 |
iPropListener->AddObserverL( *this );
|
|
86 |
iPropListener->Start();
|
|
87 |
}
|
|
88 |
|
|
89 |
// -----------------------------------------------------------
|
|
90 |
// CPhoneVccHandler::NewL()
|
|
91 |
// Constructor
|
|
92 |
// -----------------------------------------------------------
|
|
93 |
//
|
|
94 |
CPhoneVccHandler* CPhoneVccHandler::NewL(
|
|
95 |
MPhoneStateMachine& aStateMachine,
|
|
96 |
MPhoneViewCommandHandle& aViewCommandHandle )
|
|
97 |
{
|
|
98 |
CPhoneVccHandler* self = new (ELeave) CPhoneVccHandler(
|
|
99 |
aStateMachine,
|
|
100 |
aViewCommandHandle );
|
|
101 |
|
|
102 |
CleanupStack::PushL( self );
|
|
103 |
self->ConstructL();
|
|
104 |
CleanupStack::Pop( self );
|
|
105 |
|
|
106 |
return self;
|
|
107 |
}
|
|
108 |
|
|
109 |
// -----------------------------------------------------------
|
|
110 |
// CPhoneVccHandler::StartManualHandover
|
|
111 |
// -----------------------------------------------------------
|
|
112 |
//
|
|
113 |
void CPhoneVccHandler::StartManualHandoverL( TInt aCommand )
|
|
114 |
{
|
|
115 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
116 |
"CPhoneVccHandler::StartManualHandoverL()" )
|
|
117 |
|
|
118 |
HandoverInProgressNoteL( aCommand );
|
|
119 |
|
|
120 |
CVccUiPsProperty* prop = CVccUiPsProperty::NewL();
|
|
121 |
CleanupStack::PushL( prop );
|
|
122 |
|
|
123 |
if ( aCommand == EPhoneVoIPWaitHandoverFromGsm )
|
|
124 |
{
|
|
125 |
prop->NotifySubscriberL( EVccManualStartCsToPsHoRequest );
|
|
126 |
}
|
|
127 |
else
|
|
128 |
{
|
|
129 |
prop->NotifySubscriberL( EVccManualStartPsToCsHoRequest );
|
|
130 |
}
|
|
131 |
|
|
132 |
CleanupStack::PopAndDestroy(prop);
|
|
133 |
iVccHoReady = EFalse;
|
|
134 |
}
|
|
135 |
|
|
136 |
// -----------------------------------------------------------
|
|
137 |
// CPhoneVccHandler::AddHandoverMenuItem
|
|
138 |
// -----------------------------------------------------------
|
|
139 |
//
|
|
140 |
void CPhoneVccHandler::AddHandoverMenuItemL(
|
|
141 |
RArray<CTelMenuExtension::TCallInfo>& aArray,
|
|
142 |
TInt /*aResourceId*/,
|
|
143 |
CEikMenuPane& aMenuPane )
|
|
144 |
{
|
|
145 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
146 |
"CPhoneVccHandler::AddHandoverMenuItemL()");
|
|
147 |
TInt activeCallId( KErrNotFound );
|
|
148 |
|
|
149 |
for( TInt i = 0; i < aArray.Count(); i++ )
|
|
150 |
{
|
|
151 |
if( aArray[i].iCallState == CTelMenuExtension::EActive )
|
|
152 |
{
|
|
153 |
activeCallId = aArray[i].iCallId;
|
|
154 |
}
|
|
155 |
}
|
|
156 |
|
|
157 |
if ( activeCallId != KErrNotFound )
|
|
158 |
{
|
|
159 |
// Vcc not available or Multicall not available
|
|
160 |
if ( iVccUnavailable || aArray.Count() > 1 && iNoHoIfMultiCall )
|
|
161 |
{
|
|
162 |
return;
|
|
163 |
}
|
|
164 |
|
|
165 |
TPECallType callType =
|
|
166 |
iStateMachine.PhoneEngineInfo()->CallType( activeCallId );
|
|
167 |
|
|
168 |
CEikMenuPaneItem::SData data;
|
|
169 |
data.iCascadeId=0;
|
|
170 |
data.iFlags=0;
|
|
171 |
HBufC* string = NULL;
|
|
172 |
|
|
173 |
if ( callType == EPECallTypeVoIP && iVccHoAllowedToGsm )
|
|
174 |
{
|
|
175 |
string = StringLoader::LoadLC(
|
|
176 |
CPhoneMainResourceResolver::Instance()->
|
|
177 |
ResolveResourceID( EPhoneVoIPHandoverToGsmOption ) );
|
|
178 |
|
|
179 |
data.iCommandId = EPhoneCmdHandoverToGsm;
|
|
180 |
|
|
181 |
}
|
|
182 |
else if ( callType == EPECallTypeCSVoice && iVccHoAllowedToWlan )
|
|
183 |
{
|
|
184 |
string = StringLoader::LoadLC(
|
|
185 |
CPhoneMainResourceResolver::Instance()->
|
|
186 |
ResolveResourceID( EPhoneVoIPHandoverToWlanOption ) );
|
|
187 |
|
|
188 |
data.iCommandId = EPhoneCmdHandoverToWlan;
|
|
189 |
}
|
|
190 |
else
|
|
191 |
{
|
|
192 |
// Not add menu item
|
|
193 |
return;
|
|
194 |
}
|
|
195 |
|
|
196 |
data.iText = *string;
|
|
197 |
// Try to find index of EPhoneInCallCmdGoToIdle command
|
|
198 |
// handover item will be placed above it if found
|
|
199 |
|
|
200 |
TInt index( KErrNotFound );
|
|
201 |
|
|
202 |
if ( aMenuPane.MenuItemExists( EPhoneInCallCmdGoToIdle, index) )
|
|
203 |
{
|
|
204 |
aMenuPane.InsertMenuItemL( data, index );
|
|
205 |
}
|
|
206 |
else
|
|
207 |
{
|
|
208 |
aMenuPane.AddMenuItemL( data );
|
|
209 |
}
|
|
210 |
|
|
211 |
CleanupStack::PopAndDestroy( string );
|
|
212 |
}
|
|
213 |
}
|
|
214 |
|
|
215 |
// ---------------------------------------------------------
|
|
216 |
// CPhoneVccHandler::StartHandoverNoteTimerL
|
|
217 |
// ---------------------------------------------------------
|
|
218 |
//
|
|
219 |
void CPhoneVccHandler::StartHandoverNoteTimerL()
|
|
220 |
{
|
|
221 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
222 |
"CPhoneVccHandler::StartHandoverNoteTimerL()");
|
|
223 |
|
|
224 |
if( !iHandoverNoteTimer )
|
|
225 |
{
|
|
226 |
iHandoverNoteTimer = CPhoneTimer::NewL();
|
|
227 |
}
|
|
228 |
|
|
229 |
iHandoverNoteTimer->After( KPhoneShowNoteTime,
|
|
230 |
TCallBack( HandoverNoteTimerCallbackL, this ) );
|
|
231 |
}
|
|
232 |
|
|
233 |
// ---------------------------------------------------------
|
|
234 |
// CPhoneVccHandler::CancelHandoverNoteTimerL
|
|
235 |
// ---------------------------------------------------------
|
|
236 |
//
|
|
237 |
void CPhoneVccHandler::CancelHandoverNoteTimerL()
|
|
238 |
{
|
|
239 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
240 |
"CPhoneVccHandler::CancelHandoverNoteTimerL()");
|
|
241 |
if ( iHandoverNoteTimer )
|
|
242 |
{
|
|
243 |
delete iHandoverNoteTimer;
|
|
244 |
iHandoverNoteTimer = NULL;
|
|
245 |
}
|
|
246 |
RemoveHandoverNoteL();
|
|
247 |
}
|
|
248 |
|
|
249 |
// ---------------------------------------------------------
|
|
250 |
// CPhoneVccHandler::HandoverNoteTimerCallbackL
|
|
251 |
// ---------------------------------------------------------
|
|
252 |
//
|
|
253 |
TInt CPhoneVccHandler::HandoverNoteTimerCallbackL( TAny* aAny )
|
|
254 |
{
|
|
255 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
256 |
"CPhoneVccHandler::HandoverNoteTimerCallbackL()");
|
|
257 |
|
|
258 |
reinterpret_cast<CPhoneVccHandler*>( aAny )->
|
|
259 |
CancelHandoverNoteTimerL();
|
|
260 |
|
|
261 |
return KErrNone;
|
|
262 |
}
|
|
263 |
|
|
264 |
// ---------------------------------------------------------
|
|
265 |
// CPhoneVccHandler::RemoveHandoverNoteL
|
|
266 |
// ---------------------------------------------------------
|
|
267 |
//
|
|
268 |
void CPhoneVccHandler::RemoveHandoverNoteL()
|
|
269 |
{
|
|
270 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
271 |
"CPhoneVccHandler::RemoveHandoverNoteL()");
|
|
272 |
|
|
273 |
if ( iVccHoReady && !iHandoverNoteTimer )
|
|
274 |
{
|
|
275 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveGlobalNote );
|
|
276 |
}
|
|
277 |
}
|
|
278 |
|
|
279 |
// -----------------------------------------------------------
|
|
280 |
// CPhoneVccHandler::HandoverInProgressNoteL
|
|
281 |
// -----------------------------------------------------------
|
|
282 |
//
|
|
283 |
void CPhoneVccHandler::HandoverInProgressNoteL( TInt aCommand )
|
|
284 |
{
|
|
285 |
TPhoneCmdParamGlobalNote globalNoteParam;
|
|
286 |
|
|
287 |
// Check notification tone user setting
|
|
288 |
TInt tone = GetHoNotifToneModeL();
|
|
289 |
|
|
290 |
if ( tone == 1 )
|
|
291 |
{
|
|
292 |
globalNoteParam.SetTone( EAvkonSIDConfirmationTone );
|
|
293 |
}
|
|
294 |
else
|
|
295 |
{
|
|
296 |
globalNoteParam.SetTone( EAvkonSIDNoSound );
|
|
297 |
}
|
|
298 |
|
|
299 |
globalNoteParam.SetType( EAknGlobalWaitNote );
|
|
300 |
globalNoteParam.SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY );
|
|
301 |
globalNoteParam.SetTextResourceId(
|
|
302 |
CPhoneMainResourceResolver::Instance()->
|
|
303 |
ResolveResourceID( aCommand ) );
|
|
304 |
|
|
305 |
iViewCommandHandle.ExecuteCommandL(
|
|
306 |
EPhoneViewShowGlobalNote, &globalNoteParam );
|
|
307 |
|
|
308 |
StartHandoverNoteTimerL();
|
|
309 |
}
|
|
310 |
|
|
311 |
// -----------------------------------------------------------------------------
|
|
312 |
// CPhoneVccHandler::VccPropertyChangedL
|
|
313 |
// Gets called when PS key is changed
|
|
314 |
// -----------------------------------------------------------------------------
|
|
315 |
//
|
|
316 |
void CPhoneVccHandler::VccPropertyChangedL( const TUint aKeyId,
|
|
317 |
const TInt aValue )
|
|
318 |
{
|
|
319 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
|
|
320 |
"CPhoneVccHandler::VccPropertyChangedL() ");
|
|
321 |
|
|
322 |
__PHONELOG1( EBasic, EPhoneControl,
|
|
323 |
"CPhoneVccHandler::VccPropertyChangedL - key: %d", aValue );
|
|
324 |
|
|
325 |
|
|
326 |
if( aKeyId == KVccPropKeyHoStatus )
|
|
327 |
{
|
|
328 |
switch( aValue )
|
|
329 |
{
|
|
330 |
case EVccCsToPsHoFailure:
|
|
331 |
case EVccPsToCsHoFailure:
|
|
332 |
{
|
|
333 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
334 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO fail" );
|
|
335 |
// Remove handover note if handover is in progress
|
|
336 |
if( !iVccHoReady )
|
|
337 |
{
|
|
338 |
iVccHoReady = ETrue;
|
|
339 |
CPhoneState* phoneState =
|
|
340 |
static_cast< CPhoneState* >( iStateMachine.State() );
|
|
341 |
CancelHandoverNoteTimerL();
|
|
342 |
phoneState->SendGlobalInfoNoteL( EPhoneVoIPHandoverFail );
|
|
343 |
}
|
|
344 |
}
|
|
345 |
break;
|
|
346 |
case EVccCsToPsHoSuccessful:
|
|
347 |
case EVccPsToCsHoSuccessful:
|
|
348 |
{
|
|
349 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
350 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO Success" );
|
|
351 |
iVccHoReady = ETrue;
|
|
352 |
RemoveHandoverNoteL();
|
|
353 |
}
|
|
354 |
break;
|
|
355 |
case EVccCsToPsHoStarted:
|
|
356 |
{
|
|
357 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
358 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- CsToPsHoStarted" );
|
|
359 |
// Do not show if manually started since the wait note is
|
|
360 |
// already visible
|
|
361 |
if ( iVccHoReady )
|
|
362 |
{
|
|
363 |
iVccHoReady = EFalse;
|
|
364 |
HandoverInProgressNoteL( EPhoneVoIPWaitHandoverFromGsm );
|
|
365 |
}
|
|
366 |
}
|
|
367 |
break;
|
|
368 |
case EVccPsToCsHoStarted:
|
|
369 |
{
|
|
370 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
371 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- PsToCsHoStarted" );
|
|
372 |
// Do not show if manually started since the wait note is
|
|
373 |
// already visible
|
|
374 |
if ( iVccHoReady )
|
|
375 |
{
|
|
376 |
iVccHoReady = EFalse;
|
|
377 |
HandoverInProgressNoteL( EPhoneVoIPWaitHandoverFromWlan);
|
|
378 |
}
|
|
379 |
}
|
|
380 |
break;
|
|
381 |
case EVccPsToCsHoInprogress:
|
|
382 |
case EVccCsToPsHoInprogress:
|
|
383 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
384 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HoInprogress" );
|
|
385 |
// Do nothing
|
|
386 |
break;
|
|
387 |
case EVccHoUnavailable:
|
|
388 |
{
|
|
389 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
390 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO Unavailable" );
|
|
391 |
iVccUnavailable = ETrue;
|
|
392 |
break;
|
|
393 |
}
|
|
394 |
case EVccHoStateIdle:
|
|
395 |
{
|
|
396 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
397 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO IDLE" );
|
|
398 |
iVccHoAllowedToGsm = ETrue;
|
|
399 |
iVccHoAllowedToWlan = ETrue;
|
|
400 |
iNoHoIfMultiCall = EFalse;
|
|
401 |
iVccUnavailable = EFalse;
|
|
402 |
break;
|
|
403 |
}
|
|
404 |
case EVccCsToPsNotAllowed:
|
|
405 |
{
|
|
406 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
407 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccCsToPsNotAllowed" );
|
|
408 |
iVccHoAllowedToWlan = EFalse;
|
|
409 |
iVccHoAllowedToGsm = ETrue;
|
|
410 |
iNoHoIfMultiCall = EFalse;
|
|
411 |
iVccUnavailable = EFalse;
|
|
412 |
break;
|
|
413 |
}
|
|
414 |
|
|
415 |
case EVccPsToCsNotAllowed:
|
|
416 |
{
|
|
417 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
418 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccPsToCsNotAllowed" );
|
|
419 |
iVccHoAllowedToGsm = EFalse;
|
|
420 |
iVccHoAllowedToWlan = ETrue;
|
|
421 |
iNoHoIfMultiCall = EFalse;
|
|
422 |
iVccUnavailable = EFalse;
|
|
423 |
break;
|
|
424 |
}
|
|
425 |
|
|
426 |
case EVccHoStateIdleIfSingleCall:
|
|
427 |
{
|
|
428 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
429 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoStateIdleIfSingleCall" );
|
|
430 |
iNoHoIfMultiCall = ETrue;
|
|
431 |
iVccHoAllowedToGsm = ETrue;
|
|
432 |
iVccHoAllowedToWlan = ETrue;
|
|
433 |
iVccUnavailable = EFalse;
|
|
434 |
break;
|
|
435 |
}
|
|
436 |
case EVccHoAllowedToCsIfSingleCall:
|
|
437 |
{
|
|
438 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
439 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoAllowedToCsIfSingleCall" );
|
|
440 |
iNoHoIfMultiCall = ETrue;
|
|
441 |
iVccHoAllowedToWlan = EFalse;
|
|
442 |
iVccHoAllowedToGsm = ETrue;
|
|
443 |
iVccUnavailable = EFalse;
|
|
444 |
break;
|
|
445 |
}
|
|
446 |
case EVccHoAllowedToPsIfSingleCall:
|
|
447 |
{
|
|
448 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
449 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoAllowedToPsIfSingleCall" );
|
|
450 |
iNoHoIfMultiCall = ETrue;
|
|
451 |
iVccHoAllowedToGsm = EFalse;
|
|
452 |
iVccHoAllowedToWlan = ETrue;
|
|
453 |
iVccUnavailable = EFalse;
|
|
454 |
break;
|
|
455 |
}
|
|
456 |
|
|
457 |
default:
|
|
458 |
|
|
459 |
__PHONELOG( EBasic, PhoneUIVoIPExtension,
|
|
460 |
"CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- default" );
|
|
461 |
break;
|
|
462 |
}
|
|
463 |
}
|
|
464 |
}
|
|
465 |
// ---------------------------------------------------------------------------
|
|
466 |
// Gets HO notification tone setting value
|
|
467 |
// ---------------------------------------------------------------------------
|
|
468 |
//
|
|
469 |
TInt CPhoneVccHandler::GetHoNotifToneModeL()
|
|
470 |
{
|
|
471 |
// Find out VCC service id
|
|
472 |
CSPProperty* property = CSPProperty::NewLC();
|
|
473 |
|
|
474 |
CSPSettings* settings = CSPSettings::NewLC();
|
|
475 |
|
|
476 |
TInt vccServiceId = GetVccServiceIdL();
|
|
477 |
|
|
478 |
//get the VCC enabled VoIP service id.
|
|
479 |
TInt err = settings->FindPropertyL(
|
|
480 |
vccServiceId, ESubPropertyVccDtVoipServiceId, *property );
|
|
481 |
|
|
482 |
TInt voipId;
|
|
483 |
TInt error = property->GetValue( voipId );
|
|
484 |
|
|
485 |
// Find and get the HO notification tone property
|
|
486 |
TInt tone = 0;
|
|
487 |
RBuf value;
|
|
488 |
value.CreateL( 1 );
|
|
489 |
|
|
490 |
err = settings->FindPropertyL(
|
|
491 |
voipId, ESubPropertyVccHoNotificationToneMode, *property );
|
|
492 |
|
|
493 |
if ( !err )
|
|
494 |
{
|
|
495 |
HBufC* temp;
|
|
496 |
property->GetValue( value );
|
|
497 |
temp = value.AllocL();
|
|
498 |
TLex temp2( *temp );
|
|
499 |
temp2.Val( tone );
|
|
500 |
delete temp;
|
|
501 |
}
|
|
502 |
value.Close();
|
|
503 |
|
|
504 |
// Set to default (0 = off) in case of invalid value
|
|
505 |
if ( !( tone == 0 || tone == 1 ))
|
|
506 |
{
|
|
507 |
tone = 0;
|
|
508 |
}
|
|
509 |
|
|
510 |
CleanupStack::PopAndDestroy( settings );
|
|
511 |
CleanupStack::PopAndDestroy( property );
|
|
512 |
|
|
513 |
|
|
514 |
|
|
515 |
return tone;
|
|
516 |
}
|
|
517 |
|
|
518 |
// ---------------------------------------------------------------------------
|
|
519 |
// For finding out VCC service id.
|
|
520 |
// ---------------------------------------------------------------------------
|
|
521 |
//
|
|
522 |
TInt CPhoneVccHandler::GetVccServiceIdL()
|
|
523 |
{
|
|
524 |
TInt vccServiceId( KErrNotFound );
|
|
525 |
// Array of service provider IDs
|
|
526 |
// is defined as: typedef RArray<TServiceId> RIdArray
|
|
527 |
// in spdefinitions.h
|
|
528 |
RIdArray serviceIdArray;
|
|
529 |
CleanupClosePushL( serviceIdArray );
|
|
530 |
|
|
531 |
CSPSettings* settings = CSPSettings::NewLC();
|
|
532 |
settings->FindServiceIdsL( serviceIdArray );
|
|
533 |
|
|
534 |
TBool foundEntry( EFalse );
|
|
535 |
|
|
536 |
for ( TInt i( 0 ); i < serviceIdArray.Count() && !foundEntry; i++ )
|
|
537 |
{
|
|
538 |
CSPProperty* property = CSPProperty::NewLC();
|
|
539 |
TInt error = settings->FindPropertyL( serviceIdArray[i], ESubPropertyVccVDI, *property );
|
|
540 |
|
|
541 |
if( error == KErrNone )
|
|
542 |
{
|
|
543 |
vccServiceId = serviceIdArray[i];
|
|
544 |
foundEntry = ETrue;
|
|
545 |
}
|
|
546 |
CleanupStack::PopAndDestroy( property );
|
|
547 |
}
|
|
548 |
CleanupStack::PopAndDestroy( settings );
|
|
549 |
CleanupStack::PopAndDestroy( &serviceIdArray );
|
|
550 |
|
|
551 |
return vccServiceId;
|
|
552 |
}
|
|
553 |
// End of File
|