|
1 /* |
|
2 * Copyright (c) 2007-2008 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: SP Settings handler for Vcc settings, handles caching and |
|
15 storing data related to Vcc settings. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #include <charconv.h> |
|
22 #include <in_sock.h> |
|
23 #include <spsettings.h> |
|
24 #include <spentry.h> |
|
25 #include <spproperty.h> |
|
26 #include <badesca.h> |
|
27 #include <e32cmn.h> |
|
28 |
|
29 #include "vccspsettings.h" |
|
30 #include "vccmiscutils.h" |
|
31 #include "rubydebug.h" |
|
32 |
|
33 /** VCC call provider plugin uid */ |
|
34 const TInt32 KVccCallProviderPlugId = 0x2000CFAA; |
|
35 |
|
36 /** Zero ID */ |
|
37 const TUint KVccZeroId = 0; |
|
38 |
|
39 /** Service Id string length */ |
|
40 const TInt KVccServiceIdLength = 8; |
|
41 |
|
42 /** Names array size */ |
|
43 const TInt KVccNameArraySize = 10; |
|
44 |
|
45 // ======== MEMBER FUNCTIONS ======== |
|
46 // --------------------------------------------------------------------------- |
|
47 // C++ constructor |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 CVccSPSettings::CVccSPSettings() |
|
51 { |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // Symbian 2nd phase Constructor |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 void CVccSPSettings::ConstructL() |
|
59 { |
|
60 RUBY_DEBUG_BLOCKL( "CVccSPSettings::ConstructL" ); |
|
61 iSettings = CSPSettings::NewL(); |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // Constructor |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 EXPORT_C CVccSPSettings* CVccSPSettings::NewL() |
|
69 { |
|
70 RUBY_DEBUG_BLOCKL( "CVccSPSettings::NewL" ); |
|
71 |
|
72 CVccSPSettings* self = new ( ELeave ) CVccSPSettings(); |
|
73 CleanupStack::PushL( self ); |
|
74 self->ConstructL(); |
|
75 CleanupStack::Pop( self ); |
|
76 return self; |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // Destructor |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 EXPORT_C CVccSPSettings::~CVccSPSettings() |
|
84 { |
|
85 RUBY_DEBUG0( "CVccSPSettings::~CVccSPSettings START" ); |
|
86 |
|
87 delete iProviderId; |
|
88 delete iServiceName; |
|
89 delete iVdi; |
|
90 delete iVdn; |
|
91 delete iPreferredDomain; |
|
92 delete iImmediateDt; |
|
93 delete iDtCsToPsAllowed; |
|
94 delete iDtPsToCsAllowed; |
|
95 delete iDtHeldWaitingCallsAllowed; |
|
96 delete iDtWlanHoTreshold; |
|
97 delete iDtWlanHoHysteresis; |
|
98 delete iDtWlanHoHysteresisTimerLow; |
|
99 delete iDtWlanHoHysteresisTimerHigh; |
|
100 delete iDtCsHoTreshold; |
|
101 delete iDtCsHoHysteresis; |
|
102 delete iDtCsHoHysteresisTimerLow; |
|
103 delete iDtCsHoHysteresisTimerHigh; |
|
104 delete iVoipServiceIdString; |
|
105 delete iDtAllowedWhenCsOriginated; |
|
106 |
|
107 delete iSettings; |
|
108 RUBY_DEBUG0( "CVccSPSettings::~CVccSPSettings EXIT" ); |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // Stores cached Vcc settings. |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 EXPORT_C void CVccSPSettings::StoreL() |
|
116 { |
|
117 RUBY_DEBUG_BLOCK( "CVccSPSettings::StoreL" ); |
|
118 RUBY_DEBUG1( "CVccSPSettings::StoreL instance %x", this ); |
|
119 |
|
120 CSPEntry* entry = CSPEntry::NewLC(); |
|
121 |
|
122 RUBY_DEBUG1( "-service name:[%S]",iServiceName ); |
|
123 |
|
124 TInt error( KErrNone ); |
|
125 RIdArray serviceids; |
|
126 CleanupClosePushL( serviceids ); |
|
127 iSettings->FindServiceIdsL( serviceids ); |
|
128 |
|
129 TBool foundEntry( EFalse ); |
|
130 |
|
131 //look for VCC service |
|
132 for ( TInt i( 0 ); i < serviceids.Count() && !foundEntry; i++ ) |
|
133 { |
|
134 CSPProperty* property = CSPProperty::NewLC(); |
|
135 error = iSettings->FindPropertyL( serviceids[i], ESubPropertyVccVDI, *property ); |
|
136 |
|
137 if( error == KErrNone ) |
|
138 { |
|
139 RUBY_DEBUG0( "-service found" ); |
|
140 iSettings->FindEntryL( serviceids[i], *entry ); |
|
141 foundEntry = ETrue; |
|
142 } |
|
143 CleanupStack::PopAndDestroy( property ); |
|
144 } |
|
145 |
|
146 if ( !foundEntry ) //if service not found then add new |
|
147 { |
|
148 //add entry fails if name is not set |
|
149 RUBY_DEBUG0( "add new service" ); |
|
150 entry->SetServiceName( *iServiceName ); |
|
151 User::LeaveIfError( iSettings->AddEntryL( *entry )); |
|
152 } |
|
153 CleanupStack::PopAndDestroy( &serviceids ); |
|
154 iServiceId = entry->GetServiceId(); |
|
155 |
|
156 ModifyVoipProfileL(); |
|
157 |
|
158 TInt err = 0; |
|
159 /* |
|
160 |
|
161 CSPProperty* voipProperty = CSPProperty::NewLC(); |
|
162 TInt err = iSettings->FindPropertyL( iVoipServiceId, |
|
163 EPropertyCallProviderPluginId, |
|
164 *voipProperty ); |
|
165 |
|
166 if( err == KErrNone) |
|
167 { |
|
168 voipProperty->SetValue( KVccCallProviderPlugId ); |
|
169 User::LeaveIfError( iSettings->AddOrUpdatePropertyL( iVoipServiceId, |
|
170 *voipProperty ) ); |
|
171 } |
|
172 CleanupStack::PopAndDestroy( voipProperty ); |
|
173 |
|
174 voipProperty = CSPProperty::NewLC(); |
|
175 err = iSettings->FindPropertyL( iVoipServiceId, |
|
176 EPropertyServiceAttributeMask, |
|
177 *voipProperty ); |
|
178 |
|
179 |
|
180 //Set bootstrap bit on, so that CCE cant unload VCC |
|
181 //Should be figured out how do it so that inactive VoIP service |
|
182 //is still unloaded, but VCC is not. |
|
183 if( err == KErrNone) |
|
184 { |
|
185 TInt mask; |
|
186 voipProperty->GetValue( mask ); |
|
187 |
|
188 mask = mask | EBootstrapCallProvider; |
|
189 |
|
190 voipProperty->SetValue( mask ); |
|
191 User::LeaveIfError( iSettings->AddOrUpdatePropertyL( iVoipServiceId, |
|
192 *voipProperty ) ); |
|
193 } |
|
194 CleanupStack::PopAndDestroy( voipProperty ); |
|
195 */ |
|
196 |
|
197 |
|
198 //check existing properties from entry |
|
199 if( iVdi != NULL ) |
|
200 AddOrUpdatePropertyL( *entry, ESubPropertyVccVDI, *iVdi ); |
|
201 |
|
202 if( iVdn != NULL ) |
|
203 AddOrUpdatePropertyL( *entry, ESubPropertyVccVDN, *iVdn ); |
|
204 |
|
205 if( iPreferredDomain != NULL ) |
|
206 AddOrUpdatePropertyL( *entry, ESubPropertyVccPreferredDomain, |
|
207 *iPreferredDomain ); |
|
208 |
|
209 if( iImmediateDt != NULL ) |
|
210 AddOrUpdatePropertyL( *entry, ESubPropertyVccImmediateDomainTransfer, |
|
211 *iImmediateDt ); |
|
212 |
|
213 if( iDtCsToPsAllowed != NULL ) |
|
214 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtCstoPsAllowed, |
|
215 *iDtCsToPsAllowed ); |
|
216 |
|
217 if( iDtPsToCsAllowed != NULL ) |
|
218 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtPstoCsAllowed, |
|
219 *iDtPsToCsAllowed ); |
|
220 |
|
221 if( iDtHeldWaitingCallsAllowed != NULL ) |
|
222 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtHeldWaitingCallsAllowed, |
|
223 *iDtHeldWaitingCallsAllowed ); |
|
224 |
|
225 if( iDtWlanHoTreshold != NULL ) |
|
226 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtWLANHoTriggerLevel, |
|
227 *iDtWlanHoTreshold ); |
|
228 |
|
229 if( iDtWlanHoHysteresis != NULL ) |
|
230 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtWLANHoHysteresis, |
|
231 *iDtWlanHoHysteresis ); |
|
232 |
|
233 if( iDtWlanHoHysteresisTimerLow != NULL ) |
|
234 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtWLANHoHysteresisTimerLow, |
|
235 *iDtWlanHoHysteresisTimerLow ); |
|
236 |
|
237 if( iDtWlanHoHysteresisTimerHigh != NULL ) |
|
238 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtWLANHoHysteresisTimerHigh, |
|
239 *iDtWlanHoHysteresisTimerHigh ); |
|
240 |
|
241 if( iDtCsHoTreshold != NULL ) |
|
242 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtCSHoTriggerLevel, |
|
243 *iDtCsHoTreshold ); |
|
244 |
|
245 if( iDtCsHoHysteresis != NULL ) |
|
246 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtCSHoHysteresis, |
|
247 *iDtCsHoHysteresis ); |
|
248 |
|
249 if( iDtCsHoHysteresisTimerLow != NULL ) |
|
250 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtCSHoHysteresisTimerLow, |
|
251 *iDtCsHoHysteresisTimerLow ); |
|
252 |
|
253 if( iDtCsHoHysteresisTimerHigh != NULL ) |
|
254 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtCSHoHysteresisTimerHigh, |
|
255 *iDtCsHoHysteresisTimerHigh ); |
|
256 |
|
257 if( iVoipServiceIdString != NULL ) |
|
258 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtVoipServiceId, |
|
259 *iVoipServiceIdString ); |
|
260 |
|
261 if( iDtAllowedWhenCsOriginated != NULL ) |
|
262 AddOrUpdatePropertyL( *entry, ESubPropertyVccDtAllowedWhenCsOriginated, |
|
263 *iDtAllowedWhenCsOriginated ); |
|
264 |
|
265 RUBY_DEBUG1( "iVoipServiceId [%d]", iVoipServiceId ); |
|
266 |
|
267 // Initialize HO notification tone value to 0 (off), if not found or invalid |
|
268 RBuf val; |
|
269 val.CreateL( KSPMaxDesLength ); |
|
270 err = GetPropertyValue( *entry, ESubPropertyVccHoNotificationToneMode, |
|
271 val ); |
|
272 |
|
273 if ( err || !( ConvertToIntL( val ) == 0 || ConvertToIntL( val ) == 1 ) ) |
|
274 { |
|
275 // setting not found, or illegal value, set to default (0=off)TBuf<1> |
|
276 // zero = _L( "0" ); |
|
277 HBufC* tmp; |
|
278 TBuf<1> zero(_L("0")); |
|
279 tmp = zero.AllocL(); |
|
280 AddOrUpdatePropertyL( *entry, ESubPropertyVccHoNotificationToneMode, |
|
281 *tmp ); |
|
282 delete tmp; |
|
283 } |
|
284 val.Close(); |
|
285 |
|
286 //get propertyarray |
|
287 RPropertyArray newProperties = entry->GetAllProperties(); |
|
288 TInt propCount( entry->PropertyCount() ); |
|
289 RUBY_DEBUG1( "service properties count [%d]", propCount ); |
|
290 |
|
291 //add/update propertyarray to settings |
|
292 User::LeaveIfError( iSettings->AddOrUpdatePropertiesL( iServiceId, |
|
293 newProperties )); |
|
294 |
|
295 CleanupStack::PopAndDestroy( entry ); |
|
296 } |
|
297 |
|
298 // --------------------------------------------------------------------------- |
|
299 // Returns the name of stored settings |
|
300 // --------------------------------------------------------------------------- |
|
301 // |
|
302 EXPORT_C const TDesC& CVccSPSettings::ProviderId() |
|
303 { |
|
304 if( iProviderId != NULL ) |
|
305 { |
|
306 RUBY_DEBUG0( "- VCC provider id exists" ); |
|
307 return *iProviderId; |
|
308 } |
|
309 else |
|
310 { |
|
311 RUBY_DEBUG0( "-no VCC provider id" ); |
|
312 return KNullDesC; |
|
313 } |
|
314 } |
|
315 |
|
316 // --------------------------------------------------------------------------- |
|
317 // Sets name of settings |
|
318 // --------------------------------------------------------------------------- |
|
319 // |
|
320 EXPORT_C void CVccSPSettings::SetProviderIdL( const TDesC& aValue ) |
|
321 { |
|
322 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetProviderIdL" ); |
|
323 |
|
324 // Delete the setting if already allocated |
|
325 delete iProviderId; |
|
326 iProviderId = NULL; |
|
327 iProviderId = aValue.AllocL(); |
|
328 } |
|
329 |
|
330 // --------------------------------------------------------------------------- |
|
331 // Sets name of settings |
|
332 // --------------------------------------------------------------------------- |
|
333 // |
|
334 EXPORT_C void CVccSPSettings::SetServiceNameL( const TDesC& aValue ) |
|
335 { |
|
336 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetNameL" ); |
|
337 delete iServiceName; |
|
338 iServiceName = NULL; |
|
339 iServiceName = aValue.AllocL(); |
|
340 } |
|
341 |
|
342 // --------------------------------------------------------------------------- |
|
343 // Returns name of stored settings |
|
344 // --------------------------------------------------------------------------- |
|
345 // |
|
346 EXPORT_C const TDesC& CVccSPSettings::ServiceName() |
|
347 { |
|
348 if( iServiceName != NULL ) |
|
349 { |
|
350 RUBY_DEBUG0( "-VCC service name exists" ); |
|
351 return *iServiceName; |
|
352 } |
|
353 else |
|
354 { |
|
355 RUBY_DEBUG0( "-no VCC service name" ); |
|
356 |
|
357 return KNullDesC; |
|
358 } |
|
359 } |
|
360 // --------------------------------------------------------------------------- |
|
361 // Sets VDI |
|
362 // --------------------------------------------------------------------------- |
|
363 // |
|
364 EXPORT_C TInt CVccSPSettings::SetVdiL( const TDesC& aValue ) |
|
365 { |
|
366 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetVdiL" ); |
|
367 |
|
368 TInt err = TVCCMiscUtils::URIValidL( aValue ); |
|
369 if ( !err ) |
|
370 { |
|
371 if( iVdi ) |
|
372 { |
|
373 delete iVdi; |
|
374 iVdi = NULL; |
|
375 } |
|
376 iVdi = aValue.AllocL(); |
|
377 } |
|
378 |
|
379 return err; |
|
380 } |
|
381 |
|
382 // --------------------------------------------------------------------------- |
|
383 // Sets VDN |
|
384 // --------------------------------------------------------------------------- |
|
385 // |
|
386 EXPORT_C TBool CVccSPSettings::SetVdnL( const TDesC& aValue ) |
|
387 { |
|
388 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetVdnL" ); |
|
389 |
|
390 TBool ok = TVCCMiscUtils::VDNValidL( aValue ); |
|
391 |
|
392 if ( ok ) |
|
393 { |
|
394 if( iVdn ) |
|
395 { |
|
396 delete iVdn; |
|
397 iVdi = NULL; |
|
398 } |
|
399 |
|
400 iVdn = aValue.AllocL(); |
|
401 } |
|
402 |
|
403 return ok; |
|
404 } |
|
405 |
|
406 // --------------------------------------------------------------------------- |
|
407 // Sets Preferred Domain |
|
408 // --------------------------------------------------------------------------- |
|
409 // |
|
410 EXPORT_C void CVccSPSettings::SetPreferredDomainL( const TDesC& aValue ) |
|
411 { |
|
412 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetPreferredDomainL" ); |
|
413 if ( iPreferredDomain ) |
|
414 { |
|
415 delete iPreferredDomain; |
|
416 iPreferredDomain = NULL; |
|
417 } |
|
418 iPreferredDomain = aValue.AllocL(); |
|
419 } |
|
420 |
|
421 // --------------------------------------------------------------------------- |
|
422 // Sets Immediate Domain Transfer |
|
423 // --------------------------------------------------------------------------- |
|
424 // |
|
425 EXPORT_C void CVccSPSettings::SetImmediateDtL( const TDesC& aValue ) |
|
426 { |
|
427 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetImmediateDtL" ); |
|
428 if ( iImmediateDt ) |
|
429 { |
|
430 delete iImmediateDt; |
|
431 iImmediateDt = NULL; |
|
432 } |
|
433 |
|
434 iImmediateDt = aValue.AllocL(); |
|
435 } |
|
436 |
|
437 // --------------------------------------------------------------------------- |
|
438 // Sets Domain Transfer Cs To Ps Allowed |
|
439 // --------------------------------------------------------------------------- |
|
440 // |
|
441 EXPORT_C void CVccSPSettings::SetDtCsToPsAllowedL( const TDesC& aValue ) |
|
442 { |
|
443 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetDtCsToPsAllowedL" ); |
|
444 if ( iDtCsToPsAllowed ) |
|
445 { |
|
446 delete iDtCsToPsAllowed; |
|
447 iDtCsToPsAllowed = NULL; |
|
448 } |
|
449 iDtCsToPsAllowed = aValue.AllocL(); |
|
450 } |
|
451 |
|
452 // --------------------------------------------------------------------------- |
|
453 // Sets Domain Transfer Ps To Cs Allowed |
|
454 // --------------------------------------------------------------------------- |
|
455 // |
|
456 EXPORT_C void CVccSPSettings::SetDtPsToCsAllowedL( const TDesC& aValue ) |
|
457 { |
|
458 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetDtPsToCsAllowedL" ); |
|
459 if ( iDtPsToCsAllowed ) |
|
460 { |
|
461 delete iDtPsToCsAllowed; |
|
462 iDtPsToCsAllowed = NULL; |
|
463 } |
|
464 iDtPsToCsAllowed = aValue.AllocL(); |
|
465 } |
|
466 |
|
467 // --------------------------------------------------------------------------- |
|
468 // Sets Domain Transfer allowed while Held and Waiting Calls |
|
469 // --------------------------------------------------------------------------- |
|
470 // |
|
471 EXPORT_C void CVccSPSettings::SetDtHeldWaitingCallsAllowedL( const TDesC& aValue ) |
|
472 { |
|
473 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetDtHeldWaitingCallsAllowedVccL" ); |
|
474 if ( iDtHeldWaitingCallsAllowed ) |
|
475 { |
|
476 delete iDtHeldWaitingCallsAllowed; |
|
477 iDtHeldWaitingCallsAllowed = NULL; |
|
478 } |
|
479 iDtHeldWaitingCallsAllowed = aValue.AllocL(); |
|
480 } |
|
481 |
|
482 // --------------------------------------------------------------------------- |
|
483 // Sets handover treshold value for WLAN |
|
484 // --------------------------------------------------------------------------- |
|
485 // |
|
486 EXPORT_C void CVccSPSettings::SetDtWlanHoTresholdL( const TDesC& aValue ) |
|
487 { |
|
488 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtWlanHoTresholdL" ); |
|
489 if ( iDtWlanHoTreshold ) |
|
490 { |
|
491 delete iDtWlanHoTreshold; |
|
492 iDtWlanHoTreshold = NULL; |
|
493 } |
|
494 iDtWlanHoTreshold = aValue.AllocL(); |
|
495 } |
|
496 |
|
497 // --------------------------------------------------------------------------- |
|
498 // Sets handover hysteresis value for WLAN |
|
499 // --------------------------------------------------------------------------- |
|
500 // |
|
501 EXPORT_C void CVccSPSettings::SetDtWlanHoHysteresisL( const TDesC& aValue ) |
|
502 { |
|
503 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtWlanHoHysteresisL" ); |
|
504 if ( iDtWlanHoHysteresis ) |
|
505 { |
|
506 delete iDtWlanHoHysteresis; |
|
507 iDtWlanHoHysteresis = NULL; |
|
508 } |
|
509 iDtWlanHoHysteresis = aValue.AllocL(); |
|
510 } |
|
511 // --------------------------------------------------------------------------- |
|
512 // Sets handover hysteresis timer value for WLAN lower limit |
|
513 // --------------------------------------------------------------------------- |
|
514 // |
|
515 EXPORT_C void CVccSPSettings::SetDtWlanHoHysteresisTimerLowL( |
|
516 const TDesC& aValue ) |
|
517 { |
|
518 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtWlanHoHysteresisTimerLowL" ); |
|
519 if ( iDtWlanHoHysteresisTimerLow ) |
|
520 { |
|
521 delete iDtWlanHoHysteresisTimerLow; |
|
522 iDtWlanHoHysteresisTimerLow = NULL; |
|
523 } |
|
524 iDtWlanHoHysteresisTimerLow = aValue.AllocL(); |
|
525 } |
|
526 // --------------------------------------------------------------------------- |
|
527 // Sets handover hysteresis timer value for WLAN higher limit |
|
528 // --------------------------------------------------------------------------- |
|
529 // |
|
530 EXPORT_C void CVccSPSettings::SetDtWlanHoHysteresisTimerHighL( |
|
531 const TDesC& aValue ) |
|
532 { |
|
533 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtWlanHoHysteresisTimerHighL" ); |
|
534 if ( iDtWlanHoHysteresisTimerHigh ) |
|
535 { |
|
536 delete iDtWlanHoHysteresisTimerHigh; |
|
537 iDtWlanHoHysteresisTimerHigh = NULL; |
|
538 } |
|
539 iDtWlanHoHysteresisTimerHigh = aValue.AllocL(); |
|
540 } |
|
541 // --------------------------------------------------------------------------- |
|
542 // Sets handover treshold value for CS |
|
543 // --------------------------------------------------------------------------- |
|
544 // |
|
545 EXPORT_C void CVccSPSettings::SetDtCsHoTresholdL( const TDesC& aValue ) |
|
546 { |
|
547 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtCsHoTresholdL" ); |
|
548 if ( iDtCsHoTreshold ) |
|
549 { |
|
550 delete iDtCsHoTreshold; |
|
551 iDtCsHoTreshold = NULL; |
|
552 } |
|
553 iDtCsHoTreshold = aValue.AllocL(); |
|
554 } |
|
555 |
|
556 // --------------------------------------------------------------------------- |
|
557 // Sets handover hysteresis value for CS |
|
558 // --------------------------------------------------------------------------- |
|
559 // |
|
560 EXPORT_C void CVccSPSettings::SetDtCsHoHysteresisL( const TDesC& aValue ) |
|
561 { |
|
562 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtCsHoHysteresisL" ); |
|
563 if ( iDtCsHoHysteresis ) |
|
564 { |
|
565 delete iDtCsHoHysteresis; |
|
566 iDtCsHoHysteresis = NULL; |
|
567 } |
|
568 iDtCsHoHysteresis = aValue.AllocL(); |
|
569 } |
|
570 |
|
571 // --------------------------------------------------------------------------- |
|
572 // Sets handover hysteresis timer value for CS lower limit |
|
573 // --------------------------------------------------------------------------- |
|
574 // |
|
575 EXPORT_C void CVccSPSettings::SetDtCsHoHysteresisTimerLowL( const TDesC& aValue ) |
|
576 { |
|
577 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtCsHoHysteresisTimerLowL" ); |
|
578 if ( iDtCsHoHysteresisTimerLow ) |
|
579 { |
|
580 delete iDtCsHoHysteresisTimerLow; |
|
581 iDtCsHoHysteresisTimerLow = NULL; |
|
582 } |
|
583 iDtCsHoHysteresisTimerLow = aValue.AllocL(); |
|
584 } |
|
585 |
|
586 // --------------------------------------------------------------------------- |
|
587 // Sets handover hysteresis timer value for CS higher limit |
|
588 // --------------------------------------------------------------------------- |
|
589 // |
|
590 EXPORT_C void CVccSPSettings::SetDtCsHoHysteresisTimerHighL( |
|
591 const TDesC& aValue ) |
|
592 { |
|
593 RUBY_DEBUG_BLOCK( "CWPVccItem::SetDtCsHoHysteresisTimerHighL" ); |
|
594 if ( iDtCsHoHysteresisTimerHigh ) |
|
595 { |
|
596 delete iDtCsHoHysteresisTimerHigh; |
|
597 iDtCsHoHysteresisTimerHigh = NULL; |
|
598 } |
|
599 iDtCsHoHysteresisTimerHigh = aValue.AllocL(); |
|
600 } |
|
601 |
|
602 // --------------------------------------------------------------------------- |
|
603 // Converts given value to int. |
|
604 // --------------------------------------------------------------------------- |
|
605 // |
|
606 EXPORT_C TInt CVccSPSettings::ConvertToIntL( const TDesC& aValue ) |
|
607 { |
|
608 TInt intValue; |
|
609 TLex temp( aValue ); |
|
610 User::LeaveIfError( temp.Val( intValue ) ); |
|
611 return intValue; |
|
612 } |
|
613 |
|
614 // --------------------------------------------------------------------------- |
|
615 // Finds service provider entry from spsettings |
|
616 // if service entry was not found, a new entry is created. |
|
617 // --------------------------------------------------------------------------- |
|
618 // |
|
619 EXPORT_C void CVccSPSettings::FindServiceEntryL( const TDesC& aServiceName, |
|
620 CSPEntry& aServiceEntry ) |
|
621 { |
|
622 RUBY_DEBUG_BLOCK( "CVccSPSettings::FindServiceEntryL" ); |
|
623 |
|
624 RUBY_DEBUG1( "-service name:[%S]",&aServiceName ); |
|
625 TInt error( KErrNone ); |
|
626 RIdArray serviceids; |
|
627 CleanupClosePushL( serviceids ); |
|
628 iSettings->FindServiceIdsL( serviceids ); |
|
629 |
|
630 TInt count = serviceids.Count(); |
|
631 RUBY_DEBUG1( "-serviceids count [%d]",count ); |
|
632 |
|
633 TBool foundEntry( EFalse ); |
|
634 |
|
635 for ( TInt i( 0 ); i < serviceids.Count() && !foundEntry; i++ ) |
|
636 { |
|
637 CSPProperty* property = CSPProperty::NewLC(); |
|
638 error = iSettings->FindPropertyL( serviceids[i], ESubPropertyVccVDI, *property ); |
|
639 |
|
640 if( error == KErrNone ) |
|
641 { |
|
642 RUBY_DEBUG0( "-service found" ); |
|
643 iSettings->FindEntryL( serviceids[i], aServiceEntry ); |
|
644 foundEntry = ETrue; |
|
645 } |
|
646 CleanupStack::PopAndDestroy( property ); |
|
647 } |
|
648 |
|
649 if( aServiceEntry.GetServiceId() == KVccZeroId && !foundEntry ) |
|
650 { |
|
651 RUBY_DEBUG0( "-no service found"); |
|
652 } |
|
653 |
|
654 CleanupStack::PopAndDestroy( &serviceids ); |
|
655 } |
|
656 |
|
657 // --------------------------------------------------------------------------- |
|
658 // Sets Voip service Id |
|
659 // --------------------------------------------------------------------------- |
|
660 // |
|
661 EXPORT_C void CVccSPSettings::SetVoipServiceIdL( const TDesC& aValue ) |
|
662 { |
|
663 RUBY_DEBUG1( "CVccSPSettings::SetVoipServiceIdL instance %x", this ); |
|
664 SetVoipServiceIdL( ConvertToIntL( aValue ) ); |
|
665 RUBY_DEBUG1( "SetVoipServiceId:[%d]",iVoipServiceId ); |
|
666 } |
|
667 |
|
668 // --------------------------------------------------------------------------- |
|
669 // Sets Voip service Id |
|
670 // --------------------------------------------------------------------------- |
|
671 // |
|
672 EXPORT_C void CVccSPSettings::SetVoipServiceIdL( TInt aValue ) |
|
673 { |
|
674 TBuf<KVccServiceIdLength> serviceIdString; |
|
675 serviceIdString.Num(aValue); |
|
676 |
|
677 if ( iVoipServiceIdString ) |
|
678 { |
|
679 delete iVoipServiceIdString; |
|
680 iVoipServiceIdString = NULL; |
|
681 } |
|
682 |
|
683 iVoipServiceIdString = serviceIdString.AllocL(); |
|
684 iVoipServiceId = aValue; |
|
685 |
|
686 RUBY_DEBUG1( "SetVoipServiceId:[%d]",iVoipServiceId ); |
|
687 } |
|
688 |
|
689 // --------------------------------------------------------------------------- |
|
690 // |
|
691 // --------------------------------------------------------------------------- |
|
692 // |
|
693 EXPORT_C TInt CVccSPSettings::FindPropertyL( TServiceId aServiceId, |
|
694 TServicePropertyName aPropertyName, |
|
695 CSPProperty& aProperty ) |
|
696 { |
|
697 RUBY_DEBUG_BLOCK( "CVccSPSettings::FindPropertyL" ); |
|
698 |
|
699 return iSettings->FindPropertyL( aServiceId, aPropertyName, aProperty ); |
|
700 } |
|
701 |
|
702 // --------------------------------------------------------------------------- |
|
703 // reads entry from sp settings |
|
704 // --------------------------------------------------------------------------- |
|
705 // |
|
706 EXPORT_C void CVccSPSettings::ReadSettingsL( const TDesC& aServiceName ) |
|
707 { |
|
708 RUBY_DEBUG_BLOCK( "ReadSettingsL" ); |
|
709 SetServiceNameL( aServiceName ); |
|
710 |
|
711 CSPEntry* entry = CSPEntry::NewLC(); |
|
712 |
|
713 RUBY_DEBUG1( "-service name:[%S]",iServiceName ); |
|
714 |
|
715 FindServiceEntryL( *iServiceName, *entry ); |
|
716 iServiceId = entry->GetServiceId(); |
|
717 |
|
718 RUBY_DEBUG0( "service found" ); |
|
719 |
|
720 RBuf val; |
|
721 val.CreateL( KSPMaxDesLength ); |
|
722 |
|
723 TInt err = GetPropertyValue( *entry, ESubPropertyVccPreferredDomain, val ); |
|
724 SetPreferredDomainL( val ); |
|
725 RUBY_DEBUG2( "iPreferredDomain = %S, err %d ", iPreferredDomain, err ); |
|
726 |
|
727 err = GetPropertyValue( *entry, ESubPropertyVccDtCstoPsAllowed, val ); |
|
728 SetDtCsToPsAllowedL( val ); |
|
729 RUBY_DEBUG2( "iDtCsToPsAllowed = %S, err %d ", iDtCsToPsAllowed, err ); |
|
730 |
|
731 err = GetPropertyValue( *entry, ESubPropertyVccDtPstoCsAllowed, val ); |
|
732 SetDtPsToCsAllowedL( val ); |
|
733 RUBY_DEBUG2( "iDtPsToCsAllowed = %S, err %d ", iDtPsToCsAllowed, err ); |
|
734 |
|
735 err = GetPropertyValue( *entry, ESubPropertyVccImmediateDomainTransfer, |
|
736 val ); |
|
737 SetImmediateDtL( val ); |
|
738 RUBY_DEBUG2( "iImmediateDt = %S, err %d ", iImmediateDt, err ); |
|
739 |
|
740 err = GetPropertyValue( *entry, ESubPropertyVccDtHeldWaitingCallsAllowed, |
|
741 val ); |
|
742 SetDtHeldWaitingCallsAllowedL( val ); |
|
743 RUBY_DEBUG2( "iDtHeldWaitingCallsAllowed = %S, err %d ", |
|
744 iDtHeldWaitingCallsAllowed, err ); |
|
745 |
|
746 err = GetPropertyValue( *entry, ESubPropertyVccDtCSHoTriggerLevel, val ); |
|
747 SetDtCsHoTresholdL( val ); |
|
748 RUBY_DEBUG2( "iDtCsHoTreshold = %S, err %d ", iDtCsHoTreshold, err ); |
|
749 |
|
750 err = GetPropertyValue( *entry, ESubPropertyVccDtCSHoHysteresis, |
|
751 val ); |
|
752 SetDtCsHoHysteresisL( val ); |
|
753 RUBY_DEBUG2( "iDtCsHoHysteresis = %S, err %d ", iDtCsHoHysteresis, err ); |
|
754 |
|
755 err = GetPropertyValue( *entry, ESubPropertyVccDtCSHoHysteresisTimerLow, |
|
756 val ); |
|
757 SetDtCsHoHysteresisTimerLowL( val ); |
|
758 RUBY_DEBUG2( "iDtCsHoHysteresisTimerLow = %S, err %d ", |
|
759 iDtCsHoHysteresisTimerLow, err ); |
|
760 |
|
761 err = GetPropertyValue( *entry, ESubPropertyVccDtCSHoHysteresisTimerHigh, |
|
762 val ); |
|
763 SetDtCsHoHysteresisTimerHighL( val ); |
|
764 RUBY_DEBUG2( "iDtCsHoHysteresisTimerHigh = %S, err %d ", |
|
765 iDtCsHoHysteresisTimerHigh, err ); |
|
766 |
|
767 err = GetPropertyValue( *entry, ESubPropertyVccDtWLANHoTriggerLevel, val ); |
|
768 SetDtWlanHoTresholdL( val ); |
|
769 RUBY_DEBUG2( "iDtWlanHoTreshold = %S, err %d ", iDtWlanHoTreshold, err ); |
|
770 |
|
771 err = GetPropertyValue( *entry, ESubPropertyVccDtWLANHoHysteresis, val ); |
|
772 SetDtWlanHoHysteresisL( val ); |
|
773 RUBY_DEBUG2( "iDtWlanHoHysteresis = %S, err %d ", iDtWlanHoHysteresis, err ); |
|
774 |
|
775 err = GetPropertyValue( *entry, ESubPropertyVccDtWLANHoHysteresisTimerLow, |
|
776 val ); |
|
777 SetDtWlanHoHysteresisTimerLowL( val ); |
|
778 RUBY_DEBUG2( "iDtWlanHoHysteresisTimerLow = %S, err %d ", |
|
779 iDtWlanHoHysteresisTimerLow, err ); |
|
780 |
|
781 err = GetPropertyValue( *entry, ESubPropertyVccDtWLANHoHysteresisTimerHigh, |
|
782 val ); |
|
783 SetDtWlanHoHysteresisTimerHighL( val ); |
|
784 RUBY_DEBUG2( "iDtWlanHoHysteresisTimerHigh = %S, err %d ", |
|
785 iDtWlanHoHysteresisTimerHigh, err ); |
|
786 |
|
787 err = GetPropertyValue( *entry, ESubPropertyVccDtVoipServiceId, val ); |
|
788 SetVoipServiceIdL( val ); |
|
789 RUBY_DEBUG2( "iVoipServiceId = %d, err0 %d ", iVoipServiceId, err ); |
|
790 |
|
791 err = GetPropertyValue( *entry, ESubPropertyVccDtAllowedWhenCsOriginated, val ); |
|
792 SetDtAllowedWhenCsOriginated( val ); |
|
793 RUBY_DEBUG2( "iDtAllowedWhenCsOriginated = %S, err %d ", |
|
794 iDtAllowedWhenCsOriginated, err ); |
|
795 |
|
796 val.Close(); |
|
797 CleanupStack::PopAndDestroy( entry ); |
|
798 } |
|
799 |
|
800 // --------------------------------------------------------------------------- |
|
801 // Return preferred domain |
|
802 // --------------------------------------------------------------------------- |
|
803 // |
|
804 EXPORT_C TInt CVccSPSettings::PreferredDomainL() |
|
805 { |
|
806 RUBY_DEBUG_BLOCK( "CVccSPSettings::PreferredDomainL" ); |
|
807 return ConvertToIntL( *iPreferredDomain ); |
|
808 } |
|
809 |
|
810 // --------------------------------------------------------------------------- |
|
811 // Return Immediate Dt |
|
812 // --------------------------------------------------------------------------- |
|
813 // |
|
814 EXPORT_C TInt CVccSPSettings::ImmediateDtL() |
|
815 { |
|
816 RUBY_DEBUG_BLOCK( "CVccSPSettings::ImmediateDtL" ); |
|
817 return ConvertToIntL( *iImmediateDt ); |
|
818 } |
|
819 |
|
820 // --------------------------------------------------------------------------- |
|
821 // |
|
822 // --------------------------------------------------------------------------- |
|
823 // |
|
824 EXPORT_C TInt CVccSPSettings::DtCsToPsAllowedL() |
|
825 { |
|
826 RUBY_DEBUG_BLOCK( "CVccSPSettings::DtCsToPsAllowedL" ); |
|
827 return ConvertToIntL( *iDtCsToPsAllowed ); |
|
828 } |
|
829 |
|
830 // --------------------------------------------------------------------------- |
|
831 // |
|
832 // --------------------------------------------------------------------------- |
|
833 // |
|
834 EXPORT_C TInt CVccSPSettings::DtPsToCsAllowedL() |
|
835 { |
|
836 RUBY_DEBUG_BLOCK( "CVccSPSettings::DtPsToCsAllowedL" ); |
|
837 return ConvertToIntL( *iDtPsToCsAllowed ); |
|
838 } |
|
839 |
|
840 // --------------------------------------------------------------------------- |
|
841 // |
|
842 // --------------------------------------------------------------------------- |
|
843 // |
|
844 EXPORT_C TInt CVccSPSettings::DtHeldWaitingCallsAllowedL() |
|
845 { |
|
846 RUBY_DEBUG_BLOCK( "CVccSPSettings::DtHeldWaitingCallsAllowedL" ); |
|
847 return ConvertToIntL( *iDtHeldWaitingCallsAllowed ); |
|
848 } |
|
849 |
|
850 // --------------------------------------------------------------------------- |
|
851 // |
|
852 // --------------------------------------------------------------------------- |
|
853 // |
|
854 EXPORT_C TInt CVccSPSettings::CsHoTresholdL() |
|
855 { |
|
856 return ConvertToIntL( *iDtCsHoTreshold ); |
|
857 } |
|
858 |
|
859 // --------------------------------------------------------------------------- |
|
860 // |
|
861 // --------------------------------------------------------------------------- |
|
862 // |
|
863 EXPORT_C TInt CVccSPSettings::CsHoHysteresisL() |
|
864 { |
|
865 RUBY_DEBUG_BLOCK( "CVccSPSettings::CsHoHysteresisL" ); |
|
866 return ConvertToIntL( *iDtCsHoHysteresis ); |
|
867 } |
|
868 |
|
869 // --------------------------------------------------------------------------- |
|
870 // |
|
871 // --------------------------------------------------------------------------- |
|
872 // |
|
873 EXPORT_C TInt CVccSPSettings::CsHoHysteresisTimerLowL() |
|
874 { |
|
875 RUBY_DEBUG_BLOCK( "CVccSPSettings::CsHoHysteresisTimerLowL" ); |
|
876 return ConvertToIntL( *iDtCsHoHysteresisTimerLow ); |
|
877 } |
|
878 // --------------------------------------------------------------------------- |
|
879 // |
|
880 // --------------------------------------------------------------------------- |
|
881 // |
|
882 EXPORT_C TInt CVccSPSettings::CsHoHysteresisTimerHighL() |
|
883 { |
|
884 RUBY_DEBUG_BLOCK( "CVccSPSettings::CsHoHysteresisTimerHighL" ); |
|
885 return ConvertToIntL( *iDtCsHoHysteresisTimerHigh ); |
|
886 } |
|
887 |
|
888 // --------------------------------------------------------------------------- |
|
889 // |
|
890 // --------------------------------------------------------------------------- |
|
891 // |
|
892 EXPORT_C TInt CVccSPSettings::PsHoTresholdL() |
|
893 { |
|
894 RUBY_DEBUG_BLOCK( "CVccSPSettings::PsHoTresholdL" ); |
|
895 return ConvertToIntL( *iDtWlanHoTreshold ); |
|
896 } |
|
897 |
|
898 // --------------------------------------------------------------------------- |
|
899 // |
|
900 // --------------------------------------------------------------------------- |
|
901 // |
|
902 EXPORT_C TInt CVccSPSettings::PsHoHysteresisL() |
|
903 { |
|
904 RUBY_DEBUG_BLOCK( "CVccSPSettings::PsHoHysteresisL" ); |
|
905 return ConvertToIntL( *iDtWlanHoHysteresis ); |
|
906 } |
|
907 |
|
908 // --------------------------------------------------------------------------- |
|
909 // |
|
910 // --------------------------------------------------------------------------- |
|
911 // |
|
912 EXPORT_C TInt CVccSPSettings::PsHoHysteresisTimerLowL() |
|
913 { |
|
914 RUBY_DEBUG_BLOCK( "CVccSPSettings::PsHoHysteresisTimerLowL" ); |
|
915 return ConvertToIntL( *iDtWlanHoHysteresisTimerLow ); |
|
916 } |
|
917 // --------------------------------------------------------------------------- |
|
918 // |
|
919 // --------------------------------------------------------------------------- |
|
920 // |
|
921 EXPORT_C TInt CVccSPSettings::PsHoHysteresisTimerHighL() |
|
922 { |
|
923 return ConvertToIntL( *iDtWlanHoHysteresisTimerHigh ); |
|
924 } |
|
925 |
|
926 // --------------------------------------------------------------------------- |
|
927 // |
|
928 // --------------------------------------------------------------------------- |
|
929 // |
|
930 EXPORT_C TInt CVccSPSettings::VoipServiceId() |
|
931 { |
|
932 return iVoipServiceId; |
|
933 } |
|
934 |
|
935 // --------------------------------------------------------------------------- |
|
936 // |
|
937 // --------------------------------------------------------------------------- |
|
938 // |
|
939 EXPORT_C TInt CVccSPSettings::DtAllowedWhenCsOriginatedL() |
|
940 { |
|
941 return ConvertToIntL( *iDtAllowedWhenCsOriginated ); |
|
942 } |
|
943 |
|
944 // --------------------------------------------------------------------------- |
|
945 // |
|
946 // --------------------------------------------------------------------------- |
|
947 // |
|
948 EXPORT_C void CVccSPSettings::SetDtAllowedWhenCsOriginated( const TDesC& aValue ) |
|
949 { |
|
950 RUBY_DEBUG_BLOCK( "CVccSPSettings::SetDtAllowedWhenCsOriginated" ); |
|
951 if ( iDtAllowedWhenCsOriginated ) |
|
952 { |
|
953 delete iDtAllowedWhenCsOriginated; |
|
954 iDtAllowedWhenCsOriginated = NULL; |
|
955 } |
|
956 TRAP_IGNORE( iDtAllowedWhenCsOriginated = aValue.AllocL() ); |
|
957 } |
|
958 // --------------------------------------------------------------------------- |
|
959 // |
|
960 // --------------------------------------------------------------------------- |
|
961 // |
|
962 void CVccSPSettings::AddOrUpdatePropertyL( CSPEntry& aServiceEntry, |
|
963 const TServicePropertyName aName, TInt aValue ) |
|
964 { |
|
965 |
|
966 TInt err = aServiceEntry.UpdateProperty( aName, aValue ); |
|
967 |
|
968 //add new to entry |
|
969 if( err == KErrNotFound ) |
|
970 { |
|
971 CSPProperty* property = CSPProperty::NewLC(); |
|
972 property->SetName( aName ); |
|
973 property->SetValue( aValue ); |
|
974 aServiceEntry.AddPropertyL( *property ); |
|
975 CleanupStack::PopAndDestroy( property ); |
|
976 } |
|
977 } |
|
978 |
|
979 // --------------------------------------------------------------------------- |
|
980 // Update old property of add new property to the service entry |
|
981 // --------------------------------------------------------------------------- |
|
982 // |
|
983 void CVccSPSettings::AddOrUpdatePropertyL( CSPEntry& aServiceEntry, |
|
984 const TServicePropertyName aName, const TDesC& aValue ) |
|
985 { |
|
986 TInt err = aServiceEntry.UpdateProperty( aName, aValue ); |
|
987 |
|
988 //add new to entry |
|
989 if( err == KErrNotFound ) |
|
990 { |
|
991 CSPProperty* property = CSPProperty::NewLC(); |
|
992 property->SetName( aName ); |
|
993 property->SetValue( aValue ); |
|
994 aServiceEntry.AddPropertyL( *property ); |
|
995 CleanupStack::PopAndDestroy( property ); |
|
996 } |
|
997 } |
|
998 |
|
999 // --------------------------------------------------------------------------- |
|
1000 // Try to get the value of property as integer |
|
1001 // --------------------------------------------------------------------------- |
|
1002 // |
|
1003 TInt CVccSPSettings::GetPropertyValue( CSPEntry& aServiceEntry, |
|
1004 const TServicePropertyName& aPropertyName, |
|
1005 TInt& aValue ) |
|
1006 { |
|
1007 RUBY_DEBUG_BLOCK( "GetPropertyValue" ); |
|
1008 |
|
1009 const CSPProperty* property = NULL; |
|
1010 TInt err = aServiceEntry.GetProperty( property, aPropertyName ); |
|
1011 if( property != NULL ) |
|
1012 err = property->GetValue( aValue ) ; |
|
1013 |
|
1014 return err; |
|
1015 } |
|
1016 |
|
1017 // --------------------------------------------------------------------------- |
|
1018 // Try to get the value of property as integer |
|
1019 // --------------------------------------------------------------------------- |
|
1020 // |
|
1021 TInt CVccSPSettings::GetPropertyValue( CSPEntry& aServiceEntry, |
|
1022 const TServicePropertyName& aPropertyName, |
|
1023 TDes& aValue ) |
|
1024 { |
|
1025 RUBY_DEBUG_BLOCK( "GetPropertyValue" ); |
|
1026 |
|
1027 const CSPProperty* property = NULL; |
|
1028 TInt err = aServiceEntry.GetProperty( property, aPropertyName ); |
|
1029 |
|
1030 if( property != NULL ) |
|
1031 { |
|
1032 err = property->GetValue( aValue ) ; |
|
1033 } |
|
1034 else |
|
1035 { |
|
1036 TBuf<1> zero(_L("0")); |
|
1037 aValue.Copy( zero ); |
|
1038 } |
|
1039 |
|
1040 return err; |
|
1041 } |
|
1042 |
|
1043 // --------------------------------------------------------------------------- |
|
1044 // |
|
1045 // --------------------------------------------------------------------------- |
|
1046 // |
|
1047 void CVccSPSettings::ModifyVoipProfileL() |
|
1048 { |
|
1049 //Change callprovider plugin uid in VoIP setting |
|
1050 CSPEntry* voipEntry = CSPEntry::NewLC(); |
|
1051 TRAPD( e, iSettings->FindEntryL( iVoipServiceId, *voipEntry ) ); |
|
1052 |
|
1053 if (e == KErrNone) |
|
1054 { |
|
1055 RUBY_DEBUG0( "voip service found" ); |
|
1056 |
|
1057 const CSPProperty* property = NULL; |
|
1058 TInt err = voipEntry->GetProperty( property, |
|
1059 EPropertyServiceAttributeMask ); |
|
1060 |
|
1061 if( property != NULL ) |
|
1062 { |
|
1063 TInt mask; |
|
1064 err = property->GetValue( mask ) ; |
|
1065 RUBY_DEBUG1( "voip service mask %d", mask ); |
|
1066 |
|
1067 mask = mask | EBootstrapCallProvider; |
|
1068 RUBY_DEBUG1( "voip service mask after mod %d", mask ); |
|
1069 voipEntry->UpdateProperty(EPropertyServiceAttributeMask, mask ); |
|
1070 voipEntry->UpdateProperty(EPropertyCallProviderPluginId, KVccCallProviderPlugId ); |
|
1071 |
|
1072 // Update entry |
|
1073 iSettings->UpdateEntryL(*voipEntry); |
|
1074 |
|
1075 RUBY_DEBUG0( "voip service updated" ); |
|
1076 } |
|
1077 } |
|
1078 CleanupStack::PopAndDestroy( voipEntry ); |
|
1079 } |