|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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 the License "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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <e32svr.h> |
|
23 #include <StifParser.h> |
|
24 #include <Stiftestinterface.h> |
|
25 #include <f32file.h> |
|
26 #include <hal.h> |
|
27 #include <liwcommon.h> |
|
28 #include <LiwServiceHandler.h> |
|
29 |
|
30 #include "tsysinfoprovidertests.h" |
|
31 #include "entitykeys.h" |
|
32 #include "sysinfoaiwparams.hrh" |
|
33 #include "tuseractivitynotifier.h" |
|
34 #include "serviceerrno.h" |
|
35 |
|
36 using namespace LIW ; |
|
37 using namespace SysInfo; |
|
38 using namespace sysinfoaiwparams; |
|
39 |
|
40 _LIT(KROMInstallDir,"\\system\\install\\"); |
|
41 _LIT(KS60ProductIdFile,"Series60v*.sis"); |
|
42 |
|
43 // ============================ MEMBER FUNCTIONS =============================== |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // Ctsysinfoprovidertests::Delete |
|
47 // Delete here all resources allocated and opened from test methods. |
|
48 // Called from destructor. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void Ctsysinfoprovidertests::Delete() |
|
52 { |
|
53 if( iInterface ) |
|
54 { |
|
55 iInterface->Close(); |
|
56 } |
|
57 if(iServiceHandler) |
|
58 delete iServiceHandler ; |
|
59 |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // Ctsysinfoprovidertests::RunMethodL |
|
64 // Run specified method. Contains also table of test mothods and their names. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 TInt Ctsysinfoprovidertests::RunMethodL( |
|
68 CStifItemParser& aItem ) |
|
69 { |
|
70 |
|
71 static TStifFunctionInfo const KFunctions[] = |
|
72 { |
|
73 ENTRY( "VibraStatus", Ctsysinfoprovidertests::VibraStatus), |
|
74 ENTRY( "VibraSync", Ctsysinfoprovidertests::VibraSync), |
|
75 ENTRY( "VibraStatus1", Ctsysinfoprovidertests::VibraStatus1), |
|
76 |
|
77 ENTRY( "SetVibraInvalidParamSysDataList", Ctsysinfoprovidertests::SetVibraInvalidParamSysDataList), |
|
78 ENTRY( "SetVibraInvalidParamSysData", Ctsysinfoprovidertests::SetVibraInvalidParamSysData), |
|
79 ENTRY( "SetVibraInvalidParamEntity", Ctsysinfoprovidertests::SetVibraInvalidParamEntity), |
|
80 ENTRY( "SetVibraInvalidParamKey", Ctsysinfoprovidertests::SetVibraInvalidParamKey), |
|
81 |
|
82 ENTRY( "VibraParamMissingEntity", Ctsysinfoprovidertests::VibraParamMissingEntity), |
|
83 ENTRY( "VibraParamMissingKey", Ctsysinfoprovidertests::VibraParamMissingKey), |
|
84 ENTRY( "VibraParamMissingSysData", Ctsysinfoprovidertests::VibraParamMissingSysData), |
|
85 ENTRY( "VibraParamMissingEntityPos", Ctsysinfoprovidertests::VibraParamMissingEntityPos), |
|
86 ENTRY( "VibraParamMissingKeyPos", Ctsysinfoprovidertests::VibraParamMissingKeyPos), |
|
87 ENTRY( "VibraParamMissingSysDataPos", Ctsysinfoprovidertests::VibraParamMissingSysDataPos), |
|
88 |
|
89 ENTRY( "WrongInterfaceName", Ctsysinfoprovidertests::WrongInterfaceName), |
|
90 ENTRY( "LoadingInterfaceMultipletime", Ctsysinfoprovidertests::LoadingInterfaceMultipletime), |
|
91 ENTRY( "VibraInvalidCommand", Ctsysinfoprovidertests::VibraInvalidCommand), |
|
92 |
|
93 ENTRY( "BtNotifyCancel", Ctsysinfoprovidertests::BtNotifyCancel), |
|
94 ENTRY( "ActiveConnectionMissingCallback", Ctsysinfoprovidertests::ActiveConnectionMissingCallback), |
|
95 ENTRY( "ActiveConnReqCancelMissingTransId", Ctsysinfoprovidertests::ActiveConnReqCancelMissingTransId), |
|
96 |
|
97 ENTRY( "SupportedLang", Ctsysinfoprovidertests::SupportedLang), |
|
98 |
|
99 //input validation tests |
|
100 ENTRY( "SetDisplayLang", Ctsysinfoprovidertests::SetDisplayLang), |
|
101 ENTRY( "SetInputLang", Ctsysinfoprovidertests::SetInputLang), |
|
102 ENTRY( "SetPredictiveText", Ctsysinfoprovidertests::SetPredictiveText), |
|
103 ENTRY( "SetVibra", Ctsysinfoprovidertests::SetVibra), |
|
104 ENTRY( "SetBluetoothStatus", Ctsysinfoprovidertests::SetBluetoothStatus), |
|
105 ENTRY( "SetInfraredStatus", Ctsysinfoprovidertests::SetInfraredStatus), |
|
106 ENTRY( "SetBrigthness", Ctsysinfoprovidertests::SetBrigthness), |
|
107 ENTRY( "SetScreenSaverTimeout", Ctsysinfoprovidertests::SetScreenSaverTimeout), |
|
108 ENTRY( "SetKeyGuardTimeout", Ctsysinfoprovidertests::SetKeyGuardTimeout), |
|
109 ENTRY( "SetAutoLockTimeout", Ctsysinfoprovidertests::SetAutoLockTimeout), |
|
110 ENTRY( "SetWallpaper", Ctsysinfoprovidertests::SetWallpaper), |
|
111 ENTRY( "SetLightTimeOut", Ctsysinfoprovidertests::SetLightTimeOut), |
|
112 ENTRY( "GetDriveInfoL", Ctsysinfoprovidertests::GetDriveInfoL), |
|
113 ENTRY( "UserInactivityNotify", Ctsysinfoprovidertests::UserInactivityNotify), |
|
114 |
|
115 }; |
|
116 |
|
117 const TInt count = sizeof( KFunctions ) / |
|
118 sizeof( TStifFunctionInfo ); |
|
119 |
|
120 return RunInternalL( KFunctions, count, aItem ); |
|
121 |
|
122 } |
|
123 |
|
124 void Ctsysinfoprovidertests::Init() |
|
125 { |
|
126 iServiceHandler = CLiwServiceHandler::NewL(); |
|
127 iInparam = &(iServiceHandler->InParamListL()); |
|
128 iOutparam = &(iServiceHandler->OutParamListL()); |
|
129 |
|
130 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
131 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
132 |
|
133 RCriteriaArray a; |
|
134 a.AppendL(crit); |
|
135 |
|
136 iServiceHandler->AttachL(a); |
|
137 |
|
138 iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam); |
|
139 |
|
140 delete crit; |
|
141 a.Reset(); |
|
142 |
|
143 TInt pos = 0; |
|
144 |
|
145 iOutparam->FindFirst( pos, KIDataSource ); |
|
146 if(pos != KErrNotFound) |
|
147 { |
|
148 //getting the iInterface handle |
|
149 iInterface = (*iOutparam)[pos].Value().AsInterface(); |
|
150 } |
|
151 |
|
152 iOutparam->Reset(); |
|
153 iInparam->Reset(); |
|
154 } |
|
155 |
|
156 |
|
157 // End of File |
|
158 |
|
159 // ----------------------------------------------------------------------------- |
|
160 // Ctsysinfoprovidertests::SetVibraInvalidParams1 |
|
161 // Input SysData as List(instead of map) |
|
162 // ----------------------------------------------------------------------------- |
|
163 // |
|
164 TInt Ctsysinfoprovidertests::SetVibraInvalidParamSysDataList(CStifItemParser& /*aItem*/) |
|
165 { |
|
166 |
|
167 TInt result =KErrNone; |
|
168 |
|
169 _LIT( KExample, "SupportedLang:" ); |
|
170 iLog->Log( KExample ); |
|
171 TInt pos = 0 ; |
|
172 |
|
173 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
174 |
|
175 Init(); |
|
176 __UHEAP_MARK; |
|
177 |
|
178 TLiwGenericParam entity; |
|
179 TLiwVariant entityname; |
|
180 TLiwGenericParam key; |
|
181 TLiwVariant keyname; |
|
182 |
|
183 entityname.Set(KGeneral); |
|
184 entity.SetNameAndValueL(KEntity,entityname); |
|
185 |
|
186 keyname.Set(KVibraActive); |
|
187 key.SetNameAndValueL(KKey,keyname); |
|
188 |
|
189 //sysdata as map |
|
190 CLiwList* list = CLiwDefaultList::NewL(); |
|
191 CleanupStack::PushL(list); |
|
192 |
|
193 TLiwVariant sysdata((TInt32)1); |
|
194 list->AppendL(sysdata); |
|
195 sysdata.Reset(); |
|
196 |
|
197 |
|
198 TLiwVariant sysparam(list); |
|
199 TLiwGenericParam element ; |
|
200 element.SetNameAndValueL(KSysData,sysparam); |
|
201 sysparam.Reset(); |
|
202 |
|
203 iInparam->AppendL(entity); |
|
204 |
|
205 iInparam->AppendL(key); |
|
206 iInparam->AppendL(element); |
|
207 |
|
208 element.Reset(); |
|
209 |
|
210 list->DecRef(); |
|
211 CleanupStack::Pop(list); |
|
212 |
|
213 entity.Reset(); |
|
214 entityname.Reset(); |
|
215 key.Reset(); |
|
216 keyname.Reset(); |
|
217 sysdata.Reset(); |
|
218 |
|
219 //get supported language list |
|
220 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
221 result = err; |
|
222 if(err == SErrNone) |
|
223 { |
|
224 const TLiwGenericParam* output = iOutparam->FindFirst( pos,KErrorCode ); |
|
225 result = output->Value().AsTInt32(); |
|
226 if(result == SErrBadArgumentType) |
|
227 { |
|
228 result = 0; |
|
229 } |
|
230 else |
|
231 { |
|
232 result = -1; |
|
233 } |
|
234 } |
|
235 iOutparam->Reset(); |
|
236 iInparam->Reset(); |
|
237 |
|
238 __UHEAP_MARKEND; |
|
239 return result; |
|
240 |
|
241 } |
|
242 |
|
243 // ----------------------------------------------------------------------------- |
|
244 // Ctsysinfoprovidertests::SetVibraInvalidParams2 |
|
245 // Input SysData contains a string value instead of int |
|
246 // ----------------------------------------------------------------------------- |
|
247 // |
|
248 TInt Ctsysinfoprovidertests::SetVibraInvalidParamSysData(CStifItemParser& /*aItem*/) |
|
249 { |
|
250 |
|
251 TInt result =KErrNone; |
|
252 |
|
253 _LIT( KExample, "SupportedLang:" ); |
|
254 iLog->Log( KExample ); |
|
255 TInt pos =0; |
|
256 |
|
257 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
258 |
|
259 Init(); |
|
260 |
|
261 __UHEAP_MARK; |
|
262 |
|
263 TLiwGenericParam entity; |
|
264 TLiwVariant entityname; |
|
265 TLiwGenericParam key; |
|
266 TLiwVariant keyname; |
|
267 |
|
268 entityname.Set(KGeneral); |
|
269 entity.SetNameAndValueL(KEntity,entityname); |
|
270 |
|
271 keyname.Set(KVibraActive); |
|
272 key.SetNameAndValueL(KKey,keyname); |
|
273 |
|
274 //sysdata as map |
|
275 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
276 CleanupStack::PushL(map); |
|
277 |
|
278 TLiwVariant sysdata(KGeneral); |
|
279 map->InsertL(KStatus,sysdata); |
|
280 sysdata.Reset(); |
|
281 |
|
282 |
|
283 TLiwVariant sysparam(map); |
|
284 TLiwGenericParam element ; |
|
285 element.SetNameAndValueL(KSysData,sysparam); |
|
286 sysparam.Reset(); |
|
287 |
|
288 iInparam->AppendL(entity); |
|
289 |
|
290 iInparam->AppendL(key); |
|
291 iInparam->AppendL(element); |
|
292 |
|
293 element.Reset(); |
|
294 |
|
295 map->DecRef(); |
|
296 CleanupStack::Pop(map); |
|
297 |
|
298 entity.Reset(); |
|
299 entityname.Reset(); |
|
300 key.Reset(); |
|
301 keyname.Reset(); |
|
302 sysdata.Reset(); |
|
303 |
|
304 //get supported language list |
|
305 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
306 result = err; |
|
307 if(err == SErrNone) |
|
308 { |
|
309 iOutparam->FindFirst( pos, KErrorCode ); |
|
310 if(pos != KErrNotFound) |
|
311 { |
|
312 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
313 } |
|
314 if(result == SErrBadArgumentType) |
|
315 { |
|
316 result = 0; |
|
317 } |
|
318 else |
|
319 { |
|
320 result = -1; |
|
321 } |
|
322 } |
|
323 iOutparam->Reset(); |
|
324 iInparam->Reset(); |
|
325 |
|
326 // iInterface->Close(); |
|
327 // iInterface = NULL ; |
|
328 |
|
329 __UHEAP_MARKEND; |
|
330 return result; |
|
331 |
|
332 } |
|
333 |
|
334 // ----------------------------------------------------------------------------- |
|
335 // Ctsysinfoprovidertests::SetVibraInvalidParamEntity |
|
336 // Entity as a int instead of string |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 TInt Ctsysinfoprovidertests::SetVibraInvalidParamEntity(CStifItemParser& /*aItem*/) |
|
340 { |
|
341 |
|
342 TInt result =KErrNone; |
|
343 |
|
344 _LIT( KExample, "SupportedLang:" ); |
|
345 iLog->Log( KExample ); |
|
346 TInt pos = 0; |
|
347 |
|
348 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
349 |
|
350 Init(); |
|
351 __UHEAP_MARK; |
|
352 |
|
353 TLiwGenericParam entity; |
|
354 TLiwVariant entityname; |
|
355 TLiwGenericParam key; |
|
356 TLiwVariant keyname; |
|
357 |
|
358 entityname.Set(1); |
|
359 entity.SetNameAndValueL(KEntity,entityname); |
|
360 |
|
361 keyname.Set(KVibraActive); |
|
362 key.SetNameAndValueL(KKey,keyname); |
|
363 |
|
364 //sysdata as map |
|
365 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
366 CleanupStack::PushL(map); |
|
367 |
|
368 TLiwVariant sysdata((TInt32)1); |
|
369 map->InsertL(KStatus,sysdata); |
|
370 sysdata.Reset(); |
|
371 |
|
372 |
|
373 TLiwVariant sysparam(map); |
|
374 TLiwGenericParam element ; |
|
375 element.SetNameAndValueL(KSysData,sysparam); |
|
376 sysparam.Reset(); |
|
377 |
|
378 iInparam->AppendL(entity); |
|
379 |
|
380 iInparam->AppendL(key); |
|
381 iInparam->AppendL(element); |
|
382 |
|
383 element.Reset(); |
|
384 |
|
385 map->DecRef(); |
|
386 CleanupStack::Pop(map); |
|
387 |
|
388 entity.Reset(); |
|
389 entityname.Reset(); |
|
390 key.Reset(); |
|
391 keyname.Reset(); |
|
392 sysdata.Reset(); |
|
393 |
|
394 //get supported language list |
|
395 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
396 result = err; |
|
397 if(err == SErrNone) |
|
398 { |
|
399 iOutparam->FindFirst( pos, KErrorCode ); |
|
400 if(pos != KErrNotFound) |
|
401 { |
|
402 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
403 } |
|
404 if(result == SErrNotFound) |
|
405 { |
|
406 result = 0; |
|
407 } |
|
408 else |
|
409 { |
|
410 result = -1; |
|
411 } |
|
412 } |
|
413 iOutparam->Reset(); |
|
414 iInparam->Reset(); |
|
415 |
|
416 __UHEAP_MARKEND; |
|
417 return result; |
|
418 |
|
419 } |
|
420 |
|
421 // ----------------------------------------------------------------------------- |
|
422 // Ctsysinfoprovidertests::SetVibraInvalidParamKey |
|
423 // Key as a int instead of string |
|
424 // ----------------------------------------------------------------------------- |
|
425 // |
|
426 TInt Ctsysinfoprovidertests::SetVibraInvalidParamKey(CStifItemParser& /*aItem*/) |
|
427 { |
|
428 |
|
429 TInt result =KErrNone; |
|
430 |
|
431 _LIT( KExample, "SupportedLang:" ); |
|
432 iLog->Log( KExample ); |
|
433 TInt pos = 0; |
|
434 |
|
435 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
436 |
|
437 Init(); |
|
438 __UHEAP_MARK; |
|
439 |
|
440 TLiwGenericParam entity; |
|
441 TLiwVariant entityname; |
|
442 TLiwGenericParam key; |
|
443 TLiwVariant keyname; |
|
444 |
|
445 entityname.Set(KGeneral); |
|
446 entity.SetNameAndValueL(KEntity,entityname); |
|
447 |
|
448 keyname.Set(1); |
|
449 key.SetNameAndValueL(KKey,keyname); |
|
450 |
|
451 //sysdata as map |
|
452 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
453 CleanupStack::PushL(map); |
|
454 |
|
455 TLiwVariant sysdata((TInt32)1); |
|
456 map->InsertL(KStatus,sysdata); |
|
457 sysdata.Reset(); |
|
458 |
|
459 |
|
460 TLiwVariant sysparam(map); |
|
461 TLiwGenericParam element ; |
|
462 element.SetNameAndValueL(KSysData,sysparam); |
|
463 sysparam.Reset(); |
|
464 |
|
465 iInparam->AppendL(entity); |
|
466 |
|
467 iInparam->AppendL(key); |
|
468 iInparam->AppendL(element); |
|
469 |
|
470 element.Reset(); |
|
471 |
|
472 map->DecRef(); |
|
473 CleanupStack::Pop(map); |
|
474 |
|
475 entity.Reset(); |
|
476 entityname.Reset(); |
|
477 key.Reset(); |
|
478 keyname.Reset(); |
|
479 sysdata.Reset(); |
|
480 |
|
481 //get supported language list |
|
482 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
483 result = err; |
|
484 if(err == SErrNone) |
|
485 { |
|
486 iOutparam->FindFirst( pos, KErrorCode ); |
|
487 if(pos != KErrNotFound) |
|
488 { |
|
489 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
490 } |
|
491 if(result != SErrBadArgumentType) |
|
492 { |
|
493 result = 0; |
|
494 } |
|
495 else |
|
496 { |
|
497 result = -1; |
|
498 } |
|
499 } |
|
500 iOutparam->Reset(); |
|
501 iInparam->Reset(); |
|
502 |
|
503 __UHEAP_MARKEND; |
|
504 return result; |
|
505 |
|
506 } |
|
507 |
|
508 |
|
509 |
|
510 // ----------------------------------------------------------------------------- |
|
511 // Ctsysinfoprovidertests::VibraParamMissingEntity |
|
512 // without Entity Key(name based parsing). |
|
513 // ----------------------------------------------------------------------------- |
|
514 // |
|
515 TInt Ctsysinfoprovidertests::VibraParamMissingEntity( CStifItemParser& /*aItem*/ ) |
|
516 { |
|
517 TInt result =KErrNone; |
|
518 |
|
519 _LIT( KExample, "SupportedLang:" ); |
|
520 iLog->Log( KExample ); |
|
521 TInt pos = 0; |
|
522 |
|
523 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
524 |
|
525 Init(); |
|
526 __UHEAP_MARK; |
|
527 |
|
528 // TLiwGenericParam entity; |
|
529 // TLiwVariant entityname; |
|
530 TLiwGenericParam key; |
|
531 TLiwVariant keyname; |
|
532 |
|
533 // entityname.Set(KGeneral); |
|
534 // entity.SetNameAndValueL(KEntity,entityname); |
|
535 |
|
536 keyname.Set(KVibraActive); |
|
537 key.SetNameAndValueL(KKey,keyname); |
|
538 |
|
539 //sysdata as map |
|
540 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
541 CleanupStack::PushL(map); |
|
542 |
|
543 TLiwVariant sysdata((TInt32)1); |
|
544 map->InsertL(KStatus,sysdata); |
|
545 sysdata.Reset(); |
|
546 |
|
547 TLiwVariant sysparam(map); |
|
548 TLiwGenericParam element ; |
|
549 element.SetNameAndValueL(KSysData,sysparam); |
|
550 sysparam.Reset(); |
|
551 |
|
552 // iInparam->AppendL(entity); |
|
553 |
|
554 iInparam->AppendL(key); |
|
555 iInparam->AppendL(element); |
|
556 |
|
557 element.Reset(); |
|
558 |
|
559 map->DecRef(); |
|
560 CleanupStack::Pop(map); |
|
561 |
|
562 // entity.Reset(); |
|
563 // entityname.Reset(); |
|
564 key.Reset(); |
|
565 keyname.Reset(); |
|
566 sysdata.Reset(); |
|
567 |
|
568 //Set Vibra |
|
569 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
570 result = err; |
|
571 if(err == KErrNone) |
|
572 { |
|
573 iOutparam->FindFirst( pos, KErrorCode ); |
|
574 if(pos != KErrNotFound) |
|
575 { |
|
576 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
577 } |
|
578 if(result == SErrMissingArgument) |
|
579 { |
|
580 result = 0; |
|
581 } |
|
582 else |
|
583 { |
|
584 result = -1; |
|
585 } |
|
586 } |
|
587 iOutparam->Reset(); |
|
588 iInparam->Reset(); |
|
589 |
|
590 __UHEAP_MARKEND; |
|
591 return result; |
|
592 |
|
593 } |
|
594 |
|
595 // ----------------------------------------------------------------------------- |
|
596 // Ctsysinfoprovidertests::VibraParamMissingKey |
|
597 // without Key (name based parsing). |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 TInt Ctsysinfoprovidertests::VibraParamMissingKey( CStifItemParser& /*aItem*/ ) |
|
601 { |
|
602 TInt result =KErrNone; |
|
603 |
|
604 _LIT( KExample, "SupportedLang:" ); |
|
605 iLog->Log( KExample ); |
|
606 TInt pos = 0; |
|
607 |
|
608 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
609 |
|
610 Init(); |
|
611 __UHEAP_MARK; |
|
612 |
|
613 TLiwGenericParam entity; |
|
614 TLiwVariant entityname; |
|
615 // TLiwGenericParam key; |
|
616 // TLiwVariant keyname; |
|
617 |
|
618 entityname.Set(KGeneral); |
|
619 entity.SetNameAndValueL(KEntity,entityname); |
|
620 |
|
621 // keyname.Set(KVibraActive); |
|
622 // key.SetNameAndValueL(KKey,keyname); |
|
623 |
|
624 //sysdata as map |
|
625 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
626 CleanupStack::PushL(map); |
|
627 |
|
628 TLiwVariant sysdata((TInt32)1); |
|
629 map->InsertL(KStatus,sysdata); |
|
630 sysdata.Reset(); |
|
631 |
|
632 TLiwVariant sysparam(map); |
|
633 TLiwGenericParam element ; |
|
634 element.SetNameAndValueL(KSysData,sysparam); |
|
635 sysparam.Reset(); |
|
636 |
|
637 iInparam->AppendL(entity); |
|
638 |
|
639 // iInparam->AppendL(key); |
|
640 iInparam->AppendL(element); |
|
641 |
|
642 element.Reset(); |
|
643 |
|
644 map->DecRef(); |
|
645 CleanupStack::Pop(map); |
|
646 |
|
647 entity.Reset(); |
|
648 entityname.Reset(); |
|
649 // key.Reset(); |
|
650 // keyname.Reset(); |
|
651 sysdata.Reset(); |
|
652 |
|
653 //Set Vibra |
|
654 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
655 result = err; |
|
656 if(err == KErrNone) |
|
657 { |
|
658 iOutparam->FindFirst( pos, KErrorCode ); |
|
659 if(pos != KErrNotFound) |
|
660 { |
|
661 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
662 } |
|
663 if(result == SErrMissingArgument) |
|
664 { |
|
665 result = 0; |
|
666 } |
|
667 else |
|
668 { |
|
669 result = -1; |
|
670 } |
|
671 } |
|
672 iOutparam->Reset(); |
|
673 iInparam->Reset(); |
|
674 |
|
675 __UHEAP_MARKEND; |
|
676 return result; |
|
677 |
|
678 } |
|
679 |
|
680 // ----------------------------------------------------------------------------- |
|
681 // Ctsysinfoprovidertests::VibraParamMissingSysData |
|
682 // without Input SysData for setInfo (name based parsing). |
|
683 // ----------------------------------------------------------------------------- |
|
684 // |
|
685 TInt Ctsysinfoprovidertests::VibraParamMissingSysData( CStifItemParser& /*aItem*/ ) |
|
686 { |
|
687 TInt result =KErrNone; |
|
688 |
|
689 _LIT( KExample, "SupportedLang:" ); |
|
690 iLog->Log( KExample ); |
|
691 TInt pos = 0; |
|
692 |
|
693 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
694 |
|
695 Init(); |
|
696 __UHEAP_MARK; |
|
697 |
|
698 TLiwGenericParam entity; |
|
699 TLiwVariant entityname; |
|
700 TLiwGenericParam key; |
|
701 TLiwVariant keyname; |
|
702 |
|
703 entityname.Set(KGeneral); |
|
704 entity.SetNameAndValueL(KEntity,entityname); |
|
705 |
|
706 keyname.Set(KVibraActive); |
|
707 key.SetNameAndValueL(KKey,keyname); |
|
708 |
|
709 //sysdata as map |
|
710 // CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
711 // CleanupStack::PushL(map); |
|
712 |
|
713 // TLiwVariant sysdata(1); |
|
714 // map->InsertL(KStatus,sysdata); |
|
715 // sysdata.Reset(); |
|
716 |
|
717 // TLiwVariant sysparam(map); |
|
718 // TLiwGenericParam element ; |
|
719 // element.SetNameAndValueL(KSysData,sysparam); |
|
720 // sysparam.Reset(); |
|
721 |
|
722 iInparam->AppendL(entity); |
|
723 |
|
724 iInparam->AppendL(key); |
|
725 // iInparam->AppendL(element); |
|
726 |
|
727 // element.Reset(); |
|
728 |
|
729 // map->DecRef(); |
|
730 // CleanupStack::Pop(map); |
|
731 |
|
732 entity.Reset(); |
|
733 entityname.Reset(); |
|
734 key.Reset(); |
|
735 keyname.Reset(); |
|
736 // sysdata.Reset(); |
|
737 |
|
738 //Set Vibra |
|
739 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
740 result = err; |
|
741 if(err == KErrNone) |
|
742 { |
|
743 iOutparam->FindFirst( pos, KErrorCode ); |
|
744 if(pos != KErrNotFound) |
|
745 { |
|
746 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
747 } |
|
748 if(result == SErrMissingArgument) |
|
749 { |
|
750 result = 0; |
|
751 } |
|
752 else |
|
753 { |
|
754 result = -1; |
|
755 } |
|
756 } |
|
757 iOutparam->Reset(); |
|
758 iInparam->Reset(); |
|
759 |
|
760 __UHEAP_MARKEND; |
|
761 return result; |
|
762 |
|
763 } |
|
764 |
|
765 // ----------------------------------------------------------------------------- |
|
766 // Ctsysinfoprovidertests::VibraParamMissingEntityPos |
|
767 // without Entity Key(Position based parsing). |
|
768 // ----------------------------------------------------------------------------- |
|
769 // |
|
770 TInt Ctsysinfoprovidertests::VibraParamMissingEntityPos( CStifItemParser& /*aItem*/ ) |
|
771 { |
|
772 TInt result =KErrNone; |
|
773 |
|
774 _LIT( KExample, "SupportedLang:" ); |
|
775 iLog->Log( KExample ); |
|
776 TInt pos = 0; |
|
777 |
|
778 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
779 |
|
780 Init(); |
|
781 __UHEAP_MARK; |
|
782 |
|
783 // TLiwGenericParam entity; |
|
784 // TLiwVariant entityname; |
|
785 TLiwGenericParam key; |
|
786 TLiwVariant keyname; |
|
787 |
|
788 // entityname.Set(KGeneral); |
|
789 // entity.SetNameAndValueL(KEntity,entityname); |
|
790 |
|
791 keyname.Set(KVibraActive); |
|
792 key.SetNameAndValueL(KNullDesC8,keyname); |
|
793 |
|
794 //sysdata as map |
|
795 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
796 CleanupStack::PushL(map); |
|
797 |
|
798 TLiwVariant sysdata((TInt32)1); |
|
799 map->InsertL(KStatus,sysdata); |
|
800 sysdata.Reset(); |
|
801 |
|
802 TLiwVariant sysparam(map); |
|
803 TLiwGenericParam element ; |
|
804 element.SetNameAndValueL(KNullDesC8,sysparam); |
|
805 sysparam.Reset(); |
|
806 |
|
807 // iInparam->AppendL(entity); |
|
808 |
|
809 iInparam->AppendL(key); |
|
810 iInparam->AppendL(element); |
|
811 |
|
812 element.Reset(); |
|
813 |
|
814 map->DecRef(); |
|
815 CleanupStack::Pop(map); |
|
816 |
|
817 // entity.Reset(); |
|
818 // entityname.Reset(); |
|
819 key.Reset(); |
|
820 keyname.Reset(); |
|
821 sysdata.Reset(); |
|
822 |
|
823 //Set Vibra |
|
824 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
825 result = err; |
|
826 if(err == KErrNone) |
|
827 { |
|
828 iOutparam->FindFirst( pos, KErrorCode ); |
|
829 if(pos != KErrNotFound) |
|
830 { |
|
831 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
832 } |
|
833 if(result == SErrMissingArgument) |
|
834 { |
|
835 result = 0; |
|
836 } |
|
837 else |
|
838 { |
|
839 result = -1; |
|
840 } |
|
841 } |
|
842 iOutparam->Reset(); |
|
843 iInparam->Reset(); |
|
844 |
|
845 __UHEAP_MARKEND; |
|
846 return result; |
|
847 |
|
848 } |
|
849 |
|
850 // ----------------------------------------------------------------------------- |
|
851 // Ctsysinfoprovidertests::VibraParamMissingKeyPos |
|
852 // without Key (Position based parsing). |
|
853 // ----------------------------------------------------------------------------- |
|
854 // |
|
855 TInt Ctsysinfoprovidertests::VibraParamMissingKeyPos( CStifItemParser& /*aItem*/ ) |
|
856 { |
|
857 TInt result =KErrNone; |
|
858 |
|
859 _LIT( KExample, "SupportedLang:" ); |
|
860 iLog->Log( KExample ); |
|
861 TInt pos = 0; |
|
862 |
|
863 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
864 |
|
865 Init(); |
|
866 __UHEAP_MARK; |
|
867 |
|
868 TLiwGenericParam entity; |
|
869 TLiwVariant entityname; |
|
870 // TLiwGenericParam key; |
|
871 // TLiwVariant keyname; |
|
872 |
|
873 entityname.Set(KGeneral); |
|
874 entity.SetNameAndValueL(KNullDesC8,entityname); |
|
875 |
|
876 // keyname.Set(KVibraActive); |
|
877 // key.SetNameAndValueL(KKey,keyname); |
|
878 |
|
879 //sysdata as map |
|
880 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
881 CleanupStack::PushL(map); |
|
882 |
|
883 TLiwVariant sysdata((TInt32)1); |
|
884 map->InsertL(KStatus,sysdata); |
|
885 sysdata.Reset(); |
|
886 |
|
887 TLiwVariant sysparam(map); |
|
888 TLiwGenericParam element ; |
|
889 element.SetNameAndValueL(KNullDesC8,sysparam); |
|
890 sysparam.Reset(); |
|
891 |
|
892 iInparam->AppendL(entity); |
|
893 |
|
894 // iInparam->AppendL(key); |
|
895 iInparam->AppendL(element); |
|
896 |
|
897 element.Reset(); |
|
898 |
|
899 map->DecRef(); |
|
900 CleanupStack::Pop(map); |
|
901 |
|
902 entity.Reset(); |
|
903 entityname.Reset(); |
|
904 // key.Reset(); |
|
905 // keyname.Reset(); |
|
906 sysdata.Reset(); |
|
907 |
|
908 //Set Vibra |
|
909 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
910 result = err; |
|
911 if(err == KErrNone) |
|
912 { |
|
913 iOutparam->FindFirst( pos, KErrorCode ); |
|
914 if(pos != KErrNotFound) |
|
915 { |
|
916 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
917 } |
|
918 if(result == SErrMissingArgument) |
|
919 { |
|
920 result = 0; |
|
921 } |
|
922 else |
|
923 { |
|
924 result = -1; |
|
925 } |
|
926 } |
|
927 iOutparam->Reset(); |
|
928 iInparam->Reset(); |
|
929 |
|
930 __UHEAP_MARKEND; |
|
931 return result; |
|
932 |
|
933 } |
|
934 |
|
935 // ----------------------------------------------------------------------------- |
|
936 // Ctsysinfoprovidertests::VibraParamMissingSysDataPos |
|
937 // without Input SysData for setInfo (Position based parsing). |
|
938 // ----------------------------------------------------------------------------- |
|
939 // |
|
940 TInt Ctsysinfoprovidertests::VibraParamMissingSysDataPos( CStifItemParser& /*aItem*/ ) |
|
941 { |
|
942 TInt result =KErrNone; |
|
943 |
|
944 _LIT( KExample, "SupportedLang:" ); |
|
945 iLog->Log( KExample ); |
|
946 TInt pos = 0; |
|
947 |
|
948 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
949 |
|
950 |
|
951 Init(); |
|
952 |
|
953 __UHEAP_MARK; |
|
954 |
|
955 TLiwGenericParam entity; |
|
956 TLiwVariant entityname; |
|
957 TLiwGenericParam key; |
|
958 TLiwVariant keyname; |
|
959 |
|
960 entityname.Set(KGeneral); |
|
961 entity.SetNameAndValueL(KNullDesC8,entityname); |
|
962 |
|
963 keyname.Set(KVibraActive); |
|
964 key.SetNameAndValueL(KNullDesC8,keyname); |
|
965 |
|
966 //sysdata as map |
|
967 // CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
968 // CleanupStack::PushL(map); |
|
969 |
|
970 // TLiwVariant sysdata(1); |
|
971 // map->InsertL(KStatus,sysdata); |
|
972 // sysdata.Reset(); |
|
973 |
|
974 // TLiwVariant sysparam(map); |
|
975 // TLiwGenericParam element ; |
|
976 // element.SetNameAndValueL(KSysData,sysparam); |
|
977 // sysparam.Reset(); |
|
978 |
|
979 iInparam->AppendL(entity); |
|
980 |
|
981 iInparam->AppendL(key); |
|
982 // iInparam->AppendL(element); |
|
983 |
|
984 // element.Reset(); |
|
985 |
|
986 // map->DecRef(); |
|
987 // CleanupStack::Pop(map); |
|
988 |
|
989 entity.Reset(); |
|
990 entityname.Reset(); |
|
991 key.Reset(); |
|
992 keyname.Reset(); |
|
993 // sysdata.Reset(); |
|
994 |
|
995 //Set Vibra |
|
996 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
997 result = err; |
|
998 if(err == KErrNone) |
|
999 { |
|
1000 iOutparam->FindFirst( pos, KErrorCode ); |
|
1001 if(pos != KErrNotFound) |
|
1002 { |
|
1003 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
1004 } |
|
1005 if(result == SErrMissingArgument) |
|
1006 { |
|
1007 result = 0; |
|
1008 } |
|
1009 else |
|
1010 { |
|
1011 result = -1; |
|
1012 } |
|
1013 } |
|
1014 iOutparam->Reset(); |
|
1015 iInparam->Reset(); |
|
1016 |
|
1017 __UHEAP_MARKEND; |
|
1018 return result; |
|
1019 |
|
1020 } |
|
1021 |
|
1022 // ----------------------------------------------------------------------------- |
|
1023 // Ctsysinfoprovidertests::WrongInterfaceName |
|
1024 // Wrong Interface Name provided. |
|
1025 // ----------------------------------------------------------------------------- |
|
1026 // |
|
1027 TInt Ctsysinfoprovidertests::WrongInterfaceName( CStifItemParser& /*aItem*/ ) |
|
1028 { |
|
1029 |
|
1030 TInt result =KErrNone; |
|
1031 |
|
1032 _LIT( KExample, "SupportedLang:" ); |
|
1033 iLog->Log( KExample ); |
|
1034 TInt pos = 0; |
|
1035 |
|
1036 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
1037 |
|
1038 // Init(); |
|
1039 __UHEAP_MARK; |
|
1040 _LIT8(KIDataSource,"ISys"); |
|
1041 |
|
1042 iServiceHandler = CLiwServiceHandler::NewL(); |
|
1043 iInparam = &(iServiceHandler->InParamListL()); |
|
1044 iOutparam = &(iServiceHandler->OutParamListL()); |
|
1045 |
|
1046 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1047 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1048 |
|
1049 RCriteriaArray a; |
|
1050 a.AppendL(crit); |
|
1051 |
|
1052 iServiceHandler->AttachL(a); |
|
1053 |
|
1054 TRAPD( err,iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam) ); |
|
1055 |
|
1056 delete crit; |
|
1057 a.Reset(); |
|
1058 |
|
1059 pos = 0; |
|
1060 |
|
1061 iOutparam->FindFirst( pos, KIDataSource ); |
|
1062 if(pos != KErrNotFound) |
|
1063 { |
|
1064 //getting the iInterface handle |
|
1065 iInterface = (*iOutparam)[pos].Value().AsInterface(); |
|
1066 result = -1; |
|
1067 } |
|
1068 else |
|
1069 { |
|
1070 result = 0; |
|
1071 } |
|
1072 |
|
1073 iOutparam->Reset(); |
|
1074 iInparam->Reset(); |
|
1075 |
|
1076 if( iInterface ) |
|
1077 { |
|
1078 iInterface->Close(); |
|
1079 } |
|
1080 iLog->Log(_L("before delete iServiceHandler :")); |
|
1081 delete iServiceHandler ; |
|
1082 iServiceHandler = NULL; |
|
1083 iLog->Log(_L("after delete iServiceHandler :")); |
|
1084 |
|
1085 __UHEAP_MARKEND; |
|
1086 return result; |
|
1087 |
|
1088 } |
|
1089 |
|
1090 // ----------------------------------------------------------------------------- |
|
1091 // Ctsysinfoprovidertests::LoadingInterfaceMultipletime |
|
1092 // Loading Interface Multiple time. |
|
1093 // ----------------------------------------------------------------------------- |
|
1094 // |
|
1095 TInt Ctsysinfoprovidertests::LoadingInterfaceMultipletime( CStifItemParser& /*aItem*/ ) |
|
1096 { |
|
1097 TInt result =KErrNone; |
|
1098 |
|
1099 _LIT( KExample, "SupportedLang:" ); |
|
1100 iLog->Log( KExample ); |
|
1101 TInt pos = 0; |
|
1102 |
|
1103 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
1104 |
|
1105 // Init(); |
|
1106 __UHEAP_MARK; |
|
1107 |
|
1108 iServiceHandler = CLiwServiceHandler::NewL(); |
|
1109 iInparam = &(iServiceHandler->InParamListL()); |
|
1110 iOutparam = &(iServiceHandler->OutParamListL()); |
|
1111 |
|
1112 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1113 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1114 |
|
1115 RCriteriaArray a; |
|
1116 a.AppendL(crit); |
|
1117 |
|
1118 iServiceHandler->AttachL(a); |
|
1119 TRAPD( err,iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam) ); |
|
1120 |
|
1121 delete crit; |
|
1122 a.Reset(); |
|
1123 pos = 0; |
|
1124 |
|
1125 iOutparam->FindFirst( pos, KIDataSource ); |
|
1126 if(pos != KErrNotFound) |
|
1127 { |
|
1128 //getting the iInterface handle |
|
1129 iInterface = (*iOutparam)[pos].Value().AsInterface(); |
|
1130 |
|
1131 iOutparam->Reset(); |
|
1132 iInparam->Reset(); |
|
1133 |
|
1134 // iInparam = &(iServiceHandler->InParamListL()); |
|
1135 // iOutparam = &(iServiceHandler->OutParamListL()); |
|
1136 |
|
1137 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1138 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1139 |
|
1140 RCriteriaArray a; |
|
1141 a.AppendL(crit); |
|
1142 |
|
1143 iServiceHandler->AttachL(a); |
|
1144 TRAPD( err,iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam) ); |
|
1145 |
|
1146 delete crit; |
|
1147 a.Reset(); |
|
1148 |
|
1149 |
|
1150 // iServiceHandler->AttachL(a); |
|
1151 // TRAPD( err1,iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam) ); |
|
1152 |
|
1153 // iServiceHandler->AttachL(a); |
|
1154 // TRAP( err1,iServiceHandler->ExecuteServiceCmdL(*crit, *iInparam, *iOutparam) ); |
|
1155 pos = 0 ; |
|
1156 iOutparam->FindFirst( pos, KIDataSource ); |
|
1157 if(pos != KErrNotFound) |
|
1158 { |
|
1159 MLiwInterface* iInterface1 = (*iOutparam)[pos].Value().AsInterface(); |
|
1160 |
|
1161 if(iInterface1 !=iInterface ) |
|
1162 { |
|
1163 iLog->Log(_L(" iInterface1 !=iInterface :")); |
|
1164 result = 0; |
|
1165 |
|
1166 } |
|
1167 else |
|
1168 { |
|
1169 result = -1; iLog->Log(_L(" iInterface1 ==iInterface :")); |
|
1170 } |
|
1171 |
|
1172 if( iInterface1 ) |
|
1173 { |
|
1174 iInterface1->Close(); |
|
1175 } |
|
1176 } |
|
1177 else |
|
1178 { |
|
1179 result =-1; |
|
1180 } |
|
1181 } |
|
1182 else |
|
1183 { |
|
1184 result = -1; |
|
1185 } |
|
1186 |
|
1187 iOutparam->Reset(); |
|
1188 iInparam->Reset(); |
|
1189 iLog->Log(_L("before iInterface->Close():")); |
|
1190 |
|
1191 if( iInterface ) |
|
1192 { |
|
1193 iInterface->Close(); |
|
1194 iInterface = NULL ; |
|
1195 } |
|
1196 iLog->Log(_L("before delete iServiceHandler :")); |
|
1197 delete iServiceHandler ; |
|
1198 iServiceHandler = NULL ; |
|
1199 iLog->Log(_L("after delete iServiceHandler :")); |
|
1200 |
|
1201 __UHEAP_MARKEND; |
|
1202 return result; |
|
1203 |
|
1204 |
|
1205 } |
|
1206 |
|
1207 // ----------------------------------------------------------------------------- |
|
1208 // Ctsysinfoprovidertests::VibraSync |
|
1209 // with KLiwOptASyncronous bit set for a synchronous request. |
|
1210 // ----------------------------------------------------------------------------- |
|
1211 // |
|
1212 TInt Ctsysinfoprovidertests::VibraSync( CStifItemParser& /*aItem*/ ) |
|
1213 { |
|
1214 TInt result =KErrNone; |
|
1215 |
|
1216 _LIT( KExample, "SupportedLang:" ); |
|
1217 iLog->Log( KExample ); |
|
1218 TInt pos = 0; |
|
1219 |
|
1220 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
1221 |
|
1222 Init(); |
|
1223 __UHEAP_MARK; |
|
1224 |
|
1225 TLiwGenericParam entity; |
|
1226 TLiwVariant entityname; |
|
1227 TLiwGenericParam key; |
|
1228 TLiwVariant keyname; |
|
1229 |
|
1230 entityname.Set(KGeneral); |
|
1231 entity.SetNameAndValueL(KEntity,entityname); |
|
1232 |
|
1233 keyname.Set(KVibraActive); |
|
1234 key.SetNameAndValueL(KKey,keyname); |
|
1235 |
|
1236 //sysdata as map |
|
1237 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
1238 CleanupStack::PushL(map); |
|
1239 |
|
1240 TLiwVariant sysdata((TInt32)1); |
|
1241 map->InsertL(KStatus,sysdata); |
|
1242 sysdata.Reset(); |
|
1243 |
|
1244 TLiwVariant sysparam(map); |
|
1245 TLiwGenericParam element ; |
|
1246 element.SetNameAndValueL(KSysData,sysparam); |
|
1247 sysparam.Reset(); |
|
1248 |
|
1249 iInparam->AppendL(entity); |
|
1250 |
|
1251 iInparam->AppendL(key); |
|
1252 iInparam->AppendL(element); |
|
1253 |
|
1254 element.Reset(); |
|
1255 |
|
1256 map->DecRef(); |
|
1257 CleanupStack::Pop(map); |
|
1258 |
|
1259 entity.Reset(); |
|
1260 entityname.Reset(); |
|
1261 key.Reset(); |
|
1262 keyname.Reset(); |
|
1263 sysdata.Reset(); |
|
1264 |
|
1265 //Set Vibra |
|
1266 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam,KLiwOptASyncronous,NULL)); |
|
1267 result = err; |
|
1268 if(err == KErrNone) |
|
1269 { |
|
1270 iOutparam->FindFirst( pos, KErrorCode ); |
|
1271 if(pos != KErrNotFound) |
|
1272 { |
|
1273 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
1274 } |
|
1275 if(result == SErrBadArgumentType) |
|
1276 { |
|
1277 result = 0; |
|
1278 } |
|
1279 else |
|
1280 { |
|
1281 result = -1; |
|
1282 } |
|
1283 } |
|
1284 iOutparam->Reset(); |
|
1285 iInparam->Reset(); |
|
1286 |
|
1287 __UHEAP_MARKEND; |
|
1288 return result; |
|
1289 |
|
1290 } |
|
1291 |
|
1292 |
|
1293 // ----------------------------------------------------------------------------- |
|
1294 // Ctsysinfoprovidertests::VibraStatus |
|
1295 // missing asynchronous bit in GetNotification |
|
1296 // ----------------------------------------------------------------------------- |
|
1297 // |
|
1298 TInt Ctsysinfoprovidertests::VibraStatus(CStifItemParser& /*aItem*/) |
|
1299 { |
|
1300 int ret=0; |
|
1301 ret = VibraNotification(iLog); |
|
1302 |
|
1303 if(ret==0) |
|
1304 return KErrNone; |
|
1305 else |
|
1306 return KErrGeneral; |
|
1307 } |
|
1308 |
|
1309 // ----------------------------------------------------------------------------- |
|
1310 // Ctsysinfoprovidertests::VibraStatus |
|
1311 // missing callback parameter |
|
1312 // ----------------------------------------------------------------------------- |
|
1313 // |
|
1314 TInt Ctsysinfoprovidertests::VibraStatus1(CStifItemParser& /*aItem*/) |
|
1315 { |
|
1316 int ret=0; |
|
1317 ret = VibraNotification1(iLog); |
|
1318 |
|
1319 if(ret==0) |
|
1320 return KErrNone; |
|
1321 else |
|
1322 return KErrGeneral; |
|
1323 } |
|
1324 |
|
1325 |
|
1326 // ----------------------------------------------------------------------------- |
|
1327 // Ctsysinfoprovidertests::VibraInvalidCommand |
|
1328 // Invalid Command name. |
|
1329 // ----------------------------------------------------------------------------- |
|
1330 // |
|
1331 TInt Ctsysinfoprovidertests::VibraInvalidCommand( CStifItemParser& /*aItem*/ ) |
|
1332 { |
|
1333 TInt result =KErrNone; |
|
1334 |
|
1335 _LIT( KExample, "VibraInvalidCommand:" ); |
|
1336 iLog->Log( KExample ); |
|
1337 TInt pos = 0; |
|
1338 |
|
1339 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
1340 |
|
1341 Init(); |
|
1342 __UHEAP_MARK; |
|
1343 |
|
1344 TLiwGenericParam entity; |
|
1345 TLiwVariant entityname; |
|
1346 TLiwGenericParam key; |
|
1347 TLiwVariant keyname; |
|
1348 |
|
1349 entityname.Set(KGeneral); |
|
1350 entity.SetNameAndValueL(KEntity,entityname); |
|
1351 |
|
1352 keyname.Set(KVibraActive); |
|
1353 key.SetNameAndValueL(KKey,keyname); |
|
1354 |
|
1355 //sysdata as map |
|
1356 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
1357 CleanupStack::PushL(map); |
|
1358 |
|
1359 TLiwVariant sysdata((TInt32)1); |
|
1360 map->InsertL(KStatus,sysdata); |
|
1361 sysdata.Reset(); |
|
1362 |
|
1363 TLiwVariant sysparam(map); |
|
1364 TLiwGenericParam element ; |
|
1365 element.SetNameAndValueL(KSysData,sysparam); |
|
1366 sysparam.Reset(); |
|
1367 |
|
1368 iInparam->AppendL(entity); |
|
1369 |
|
1370 iInparam->AppendL(key); |
|
1371 iInparam->AppendL(element); |
|
1372 |
|
1373 element.Reset(); |
|
1374 |
|
1375 map->DecRef(); |
|
1376 CleanupStack::Pop(map); |
|
1377 |
|
1378 entity.Reset(); |
|
1379 entityname.Reset(); |
|
1380 key.Reset(); |
|
1381 keyname.Reset(); |
|
1382 sysdata.Reset(); |
|
1383 |
|
1384 _LIT8(KSetInfo,"SetInformation"); |
|
1385 //Set Vibra |
|
1386 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
1387 result = err; |
|
1388 if(err == KErrNone) |
|
1389 { |
|
1390 iOutparam->FindFirst( pos, KErrorCode ); |
|
1391 if(pos != KErrNotFound) |
|
1392 { |
|
1393 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
1394 } |
|
1395 if(result == SErrServiceNotSupported) |
|
1396 { |
|
1397 result = 0; |
|
1398 } |
|
1399 else |
|
1400 { |
|
1401 result = -1; |
|
1402 } |
|
1403 } |
|
1404 iOutparam->Reset(); |
|
1405 iInparam->Reset(); |
|
1406 |
|
1407 __UHEAP_MARKEND; |
|
1408 return result; |
|
1409 |
|
1410 } |
|
1411 |
|
1412 |
|
1413 // ----------------------------------------------------------------------------- |
|
1414 // Ctsysinfoprovidertests::BtNotifyCancel |
|
1415 // missing KLiwOptCancel bit |
|
1416 // ----------------------------------------------------------------------------- |
|
1417 // |
|
1418 TInt Ctsysinfoprovidertests::BtNotifyCancel(CStifItemParser& /*aItem*/) |
|
1419 { |
|
1420 int ret=0; |
|
1421 ret = BTAsyncReqCancel(iLog); |
|
1422 |
|
1423 if(ret==0) |
|
1424 return KErrNone; |
|
1425 else |
|
1426 return KErrGeneral; |
|
1427 } |
|
1428 // ----------------------------------------------------------------------------- |
|
1429 // Ctsysinfoprovidertests::ActiveConnectionMissingCallback |
|
1430 // missing callback parameter |
|
1431 // ----------------------------------------------------------------------------- |
|
1432 // |
|
1433 TInt Ctsysinfoprovidertests::ActiveConnectionMissingCallback(CStifItemParser& /*aItem*/) |
|
1434 { |
|
1435 int ret=0; |
|
1436 ret = ActiveConnection(iLog); |
|
1437 |
|
1438 if(ret==0) |
|
1439 return KErrNone; |
|
1440 else |
|
1441 return KErrGeneral; |
|
1442 } |
|
1443 // ----------------------------------------------------------------------------- |
|
1444 // Ctsysinfoprovidertests::ActiveConnReqCancelMissingTransId |
|
1445 // missing transaction id in the cancel Request. |
|
1446 // ----------------------------------------------------------------------------- |
|
1447 // |
|
1448 TInt Ctsysinfoprovidertests::ActiveConnReqCancelMissingTransId(CStifItemParser& /*aItem*/) |
|
1449 { |
|
1450 int ret=0; |
|
1451 ret = ActiveConnectionReqCancel(iLog); |
|
1452 |
|
1453 if(ret==0) |
|
1454 return KErrNone; |
|
1455 else |
|
1456 return KErrGeneral; |
|
1457 } |
|
1458 |
|
1459 |
|
1460 // ----------------------------------------------------------------------------- |
|
1461 // Ctsysinfoprovidertests::SupportedLang |
|
1462 // |
|
1463 // ----------------------------------------------------------------------------- |
|
1464 // |
|
1465 TInt Ctsysinfoprovidertests::SupportedLang(CStifItemParser& /*aItem*/) |
|
1466 { |
|
1467 |
|
1468 _LIT( KExample, "SupportedLang:" ); |
|
1469 iLog->Log( KExample ); |
|
1470 |
|
1471 __UHEAP_MARK; |
|
1472 |
|
1473 CLiwServiceHandler* iServiceHandler = CLiwServiceHandler::NewL(); |
|
1474 CleanupStack::PushL(iServiceHandler); |
|
1475 CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); |
|
1476 CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); |
|
1477 |
|
1478 TInt result = KErrNone; |
|
1479 |
|
1480 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1481 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1482 |
|
1483 RCriteriaArray a; |
|
1484 a.AppendL(crit); |
|
1485 |
|
1486 iServiceHandler->AttachL(a); |
|
1487 |
|
1488 iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam); |
|
1489 |
|
1490 delete crit; |
|
1491 a.Reset(); |
|
1492 |
|
1493 TInt pos = 0; |
|
1494 MLiwInterface* interface = NULL; |
|
1495 outparam->FindFirst( pos, KIDataSource ); |
|
1496 if(pos != KErrNotFound) |
|
1497 { |
|
1498 interface = (*outparam)[pos].Value().AsInterface(); |
|
1499 } |
|
1500 |
|
1501 outparam->Reset(); |
|
1502 inparam->Reset(); |
|
1503 |
|
1504 if(interface) |
|
1505 { |
|
1506 TLiwGenericParam entity; |
|
1507 TLiwVariant entityname; |
|
1508 TLiwGenericParam key; |
|
1509 TLiwVariant keyname; |
|
1510 |
|
1511 entityname.Set(KGeneral); |
|
1512 entity.SetNameAndValueL(KEntity,entityname); |
|
1513 |
|
1514 keyname.Set(KSupportedLanguages); |
|
1515 key.SetNameAndValueL(KKey,keyname); |
|
1516 |
|
1517 inparam->AppendL(entity); |
|
1518 |
|
1519 inparam->AppendL(key); |
|
1520 |
|
1521 entity.Reset(); |
|
1522 entityname.Reset(); |
|
1523 key.Reset(); |
|
1524 keyname.Reset(); |
|
1525 |
|
1526 //get supported languages list |
|
1527 TRAPD(err,interface->ExecuteCmdL(KGetInfo,*inparam,*outparam)); |
|
1528 result = err; |
|
1529 |
|
1530 if(err == KErrNone) |
|
1531 { |
|
1532 pos = 0 ; |
|
1533 |
|
1534 const TLiwGenericParam* output = outparam->FindFirst( pos,KReturnValue ); |
|
1535 |
|
1536 |
|
1537 if(output) |
|
1538 { |
|
1539 const CLiwMap* Map = output->Value().AsMap(); |
|
1540 if ( Map ) |
|
1541 { |
|
1542 TLiwVariant data; |
|
1543 |
|
1544 if(EFalse!=Map->FindL(KLanguageList,data)) |
|
1545 { |
|
1546 const CLiwList* langList=data.AsList(); |
|
1547 |
|
1548 TInt32 testacctype= 0,testaccstatus= 0; |
|
1549 if(langList) |
|
1550 { |
|
1551 for(TInt i=0; i != (langList->Count()+10); ++i) |
|
1552 { |
|
1553 TLiwVariant langVariant; |
|
1554 if(langList->AtL(i,langVariant)) |
|
1555 { |
|
1556 TInt32 langValue = langVariant.AsTInt32(); |
|
1557 TBuf<50> buf; |
|
1558 buf.AppendNum(langValue); |
|
1559 iLog->Log(buf); |
|
1560 } |
|
1561 // TInt count1 = (langList->Count() + 10); |
|
1562 // langList->Remove(count1) ; |
|
1563 |
|
1564 } |
|
1565 |
|
1566 } |
|
1567 } |
|
1568 |
|
1569 data.Reset(); |
|
1570 } |
|
1571 } |
|
1572 |
|
1573 } |
|
1574 } |
|
1575 inparam->Reset(); |
|
1576 outparam->Reset(); |
|
1577 |
|
1578 interface->Close(); |
|
1579 |
|
1580 CleanupStack::PopAndDestroy( iServiceHandler ); |
|
1581 |
|
1582 __UHEAP_MARKEND; |
|
1583 |
|
1584 return result; |
|
1585 } |
|
1586 |
|
1587 |
|
1588 |
|
1589 // ----------------------------------------------------------------------------- |
|
1590 // Ctsysinfoprovidertests::SetDisplayLang |
|
1591 // |
|
1592 // ----------------------------------------------------------------------------- |
|
1593 // |
|
1594 TInt Ctsysinfoprovidertests::SetDisplayLang(CStifItemParser& /*aItem*/) |
|
1595 { |
|
1596 |
|
1597 TInt result =KErrNone; |
|
1598 |
|
1599 _LIT( KExample, "SetDisplayLang:" ); |
|
1600 iLog->Log( KExample ); |
|
1601 |
|
1602 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
1603 |
|
1604 __UHEAP_MARK; |
|
1605 |
|
1606 |
|
1607 _LIT(KDisplayLanguage,"DisplayLanguage"); |
|
1608 |
|
1609 CLiwServiceHandler* iServiceHandler = CLiwServiceHandler::NewL(); |
|
1610 CleanupStack::PushL(iServiceHandler); |
|
1611 CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); |
|
1612 CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); |
|
1613 |
|
1614 TInt err = KErrNone; |
|
1615 |
|
1616 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1617 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1618 |
|
1619 RCriteriaArray a; |
|
1620 a.AppendL(crit); |
|
1621 |
|
1622 iServiceHandler->AttachL(a); |
|
1623 |
|
1624 iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam); |
|
1625 |
|
1626 delete crit; |
|
1627 a.Reset(); |
|
1628 |
|
1629 TInt pos = 0; |
|
1630 MLiwInterface* interface = NULL; |
|
1631 outparam->FindFirst( pos, KIDataSource ); |
|
1632 if(pos != KErrNotFound) |
|
1633 { |
|
1634 //getting the interface handle |
|
1635 interface = (*outparam)[pos].Value().AsInterface(); |
|
1636 } |
|
1637 |
|
1638 outparam->Reset(); |
|
1639 inparam->Reset(); |
|
1640 |
|
1641 if(interface) |
|
1642 { |
|
1643 TLiwGenericParam entity; |
|
1644 TLiwVariant entityname; |
|
1645 TLiwGenericParam key; |
|
1646 TLiwVariant keyname; |
|
1647 |
|
1648 entityname.Set(KGeneral); |
|
1649 entity.SetNameAndValueL(KEntity,entityname); |
|
1650 |
|
1651 keyname.Set(KDisplayLanguage); |
|
1652 key.SetNameAndValueL(KKey,keyname); |
|
1653 |
|
1654 inparam->AppendL(entity); |
|
1655 |
|
1656 inparam->AppendL(key); |
|
1657 |
|
1658 entity.Reset(); |
|
1659 entityname.Reset(); |
|
1660 key.Reset(); |
|
1661 keyname.Reset(); |
|
1662 |
|
1663 //get current display language |
|
1664 TRAPD(err, interface->ExecuteCmdL(KGetInfo,*inparam,*outparam)); |
|
1665 pos = 0 ; |
|
1666 outparam->FindFirst( pos, KErrorCode ); |
|
1667 if(pos != KErrNotFound) |
|
1668 { |
|
1669 err = (TInt)((*outparam)[pos].Value().AsTInt32()); |
|
1670 } |
|
1671 |
|
1672 |
|
1673 if( err != SErrNotFound ) |
|
1674 { |
|
1675 iLog->Log( _L("Failed,Get Display language found ret err: %d"),err ); |
|
1676 result = KErrGeneral; |
|
1677 } |
|
1678 else |
|
1679 { |
|
1680 result = KErrNone; |
|
1681 iLog->Log( _L("Passed Get Display language not found") ); |
|
1682 } |
|
1683 |
|
1684 |
|
1685 outparam->Reset(); |
|
1686 CLiwDefaultMap* sysdatamap = CLiwDefaultMap::NewL(); |
|
1687 CleanupClosePushL(*sysdatamap); |
|
1688 sysdatamap->InsertL(KStatus,(TInt32)10); |
|
1689 inparam->AppendL(TLiwGenericParam(KSysData,TLiwVariant(sysdatamap))); |
|
1690 CleanupStack::PopAndDestroy(sysdatamap); |
|
1691 |
|
1692 TRAPD(err1, interface->ExecuteCmdL(KSetInfo,*inparam,*outparam)); |
|
1693 |
|
1694 pos = 0 ; |
|
1695 outparam->FindFirst( pos, KErrorCode ); |
|
1696 if(pos != KErrNotFound) |
|
1697 { |
|
1698 err = (TInt)((*outparam)[pos].Value().AsTInt32()); |
|
1699 } |
|
1700 |
|
1701 if( err != SErrNotFound ) |
|
1702 { |
|
1703 iLog->Log( _L("Failed, Set Display language found ret err: %d"),err ); |
|
1704 result = KErrGeneral; |
|
1705 } |
|
1706 else |
|
1707 { |
|
1708 result = KErrNone; |
|
1709 iLog->Log( _L("Passed, Set Display language not found") ); |
|
1710 } |
|
1711 } |
|
1712 |
|
1713 inparam->Reset(); |
|
1714 outparam->Reset(); |
|
1715 |
|
1716 interface->Close(); |
|
1717 |
|
1718 CleanupStack::PopAndDestroy( iServiceHandler ); |
|
1719 |
|
1720 return result; |
|
1721 __UHEAP_MARKEND; |
|
1722 |
|
1723 } |
|
1724 |
|
1725 |
|
1726 // ----------------------------------------------------------------------------- |
|
1727 // Ctsysinfoprovidertests::SetInputLang |
|
1728 // |
|
1729 // ----------------------------------------------------------------------------- |
|
1730 // |
|
1731 TInt Ctsysinfoprovidertests::SetInputLang(CStifItemParser& /*aItem*/) |
|
1732 { |
|
1733 TInt result =KErrNone; |
|
1734 |
|
1735 _LIT( KExample, "SupportedLang:" ); |
|
1736 iLog->Log( KExample ); |
|
1737 |
|
1738 TInt32 oldInputLang = 0 ,newInputLang = 0,changedInputLang =0; |
|
1739 |
|
1740 __UHEAP_MARK; |
|
1741 |
|
1742 CLiwServiceHandler* iServiceHandler = CLiwServiceHandler::NewL(); |
|
1743 CleanupStack::PushL(iServiceHandler); |
|
1744 CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); |
|
1745 CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); |
|
1746 |
|
1747 TInt err = KErrNone; |
|
1748 |
|
1749 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KIDataSource,KService); |
|
1750 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1751 |
|
1752 RCriteriaArray a; |
|
1753 a.AppendL(crit); |
|
1754 |
|
1755 iServiceHandler->AttachL(a); |
|
1756 |
|
1757 iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam); |
|
1758 |
|
1759 delete crit; |
|
1760 a.Reset(); |
|
1761 |
|
1762 TInt pos = 0; |
|
1763 MLiwInterface* interface = NULL; |
|
1764 outparam->FindFirst( pos, KIDataSource ); |
|
1765 if(pos != KErrNotFound) |
|
1766 { |
|
1767 //get interface handle |
|
1768 interface = (*outparam)[pos].Value().AsInterface(); |
|
1769 } |
|
1770 |
|
1771 outparam->Reset(); |
|
1772 inparam->Reset(); |
|
1773 |
|
1774 if(interface) |
|
1775 { |
|
1776 TLiwGenericParam entity; |
|
1777 TLiwVariant entityname; |
|
1778 TLiwGenericParam key; |
|
1779 TLiwVariant keyname; |
|
1780 |
|
1781 entityname.Set(KGeneral); |
|
1782 entity.SetNameAndValueL(KEntity,entityname); |
|
1783 |
|
1784 keyname.Set(KSupportedLanguages); |
|
1785 key.SetNameAndValueL(KKey,keyname); |
|
1786 |
|
1787 //append entity and key as input parameters |
|
1788 inparam->AppendL(entity); |
|
1789 |
|
1790 inparam->AppendL(key); |
|
1791 |
|
1792 entity.Reset(); |
|
1793 entityname.Reset(); |
|
1794 key.Reset(); |
|
1795 keyname.Reset(); |
|
1796 |
|
1797 //get supported language list |
|
1798 TRAPD(err1, interface->ExecuteCmdL(KGetInfo,*inparam,*outparam)); |
|
1799 result = err1; |
|
1800 if(err1 == KErrNone) |
|
1801 { |
|
1802 CLiwGenericParamList* outparam1 = CLiwGenericParamList::NewL(); |
|
1803 inparam->Reset(); |
|
1804 |
|
1805 entityname.Set(KGeneral); |
|
1806 entity.SetNameAndValueL(KEntity,entityname); |
|
1807 |
|
1808 keyname.Set(KInputLanguage); |
|
1809 key.SetNameAndValueL(KKey,keyname); |
|
1810 |
|
1811 inparam->AppendL(entity); |
|
1812 |
|
1813 inparam->AppendL(key); |
|
1814 |
|
1815 entity.Reset(); |
|
1816 entityname.Reset(); |
|
1817 key.Reset(); |
|
1818 keyname.Reset(); |
|
1819 |
|
1820 //get current input language |
|
1821 TRAPD(err2, interface->ExecuteCmdL(KGetInfo,*inparam,*outparam1)); |
|
1822 |
|
1823 result = err2; |
|
1824 if(err2 == KErrNone) |
|
1825 { |
|
1826 pos = 0 ; |
|
1827 const TLiwGenericParam* output1 = outparam1->FindFirst( pos,KReturnValue ); |
|
1828 if(output1) |
|
1829 { |
|
1830 const CLiwMap* Map = output1->Value().AsMap(); |
|
1831 if ( Map ) |
|
1832 { |
|
1833 TLiwVariant data; |
|
1834 if(EFalse!=Map->FindL(KStatus,data)) |
|
1835 { |
|
1836 oldInputLang=data.AsTInt32(); |
|
1837 |
|
1838 iLog->Log(_L("Oldinputlang")); |
|
1839 TBuf<50> buf; |
|
1840 buf.AppendNum(oldInputLang); |
|
1841 iLog->Log(buf); |
|
1842 } |
|
1843 }//map |
|
1844 }//output |
|
1845 |
|
1846 inparam->Reset(); |
|
1847 outparam1->Reset(); |
|
1848 |
|
1849 //get new input lang from supported lang list |
|
1850 pos = 0 ; |
|
1851 const TLiwGenericParam* output = outparam->FindFirst( pos,KReturnValue ); |
|
1852 if(output) |
|
1853 { |
|
1854 const CLiwMap* Map = output->Value().AsMap(); |
|
1855 if ( Map ) |
|
1856 { |
|
1857 TLiwVariant data; |
|
1858 |
|
1859 if(EFalse!=Map->FindL(KLanguageList,data)) |
|
1860 { |
|
1861 const CLiwList* langList=data.AsList(); |
|
1862 |
|
1863 TInt32 testacctype= 0,testaccstatus= 0; |
|
1864 if(langList) |
|
1865 { |
|
1866 for(TInt j= 0; j<1023; j++) |
|
1867 { |
|
1868 for(TInt i=0; i != langList->Count(); ++i) |
|
1869 { |
|
1870 TLiwVariant langVariant; |
|
1871 langList->AtL(i,langVariant); |
|
1872 newInputLang = langVariant.AsTInt32(); |
|
1873 |
|
1874 if(newInputLang != j) |
|
1875 { |
|
1876 newInputLang = j; |
|
1877 // break; |
|
1878 } |
|
1879 |
|
1880 } |
|
1881 } |
|
1882 } |
|
1883 } |
|
1884 |
|
1885 data.Reset(); |
|
1886 }//map |
|
1887 }//output |
|
1888 |
|
1889 outparam->Reset(); |
|
1890 |
|
1891 entityname.Set(KGeneral); |
|
1892 entity.SetNameAndValueL(KEntity,entityname); |
|
1893 |
|
1894 keyname.Set(KInputLanguage); |
|
1895 key.SetNameAndValueL(KKey,keyname); |
|
1896 |
|
1897 |
|
1898 //sysdata as map |
|
1899 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
1900 CleanupStack::PushL(map); |
|
1901 |
|
1902 TLiwVariant sysdata(newInputLang); |
|
1903 map->InsertL(KStatus,sysdata); |
|
1904 sysdata.Reset(); |
|
1905 |
|
1906 |
|
1907 TLiwVariant sysparam(map); |
|
1908 TLiwGenericParam element ; |
|
1909 element.SetNameAndValueL(KSysData,sysparam); |
|
1910 sysparam.Reset(); |
|
1911 |
|
1912 inparam->AppendL(entity); |
|
1913 inparam->AppendL(key); |
|
1914 |
|
1915 inparam->AppendL(element); |
|
1916 element.Reset(); |
|
1917 |
|
1918 map->DecRef(); |
|
1919 CleanupStack::Pop(map); |
|
1920 inparam->AppendL(entity); |
|
1921 inparam->AppendL(key); |
|
1922 |
|
1923 entity.Reset(); |
|
1924 entityname.Reset(); |
|
1925 key.Reset(); |
|
1926 keyname.Reset(); |
|
1927 sysdata.Reset(); |
|
1928 |
|
1929 //set new input language |
|
1930 TRAPD(err3, interface->ExecuteCmdL(KSetInfo,*inparam,*outparam1)); |
|
1931 inparam->Reset(); |
|
1932 outparam1->Reset(); |
|
1933 |
|
1934 result = err3; |
|
1935 if(err3 == KErrNone) |
|
1936 { |
|
1937 pos = 0 ; |
|
1938 outparam1->FindFirst( pos, KErrorCode ); |
|
1939 if(pos != KErrNotFound) |
|
1940 { |
|
1941 result = (TInt)((*outparam1)[pos].Value().AsTInt32()); |
|
1942 } |
|
1943 |
|
1944 |
|
1945 CLiwGenericParamList* outparam1 = CLiwGenericParamList::NewL(); |
|
1946 inparam->Reset(); |
|
1947 |
|
1948 entityname.Set(KGeneral); |
|
1949 entity.SetNameAndValueL(KEntity,entityname); |
|
1950 |
|
1951 keyname.Set(KInputLanguage); |
|
1952 key.SetNameAndValueL(KKey,keyname); |
|
1953 |
|
1954 inparam->AppendL(entity); |
|
1955 |
|
1956 inparam->AppendL(key); |
|
1957 |
|
1958 entity.Reset(); |
|
1959 entityname.Reset(); |
|
1960 key.Reset(); |
|
1961 keyname.Reset(); |
|
1962 |
|
1963 //get changed input language |
|
1964 TRAPD(err4, interface->ExecuteCmdL(KGetInfo,*inparam,*outparam1)); |
|
1965 |
|
1966 result = err4; |
|
1967 if(err4 == KErrNone) |
|
1968 { |
|
1969 pos = 0 ; |
|
1970 outparam1->FindFirst( pos, KErrorCode ); |
|
1971 if(pos != KErrNotFound) |
|
1972 { |
|
1973 result = (TInt)((*outparam1)[pos].Value().AsTInt32()); |
|
1974 } |
|
1975 |
|
1976 pos = 0 ; |
|
1977 const TLiwGenericParam* output1 = outparam1->FindFirst( pos,KReturnValue ); |
|
1978 if(output1) |
|
1979 { |
|
1980 const CLiwMap* Map = output1->Value().AsMap(); |
|
1981 if ( Map ) |
|
1982 { |
|
1983 TLiwVariant data; |
|
1984 if(EFalse!=Map->FindL(KStatus,data)) |
|
1985 { |
|
1986 changedInputLang=data.AsTInt32(); |
|
1987 |
|
1988 iLog->Log(_L("changedInputLang")); |
|
1989 TBuf<50> buf; |
|
1990 buf.AppendNum(changedInputLang); |
|
1991 iLog->Log(buf); |
|
1992 } |
|
1993 }//map |
|
1994 }//output |
|
1995 |
|
1996 inparam->Reset(); |
|
1997 outparam1->Reset(); |
|
1998 |
|
1999 if(newInputLang != changedInputLang) |
|
2000 { |
|
2001 result = KErrNone; |
|
2002 } |
|
2003 else |
|
2004 { |
|
2005 result = KErrGeneral; |
|
2006 } |
|
2007 }//err4 |
|
2008 inparam->Reset(); |
|
2009 outparam1->Reset(); |
|
2010 }//err3 |
|
2011 }//err2 |
|
2012 |
|
2013 }//err1 |
|
2014 |
|
2015 }//interface |
|
2016 |
|
2017 if(newInputLang != changedInputLang) |
|
2018 { |
|
2019 result = KErrNone; |
|
2020 } |
|
2021 else |
|
2022 { |
|
2023 result = KErrGeneral; |
|
2024 } |
|
2025 |
|
2026 interface->Close(); |
|
2027 |
|
2028 CleanupStack::PopAndDestroy( iServiceHandler ); |
|
2029 |
|
2030 return result; |
|
2031 |
|
2032 __UHEAP_MARKEND; |
|
2033 |
|
2034 |
|
2035 } |
|
2036 |
|
2037 // ----------------------------------------------------------------------------- |
|
2038 // Ctsysinfoprovidertests::SetPredictiveText |
|
2039 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2040 // ----------------------------------------------------------------------------- |
|
2041 // |
|
2042 TInt Ctsysinfoprovidertests::SetPredictiveText( CStifItemParser& /*aItem*/ ) |
|
2043 { |
|
2044 TInt result =KErrNone; |
|
2045 |
|
2046 _LIT( KExample, "SupportedLang:" ); |
|
2047 iLog->Log( KExample ); |
|
2048 TInt pos = 0; |
|
2049 |
|
2050 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2051 |
|
2052 Init(); |
|
2053 __UHEAP_MARK; |
|
2054 |
|
2055 TLiwGenericParam entity; |
|
2056 TLiwVariant entityname; |
|
2057 TLiwGenericParam key; |
|
2058 TLiwVariant keyname; |
|
2059 |
|
2060 entityname.Set(KGeneral); |
|
2061 entity.SetNameAndValueL(KEntity,entityname); |
|
2062 |
|
2063 keyname.Set(KPridictiveText); |
|
2064 key.SetNameAndValueL(KKey,keyname); |
|
2065 |
|
2066 //sysdata as map |
|
2067 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2068 CleanupStack::PushL(map); |
|
2069 |
|
2070 TLiwVariant sysdata((TInt32)50); |
|
2071 map->InsertL(KStatus,sysdata); |
|
2072 sysdata.Reset(); |
|
2073 |
|
2074 TLiwVariant sysparam(map); |
|
2075 TLiwGenericParam element ; |
|
2076 element.SetNameAndValueL(KSysData,sysparam); |
|
2077 sysparam.Reset(); |
|
2078 |
|
2079 iInparam->AppendL(entity); |
|
2080 |
|
2081 iInparam->AppendL(key); |
|
2082 iInparam->AppendL(element); |
|
2083 |
|
2084 element.Reset(); |
|
2085 |
|
2086 map->DecRef(); |
|
2087 CleanupStack::Pop(map); |
|
2088 |
|
2089 entity.Reset(); |
|
2090 entityname.Reset(); |
|
2091 key.Reset(); |
|
2092 keyname.Reset(); |
|
2093 sysdata.Reset(); |
|
2094 |
|
2095 //Set Vibra |
|
2096 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2097 result = err; |
|
2098 if(err == KErrNone) |
|
2099 { |
|
2100 pos = 0; |
|
2101 iOutparam->FindFirst( pos, KErrorCode ); |
|
2102 if(pos != KErrNotFound) |
|
2103 { |
|
2104 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2105 } |
|
2106 iOutparam->Reset(); |
|
2107 iInparam->Reset(); |
|
2108 |
|
2109 if(result != SErrNone) |
|
2110 { |
|
2111 TBuf<50> buf; |
|
2112 buf.AppendNum(result); |
|
2113 iLog->Log(buf); |
|
2114 result = 0; |
|
2115 |
|
2116 TLiwGenericParam entity; |
|
2117 TLiwVariant entityname; |
|
2118 TLiwGenericParam key; |
|
2119 TLiwVariant keyname; |
|
2120 |
|
2121 entityname.Set(KGeneral); |
|
2122 entity.SetNameAndValueL(KEntity,entityname); |
|
2123 |
|
2124 keyname.Set(KPridictiveText); |
|
2125 key.SetNameAndValueL(KKey,keyname); |
|
2126 |
|
2127 //sysdata as map |
|
2128 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2129 CleanupStack::PushL(map); |
|
2130 |
|
2131 TLiwVariant sysdata((TInt32)-5); |
|
2132 map->InsertL(KStatus,sysdata); |
|
2133 sysdata.Reset(); |
|
2134 |
|
2135 TLiwVariant sysparam(map); |
|
2136 TLiwGenericParam element ; |
|
2137 element.SetNameAndValueL(KSysData,sysparam); |
|
2138 sysparam.Reset(); |
|
2139 |
|
2140 iInparam->AppendL(entity); |
|
2141 |
|
2142 iInparam->AppendL(key); |
|
2143 iInparam->AppendL(element); |
|
2144 |
|
2145 element.Reset(); |
|
2146 |
|
2147 map->DecRef(); |
|
2148 CleanupStack::Pop(map); |
|
2149 |
|
2150 entity.Reset(); |
|
2151 entityname.Reset(); |
|
2152 key.Reset(); |
|
2153 keyname.Reset(); |
|
2154 sysdata.Reset(); |
|
2155 |
|
2156 //Set Vibra |
|
2157 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2158 result = err; |
|
2159 if(err == KErrNone) |
|
2160 { |
|
2161 pos = 0; |
|
2162 iOutparam->FindFirst( pos, KErrorCode ); |
|
2163 if(pos != KErrNotFound) |
|
2164 { |
|
2165 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2166 } |
|
2167 iOutparam->Reset(); |
|
2168 iInparam->Reset(); |
|
2169 |
|
2170 TBuf<50> buf; |
|
2171 buf.AppendNum(result); |
|
2172 iLog->Log(buf); |
|
2173 if(result != SErrNone) |
|
2174 { |
|
2175 |
|
2176 result = 0; |
|
2177 } |
|
2178 |
|
2179 else |
|
2180 { |
|
2181 result = -1; |
|
2182 } |
|
2183 } |
|
2184 |
|
2185 } |
|
2186 else |
|
2187 { |
|
2188 result = -1; |
|
2189 } |
|
2190 } |
|
2191 |
|
2192 __UHEAP_MARKEND; |
|
2193 return result; |
|
2194 |
|
2195 } |
|
2196 |
|
2197 |
|
2198 // ----------------------------------------------------------------------------- |
|
2199 // Ctsysinfoprovidertests::SetVibra |
|
2200 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2201 // ----------------------------------------------------------------------------- |
|
2202 // |
|
2203 TInt Ctsysinfoprovidertests::SetVibra( CStifItemParser& /*aItem*/ ) |
|
2204 { |
|
2205 TInt result =KErrNone; |
|
2206 |
|
2207 _LIT( KExample, "SupportedLang:" ); |
|
2208 iLog->Log( KExample ); |
|
2209 TInt pos = 0; |
|
2210 |
|
2211 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2212 |
|
2213 Init(); |
|
2214 __UHEAP_MARK; |
|
2215 |
|
2216 TLiwGenericParam entity; |
|
2217 TLiwVariant entityname; |
|
2218 TLiwGenericParam key; |
|
2219 TLiwVariant keyname; |
|
2220 |
|
2221 entityname.Set(KGeneral); |
|
2222 entity.SetNameAndValueL(KEntity,entityname); |
|
2223 |
|
2224 keyname.Set(KVibraActive); |
|
2225 key.SetNameAndValueL(KKey,keyname); |
|
2226 |
|
2227 //sysdata as map |
|
2228 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2229 CleanupStack::PushL(map); |
|
2230 |
|
2231 TLiwVariant sysdata((TInt32)50); |
|
2232 map->InsertL(KStatus,sysdata); |
|
2233 sysdata.Reset(); |
|
2234 |
|
2235 TLiwVariant sysparam(map); |
|
2236 TLiwGenericParam element ; |
|
2237 element.SetNameAndValueL(KSysData,sysparam); |
|
2238 sysparam.Reset(); |
|
2239 |
|
2240 iInparam->AppendL(entity); |
|
2241 |
|
2242 iInparam->AppendL(key); |
|
2243 iInparam->AppendL(element); |
|
2244 |
|
2245 element.Reset(); |
|
2246 |
|
2247 map->DecRef(); |
|
2248 CleanupStack::Pop(map); |
|
2249 |
|
2250 entity.Reset(); |
|
2251 entityname.Reset(); |
|
2252 key.Reset(); |
|
2253 keyname.Reset(); |
|
2254 sysdata.Reset(); |
|
2255 |
|
2256 //Set Vibra |
|
2257 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2258 result = err; |
|
2259 if(err == KErrNone) |
|
2260 { |
|
2261 pos = 0; |
|
2262 iOutparam->FindFirst( pos, KErrorCode ); |
|
2263 if(pos != KErrNotFound) |
|
2264 { |
|
2265 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2266 } |
|
2267 iOutparam->Reset(); |
|
2268 iInparam->Reset(); |
|
2269 |
|
2270 TBuf<50> buf; |
|
2271 buf.AppendNum(result); |
|
2272 iLog->Log(buf); |
|
2273 if(result != SErrNone) |
|
2274 { |
|
2275 result = 0; |
|
2276 |
|
2277 TLiwGenericParam entity; |
|
2278 TLiwVariant entityname; |
|
2279 TLiwGenericParam key; |
|
2280 TLiwVariant keyname; |
|
2281 |
|
2282 entityname.Set(KGeneral); |
|
2283 entity.SetNameAndValueL(KEntity,entityname); |
|
2284 |
|
2285 keyname.Set(KVibraActive); |
|
2286 key.SetNameAndValueL(KKey,keyname); |
|
2287 |
|
2288 //sysdata as map |
|
2289 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2290 CleanupStack::PushL(map); |
|
2291 |
|
2292 TLiwVariant sysdata((TInt32)-5); |
|
2293 map->InsertL(KStatus,sysdata); |
|
2294 sysdata.Reset(); |
|
2295 |
|
2296 TLiwVariant sysparam(map); |
|
2297 TLiwGenericParam element ; |
|
2298 element.SetNameAndValueL(KSysData,sysparam); |
|
2299 sysparam.Reset(); |
|
2300 |
|
2301 iInparam->AppendL(entity); |
|
2302 |
|
2303 iInparam->AppendL(key); |
|
2304 iInparam->AppendL(element); |
|
2305 |
|
2306 element.Reset(); |
|
2307 |
|
2308 map->DecRef(); |
|
2309 CleanupStack::Pop(map); |
|
2310 |
|
2311 entity.Reset(); |
|
2312 entityname.Reset(); |
|
2313 key.Reset(); |
|
2314 keyname.Reset(); |
|
2315 sysdata.Reset(); |
|
2316 |
|
2317 //Set Vibra |
|
2318 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2319 result = err; |
|
2320 if(err == KErrNone) |
|
2321 { |
|
2322 pos = 0; |
|
2323 |
|
2324 iOutparam->FindFirst( pos, KErrorCode ); |
|
2325 if(pos != KErrNotFound) |
|
2326 { |
|
2327 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2328 } |
|
2329 iOutparam->Reset(); |
|
2330 iInparam->Reset(); |
|
2331 |
|
2332 TBuf<50> buf; |
|
2333 buf.AppendNum(result); |
|
2334 iLog->Log(buf); |
|
2335 if(result != SErrNone) |
|
2336 { |
|
2337 result = 0; |
|
2338 } |
|
2339 else |
|
2340 { |
|
2341 result = -1; |
|
2342 } |
|
2343 } |
|
2344 } |
|
2345 else |
|
2346 { |
|
2347 result = -1; |
|
2348 } |
|
2349 } |
|
2350 |
|
2351 __UHEAP_MARKEND; |
|
2352 return result; |
|
2353 |
|
2354 } |
|
2355 |
|
2356 // ----------------------------------------------------------------------------- |
|
2357 // Ctsysinfoprovidertests::SetBluetoothStatus |
|
2358 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2359 // ----------------------------------------------------------------------------- |
|
2360 // |
|
2361 TInt Ctsysinfoprovidertests::SetBluetoothStatus( CStifItemParser& /*aItem*/ ) |
|
2362 { |
|
2363 TInt result =KErrNone; |
|
2364 |
|
2365 _LIT( KExample, "SupportedLang:" ); |
|
2366 iLog->Log( KExample ); |
|
2367 TInt pos = 0; |
|
2368 |
|
2369 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2370 |
|
2371 Init(); |
|
2372 __UHEAP_MARK; |
|
2373 |
|
2374 TLiwGenericParam entity; |
|
2375 TLiwVariant entityname; |
|
2376 TLiwGenericParam key; |
|
2377 TLiwVariant keyname; |
|
2378 |
|
2379 entityname.Set(KConnectivity); |
|
2380 entity.SetNameAndValueL(KEntity,entityname); |
|
2381 |
|
2382 keyname.Set(KBlueTooth); |
|
2383 key.SetNameAndValueL(KKey,keyname); |
|
2384 |
|
2385 //sysdata as map |
|
2386 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2387 CleanupStack::PushL(map); |
|
2388 |
|
2389 TLiwVariant sysdata((TInt32)50); |
|
2390 map->InsertL(KStatus,sysdata); |
|
2391 sysdata.Reset(); |
|
2392 |
|
2393 TLiwVariant sysparam(map); |
|
2394 TLiwGenericParam element ; |
|
2395 element.SetNameAndValueL(KSysData,sysparam); |
|
2396 sysparam.Reset(); |
|
2397 |
|
2398 iInparam->AppendL(entity); |
|
2399 |
|
2400 iInparam->AppendL(key); |
|
2401 iInparam->AppendL(element); |
|
2402 |
|
2403 element.Reset(); |
|
2404 |
|
2405 map->DecRef(); |
|
2406 CleanupStack::Pop(map); |
|
2407 |
|
2408 entity.Reset(); |
|
2409 entityname.Reset(); |
|
2410 key.Reset(); |
|
2411 keyname.Reset(); |
|
2412 sysdata.Reset(); |
|
2413 |
|
2414 //Set Vibra |
|
2415 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2416 result = err; |
|
2417 if(err == KErrNone) |
|
2418 { |
|
2419 pos = 0; |
|
2420 iOutparam->FindFirst( pos, KErrorCode ); |
|
2421 if(pos != KErrNotFound) |
|
2422 { |
|
2423 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2424 } |
|
2425 iOutparam->Reset(); |
|
2426 iInparam->Reset(); |
|
2427 |
|
2428 TBuf<50> buf; |
|
2429 buf.AppendNum(result); |
|
2430 iLog->Log(buf); |
|
2431 if(result != SErrNone) |
|
2432 { |
|
2433 result = 0; |
|
2434 |
|
2435 TLiwGenericParam entity; |
|
2436 TLiwVariant entityname; |
|
2437 TLiwGenericParam key; |
|
2438 TLiwVariant keyname; |
|
2439 |
|
2440 entityname.Set(KConnectivity); |
|
2441 entity.SetNameAndValueL(KEntity,entityname); |
|
2442 |
|
2443 keyname.Set(KBlueTooth); |
|
2444 key.SetNameAndValueL(KKey,keyname); |
|
2445 |
|
2446 //sysdata as map |
|
2447 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2448 CleanupStack::PushL(map); |
|
2449 |
|
2450 TLiwVariant sysdata((TInt32)-5); |
|
2451 map->InsertL(KStatus,sysdata); |
|
2452 sysdata.Reset(); |
|
2453 |
|
2454 TLiwVariant sysparam(map); |
|
2455 TLiwGenericParam element ; |
|
2456 element.SetNameAndValueL(KSysData,sysparam); |
|
2457 sysparam.Reset(); |
|
2458 |
|
2459 iInparam->AppendL(entity); |
|
2460 |
|
2461 iInparam->AppendL(key); |
|
2462 iInparam->AppendL(element); |
|
2463 |
|
2464 element.Reset(); |
|
2465 |
|
2466 map->DecRef(); |
|
2467 CleanupStack::Pop(map); |
|
2468 |
|
2469 entity.Reset(); |
|
2470 entityname.Reset(); |
|
2471 key.Reset(); |
|
2472 keyname.Reset(); |
|
2473 sysdata.Reset(); |
|
2474 |
|
2475 //Set Vibra |
|
2476 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2477 result = err; |
|
2478 if(err == KErrNone) |
|
2479 { |
|
2480 pos = 0; |
|
2481 iOutparam->FindFirst( pos, KErrorCode ); |
|
2482 if(pos != KErrNotFound) |
|
2483 { |
|
2484 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2485 } |
|
2486 iOutparam->Reset(); |
|
2487 iInparam->Reset(); |
|
2488 |
|
2489 TBuf<50> buf; |
|
2490 buf.AppendNum(result); |
|
2491 iLog->Log(buf); |
|
2492 if(result != SErrNone) |
|
2493 { |
|
2494 result = 0; |
|
2495 } |
|
2496 else |
|
2497 { |
|
2498 result = -1; |
|
2499 } |
|
2500 } |
|
2501 } |
|
2502 else |
|
2503 { |
|
2504 result = -1; |
|
2505 } |
|
2506 } |
|
2507 |
|
2508 __UHEAP_MARKEND; |
|
2509 return result; |
|
2510 |
|
2511 } |
|
2512 |
|
2513 // ----------------------------------------------------------------------------- |
|
2514 // Ctsysinfoprovidertests::SetInfraredStatus |
|
2515 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2516 // ----------------------------------------------------------------------------- |
|
2517 // |
|
2518 TInt Ctsysinfoprovidertests::SetInfraredStatus( CStifItemParser& /*aItem*/ ) |
|
2519 { |
|
2520 TInt result =KErrNone; |
|
2521 |
|
2522 _LIT( KExample, "SupportedLang:" ); |
|
2523 iLog->Log( KExample ); |
|
2524 TInt pos = 0; |
|
2525 |
|
2526 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2527 |
|
2528 Init(); |
|
2529 __UHEAP_MARK; |
|
2530 |
|
2531 TLiwGenericParam entity; |
|
2532 TLiwVariant entityname; |
|
2533 TLiwGenericParam key; |
|
2534 TLiwVariant keyname; |
|
2535 |
|
2536 entityname.Set(KConnectivity); |
|
2537 entity.SetNameAndValueL(KEntity,entityname); |
|
2538 |
|
2539 keyname.Set(KInfraRed); |
|
2540 key.SetNameAndValueL(KKey,keyname); |
|
2541 |
|
2542 //sysdata as map |
|
2543 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2544 CleanupStack::PushL(map); |
|
2545 |
|
2546 TLiwVariant sysdata((TInt32)50); |
|
2547 map->InsertL(KStatus,sysdata); |
|
2548 sysdata.Reset(); |
|
2549 |
|
2550 TLiwVariant sysparam(map); |
|
2551 TLiwGenericParam element ; |
|
2552 element.SetNameAndValueL(KSysData,sysparam); |
|
2553 sysparam.Reset(); |
|
2554 |
|
2555 iInparam->AppendL(entity); |
|
2556 |
|
2557 iInparam->AppendL(key); |
|
2558 iInparam->AppendL(element); |
|
2559 |
|
2560 element.Reset(); |
|
2561 |
|
2562 map->DecRef(); |
|
2563 CleanupStack::Pop(map); |
|
2564 |
|
2565 entity.Reset(); |
|
2566 entityname.Reset(); |
|
2567 key.Reset(); |
|
2568 keyname.Reset(); |
|
2569 sysdata.Reset(); |
|
2570 |
|
2571 //Set Vibra |
|
2572 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2573 result = err; |
|
2574 if(err == KErrNone) |
|
2575 { |
|
2576 pos = 0; |
|
2577 iOutparam->FindFirst( pos, KErrorCode ); |
|
2578 if(pos != KErrNotFound) |
|
2579 { |
|
2580 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2581 } |
|
2582 iOutparam->Reset(); |
|
2583 iInparam->Reset(); |
|
2584 |
|
2585 TBuf<50> buf; |
|
2586 buf.AppendNum(result); |
|
2587 iLog->Log(buf); |
|
2588 if(result != SErrNone) |
|
2589 { |
|
2590 result = 0; |
|
2591 |
|
2592 TLiwGenericParam entity; |
|
2593 TLiwVariant entityname; |
|
2594 TLiwGenericParam key; |
|
2595 TLiwVariant keyname; |
|
2596 |
|
2597 entityname.Set(KConnectivity); |
|
2598 entity.SetNameAndValueL(KEntity,entityname); |
|
2599 |
|
2600 keyname.Set(KInfraRed); |
|
2601 key.SetNameAndValueL(KKey,keyname); |
|
2602 |
|
2603 //sysdata as map |
|
2604 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2605 CleanupStack::PushL(map); |
|
2606 |
|
2607 TLiwVariant sysdata((TInt32)-5); |
|
2608 map->InsertL(KStatus,sysdata); |
|
2609 sysdata.Reset(); |
|
2610 |
|
2611 TLiwVariant sysparam(map); |
|
2612 TLiwGenericParam element ; |
|
2613 element.SetNameAndValueL(KSysData,sysparam); |
|
2614 sysparam.Reset(); |
|
2615 |
|
2616 iInparam->AppendL(entity); |
|
2617 |
|
2618 iInparam->AppendL(key); |
|
2619 iInparam->AppendL(element); |
|
2620 |
|
2621 element.Reset(); |
|
2622 |
|
2623 map->DecRef(); |
|
2624 CleanupStack::Pop(map); |
|
2625 |
|
2626 entity.Reset(); |
|
2627 entityname.Reset(); |
|
2628 key.Reset(); |
|
2629 keyname.Reset(); |
|
2630 sysdata.Reset(); |
|
2631 |
|
2632 //Set Vibra |
|
2633 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2634 result = err; |
|
2635 if(err == KErrNone) |
|
2636 { |
|
2637 pos = 0; |
|
2638 |
|
2639 iOutparam->FindFirst( pos, KErrorCode ); |
|
2640 if(pos != KErrNotFound) |
|
2641 { |
|
2642 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2643 } |
|
2644 iOutparam->Reset(); |
|
2645 iInparam->Reset(); |
|
2646 |
|
2647 TBuf<50> buf; |
|
2648 buf.AppendNum(result); |
|
2649 iLog->Log(buf); |
|
2650 if(result != SErrNone) |
|
2651 { |
|
2652 result = 0; |
|
2653 } |
|
2654 else |
|
2655 { |
|
2656 result = -1; |
|
2657 } |
|
2658 } |
|
2659 } |
|
2660 else |
|
2661 { |
|
2662 result = -1; |
|
2663 } |
|
2664 } |
|
2665 |
|
2666 __UHEAP_MARKEND; |
|
2667 return result; |
|
2668 |
|
2669 } |
|
2670 |
|
2671 // ----------------------------------------------------------------------------- |
|
2672 // Ctsysinfoprovidertests::SetInfraredStatus |
|
2673 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2674 // ----------------------------------------------------------------------------- |
|
2675 // |
|
2676 TInt Ctsysinfoprovidertests::SetBrigthness( CStifItemParser& /*aItem*/ ) |
|
2677 { |
|
2678 TInt result =KErrNone; |
|
2679 |
|
2680 _LIT( KExample, "SupportedLang:" ); |
|
2681 iLog->Log( KExample ); |
|
2682 TInt pos = 0; |
|
2683 |
|
2684 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2685 |
|
2686 Init(); |
|
2687 __UHEAP_MARK; |
|
2688 |
|
2689 TLiwGenericParam entity; |
|
2690 TLiwVariant entityname; |
|
2691 TLiwGenericParam key; |
|
2692 TLiwVariant keyname; |
|
2693 |
|
2694 entityname.Set(KDisplay); |
|
2695 entity.SetNameAndValueL(KEntity,entityname); |
|
2696 |
|
2697 keyname.Set(KBrightness); |
|
2698 key.SetNameAndValueL(KKey,keyname); |
|
2699 |
|
2700 //sysdata as map |
|
2701 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2702 CleanupStack::PushL(map); |
|
2703 |
|
2704 TLiwVariant sysdata((TInt32)0); |
|
2705 map->InsertL(KStatus,sysdata); |
|
2706 sysdata.Reset(); |
|
2707 |
|
2708 TLiwVariant sysparam(map); |
|
2709 TLiwGenericParam element ; |
|
2710 element.SetNameAndValueL(KSysData,sysparam); |
|
2711 sysparam.Reset(); |
|
2712 |
|
2713 iInparam->AppendL(entity); |
|
2714 |
|
2715 iInparam->AppendL(key); |
|
2716 iInparam->AppendL(element); |
|
2717 |
|
2718 element.Reset(); |
|
2719 |
|
2720 map->DecRef(); |
|
2721 CleanupStack::Pop(map); |
|
2722 |
|
2723 entity.Reset(); |
|
2724 entityname.Reset(); |
|
2725 key.Reset(); |
|
2726 keyname.Reset(); |
|
2727 sysdata.Reset(); |
|
2728 |
|
2729 //Set Vibra |
|
2730 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2731 result = err; |
|
2732 if(err == KErrNone) |
|
2733 { |
|
2734 pos = 0; |
|
2735 |
|
2736 iOutparam->FindFirst( pos, KErrorCode ); |
|
2737 if(pos != KErrNotFound) |
|
2738 { |
|
2739 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2740 } |
|
2741 iOutparam->Reset(); |
|
2742 iInparam->Reset(); |
|
2743 |
|
2744 TBuf<50> buf; |
|
2745 buf.AppendNum(result); |
|
2746 iLog->Log(buf); |
|
2747 if(result != SErrNone) |
|
2748 { |
|
2749 result = 0; |
|
2750 |
|
2751 TLiwGenericParam entity; |
|
2752 TLiwVariant entityname; |
|
2753 TLiwGenericParam key; |
|
2754 TLiwVariant keyname; |
|
2755 |
|
2756 entityname.Set(KDisplay); |
|
2757 entity.SetNameAndValueL(KEntity,entityname); |
|
2758 |
|
2759 keyname.Set(KBrightness); |
|
2760 key.SetNameAndValueL(KKey,keyname); |
|
2761 |
|
2762 //sysdata as map |
|
2763 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2764 CleanupStack::PushL(map); |
|
2765 |
|
2766 TLiwVariant sysdata((TInt32)125); |
|
2767 map->InsertL(KStatus,sysdata); |
|
2768 sysdata.Reset(); |
|
2769 |
|
2770 TLiwVariant sysparam(map); |
|
2771 TLiwGenericParam element ; |
|
2772 element.SetNameAndValueL(KSysData,sysparam); |
|
2773 sysparam.Reset(); |
|
2774 |
|
2775 iInparam->AppendL(entity); |
|
2776 |
|
2777 iInparam->AppendL(key); |
|
2778 iInparam->AppendL(element); |
|
2779 |
|
2780 element.Reset(); |
|
2781 |
|
2782 map->DecRef(); |
|
2783 CleanupStack::Pop(map); |
|
2784 |
|
2785 entity.Reset(); |
|
2786 entityname.Reset(); |
|
2787 key.Reset(); |
|
2788 keyname.Reset(); |
|
2789 sysdata.Reset(); |
|
2790 |
|
2791 //Set Vibra |
|
2792 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2793 result = err; |
|
2794 if(err == KErrNone) |
|
2795 { |
|
2796 pos = 0; |
|
2797 iOutparam->FindFirst( pos, KErrorCode ); |
|
2798 if(pos != KErrNotFound) |
|
2799 { |
|
2800 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2801 } |
|
2802 iOutparam->Reset(); |
|
2803 iInparam->Reset(); |
|
2804 |
|
2805 TBuf<50> buf; |
|
2806 buf.AppendNum(result); |
|
2807 iLog->Log(buf); |
|
2808 if(result != SErrNone) |
|
2809 { |
|
2810 result = 0; |
|
2811 } |
|
2812 else |
|
2813 { |
|
2814 result = -1; |
|
2815 } |
|
2816 } |
|
2817 } |
|
2818 else |
|
2819 { |
|
2820 result = -1; |
|
2821 } |
|
2822 } |
|
2823 |
|
2824 __UHEAP_MARKEND; |
|
2825 return result; |
|
2826 |
|
2827 } |
|
2828 |
|
2829 // ----------------------------------------------------------------------------- |
|
2830 // Ctsysinfoprovidertests::SetScreenSaverTimeout |
|
2831 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2832 // ----------------------------------------------------------------------------- |
|
2833 // |
|
2834 TInt Ctsysinfoprovidertests::SetScreenSaverTimeout( CStifItemParser& /*aItem*/ ) |
|
2835 { |
|
2836 TInt result =KErrNone; |
|
2837 |
|
2838 _LIT( KExample, "SupportedLang:" ); |
|
2839 iLog->Log( KExample ); |
|
2840 TInt pos = 0; |
|
2841 |
|
2842 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
2843 |
|
2844 Init(); |
|
2845 __UHEAP_MARK; |
|
2846 |
|
2847 TLiwGenericParam entity; |
|
2848 TLiwVariant entityname; |
|
2849 TLiwGenericParam key; |
|
2850 TLiwVariant keyname; |
|
2851 |
|
2852 entityname.Set(KDisplay); |
|
2853 entity.SetNameAndValueL(KEntity,entityname); |
|
2854 |
|
2855 keyname.Set(KScreenSaverTimeOut); |
|
2856 key.SetNameAndValueL(KKey,keyname); |
|
2857 |
|
2858 //sysdata as map |
|
2859 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2860 CleanupStack::PushL(map); |
|
2861 |
|
2862 TLiwVariant sysdata((TInt32)-125); |
|
2863 map->InsertL(KStatus,sysdata); |
|
2864 sysdata.Reset(); |
|
2865 |
|
2866 TLiwVariant sysparam(map); |
|
2867 TLiwGenericParam element ; |
|
2868 element.SetNameAndValueL(KSysData,sysparam); |
|
2869 sysparam.Reset(); |
|
2870 |
|
2871 iInparam->AppendL(entity); |
|
2872 |
|
2873 iInparam->AppendL(key); |
|
2874 iInparam->AppendL(element); |
|
2875 |
|
2876 element.Reset(); |
|
2877 |
|
2878 map->DecRef(); |
|
2879 CleanupStack::Pop(map); |
|
2880 |
|
2881 entity.Reset(); |
|
2882 entityname.Reset(); |
|
2883 key.Reset(); |
|
2884 keyname.Reset(); |
|
2885 sysdata.Reset(); |
|
2886 |
|
2887 //Set Vibra |
|
2888 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2889 result = err; |
|
2890 if(err == KErrNone) |
|
2891 { |
|
2892 pos = 0; |
|
2893 iOutparam->FindFirst( pos, KErrorCode ); |
|
2894 if(pos != KErrNotFound) |
|
2895 { |
|
2896 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2897 } |
|
2898 iOutparam->Reset(); |
|
2899 iInparam->Reset(); |
|
2900 |
|
2901 TBuf<50> buf; |
|
2902 buf.AppendNum(result); |
|
2903 iLog->Log(buf); |
|
2904 if(result != SErrNone) |
|
2905 { |
|
2906 result = 0; |
|
2907 |
|
2908 TLiwGenericParam entity; |
|
2909 TLiwVariant entityname; |
|
2910 TLiwGenericParam key; |
|
2911 TLiwVariant keyname; |
|
2912 |
|
2913 entityname.Set(KDisplay); |
|
2914 entity.SetNameAndValueL(KEntity,entityname); |
|
2915 |
|
2916 keyname.Set(KScreenSaverTimeOut); |
|
2917 key.SetNameAndValueL(KKey,keyname); |
|
2918 |
|
2919 //sysdata as map |
|
2920 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
2921 CleanupStack::PushL(map); |
|
2922 |
|
2923 TLiwVariant sysdata((TInt32)1225); |
|
2924 map->InsertL(KStatus,sysdata); |
|
2925 sysdata.Reset(); |
|
2926 |
|
2927 TLiwVariant sysparam(map); |
|
2928 TLiwGenericParam element ; |
|
2929 element.SetNameAndValueL(KSysData,sysparam); |
|
2930 sysparam.Reset(); |
|
2931 |
|
2932 iInparam->AppendL(entity); |
|
2933 |
|
2934 iInparam->AppendL(key); |
|
2935 iInparam->AppendL(element); |
|
2936 |
|
2937 element.Reset(); |
|
2938 |
|
2939 map->DecRef(); |
|
2940 CleanupStack::Pop(map); |
|
2941 |
|
2942 entity.Reset(); |
|
2943 entityname.Reset(); |
|
2944 key.Reset(); |
|
2945 keyname.Reset(); |
|
2946 sysdata.Reset(); |
|
2947 |
|
2948 //Set Vibra |
|
2949 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
2950 result = err; |
|
2951 if(err == KErrNone) |
|
2952 { |
|
2953 pos = 0; |
|
2954 iOutparam->FindFirst( pos, KErrorCode ); |
|
2955 if(pos != KErrNotFound) |
|
2956 { |
|
2957 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
2958 } |
|
2959 iOutparam->Reset(); |
|
2960 iInparam->Reset(); |
|
2961 |
|
2962 TBuf<50> buf; |
|
2963 buf.AppendNum(result); |
|
2964 iLog->Log(buf); |
|
2965 if(result != SErrNone) |
|
2966 { |
|
2967 result = 0; |
|
2968 } |
|
2969 else |
|
2970 { |
|
2971 result = -1; |
|
2972 } |
|
2973 } |
|
2974 } |
|
2975 else |
|
2976 { |
|
2977 result = -1; |
|
2978 } |
|
2979 } |
|
2980 |
|
2981 __UHEAP_MARKEND; |
|
2982 return result; |
|
2983 |
|
2984 } |
|
2985 |
|
2986 // ----------------------------------------------------------------------------- |
|
2987 // Ctsysinfoprovidertests::SetScreenSaverTimeout |
|
2988 // with KLiwOptASyncronous bit set for a synchronous request. |
|
2989 // ----------------------------------------------------------------------------- |
|
2990 // |
|
2991 TInt Ctsysinfoprovidertests::SetKeyGuardTimeout( CStifItemParser& /*aItem*/) |
|
2992 { |
|
2993 TInt result =KErrNone; |
|
2994 |
|
2995 _LIT( KExample, "SupportedLang:" ); |
|
2996 iLog->Log( KExample ); |
|
2997 TInt pos = 0; |
|
2998 |
|
2999 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
3000 |
|
3001 Init(); |
|
3002 __UHEAP_MARK; |
|
3003 |
|
3004 TLiwGenericParam entity; |
|
3005 TLiwVariant entityname; |
|
3006 TLiwGenericParam key; |
|
3007 TLiwVariant keyname; |
|
3008 |
|
3009 entityname.Set(KDisplay); |
|
3010 entity.SetNameAndValueL(KEntity,entityname); |
|
3011 |
|
3012 keyname.Set(KKeyGaurdTime); |
|
3013 key.SetNameAndValueL(KKey,keyname); |
|
3014 |
|
3015 //sysdata as map |
|
3016 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3017 CleanupStack::PushL(map); |
|
3018 |
|
3019 TLiwVariant sysdata((TInt32)-100); |
|
3020 map->InsertL(KStatus,sysdata); |
|
3021 sysdata.Reset(); |
|
3022 |
|
3023 TLiwVariant sysparam(map); |
|
3024 TLiwGenericParam element ; |
|
3025 element.SetNameAndValueL(KSysData,sysparam); |
|
3026 sysparam.Reset(); |
|
3027 |
|
3028 iInparam->AppendL(entity); |
|
3029 |
|
3030 iInparam->AppendL(key); |
|
3031 iInparam->AppendL(element); |
|
3032 |
|
3033 element.Reset(); |
|
3034 |
|
3035 map->DecRef(); |
|
3036 CleanupStack::Pop(map); |
|
3037 |
|
3038 entity.Reset(); |
|
3039 entityname.Reset(); |
|
3040 key.Reset(); |
|
3041 keyname.Reset(); |
|
3042 sysdata.Reset(); |
|
3043 |
|
3044 //Set Vibra |
|
3045 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3046 result = err; |
|
3047 if(err == KErrNone) |
|
3048 { |
|
3049 pos = 0; |
|
3050 iOutparam->FindFirst( pos, KErrorCode ); |
|
3051 if(pos != KErrNotFound) |
|
3052 { |
|
3053 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3054 } |
|
3055 iOutparam->Reset(); |
|
3056 iInparam->Reset(); |
|
3057 |
|
3058 TBuf<50> buf; |
|
3059 buf.AppendNum(result); |
|
3060 iLog->Log(buf); |
|
3061 if(result != SErrNone) |
|
3062 { |
|
3063 result = 0; |
|
3064 |
|
3065 TLiwGenericParam entity; |
|
3066 TLiwVariant entityname; |
|
3067 TLiwGenericParam key; |
|
3068 TLiwVariant keyname; |
|
3069 |
|
3070 entityname.Set(KDisplay); |
|
3071 entity.SetNameAndValueL(KEntity,entityname); |
|
3072 |
|
3073 keyname.Set(KKeyGaurdTime); |
|
3074 key.SetNameAndValueL(KKey,keyname); |
|
3075 |
|
3076 //sysdata as map |
|
3077 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3078 CleanupStack::PushL(map); |
|
3079 |
|
3080 TLiwVariant sysdata((TInt32)5000); |
|
3081 map->InsertL(KStatus,sysdata); |
|
3082 sysdata.Reset(); |
|
3083 |
|
3084 TLiwVariant sysparam(map); |
|
3085 TLiwGenericParam element ; |
|
3086 element.SetNameAndValueL(KSysData,sysparam); |
|
3087 sysparam.Reset(); |
|
3088 |
|
3089 iInparam->AppendL(entity); |
|
3090 |
|
3091 iInparam->AppendL(key); |
|
3092 iInparam->AppendL(element); |
|
3093 |
|
3094 element.Reset(); |
|
3095 |
|
3096 map->DecRef(); |
|
3097 CleanupStack::Pop(map); |
|
3098 |
|
3099 entity.Reset(); |
|
3100 entityname.Reset(); |
|
3101 key.Reset(); |
|
3102 keyname.Reset(); |
|
3103 sysdata.Reset(); |
|
3104 |
|
3105 //Set Vibra |
|
3106 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3107 result = err; |
|
3108 if(err == KErrNone) |
|
3109 { |
|
3110 pos = 0; |
|
3111 iOutparam->FindFirst( pos, KErrorCode ); |
|
3112 if(pos != KErrNotFound) |
|
3113 { |
|
3114 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3115 } |
|
3116 iOutparam->Reset(); |
|
3117 iInparam->Reset(); |
|
3118 |
|
3119 TBuf<50> buf; |
|
3120 buf.AppendNum(result); |
|
3121 iLog->Log(buf); |
|
3122 if(result != SErrNone) |
|
3123 { |
|
3124 result = 0; |
|
3125 } |
|
3126 else |
|
3127 { |
|
3128 result = -1; |
|
3129 } |
|
3130 } |
|
3131 } |
|
3132 else |
|
3133 { |
|
3134 result = -1; |
|
3135 } |
|
3136 } |
|
3137 |
|
3138 __UHEAP_MARKEND; |
|
3139 return result; |
|
3140 |
|
3141 } |
|
3142 |
|
3143 |
|
3144 // ----------------------------------------------------------------------------- |
|
3145 // Ctsysinfoprovidertests::SetScreenSaverTimeout |
|
3146 // with KLiwOptASyncronous bit set for a synchronous request. |
|
3147 // ----------------------------------------------------------------------------- |
|
3148 // |
|
3149 TInt Ctsysinfoprovidertests::SetAutoLockTimeout( CStifItemParser& /*aItem*/) |
|
3150 { |
|
3151 TInt result =KErrNone; |
|
3152 |
|
3153 _LIT( KExample, "SupportedLang:" ); |
|
3154 iLog->Log( KExample ); |
|
3155 TInt pos = 0; |
|
3156 |
|
3157 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
3158 |
|
3159 Init(); |
|
3160 __UHEAP_MARK; |
|
3161 |
|
3162 TLiwGenericParam entity; |
|
3163 TLiwVariant entityname; |
|
3164 TLiwGenericParam key; |
|
3165 TLiwVariant keyname; |
|
3166 |
|
3167 entityname.Set(KDisplay); |
|
3168 entity.SetNameAndValueL(KEntity,entityname); |
|
3169 |
|
3170 keyname.Set(KAutoLockTime); |
|
3171 key.SetNameAndValueL(KKey,keyname); |
|
3172 |
|
3173 //sysdata as map |
|
3174 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3175 CleanupStack::PushL(map); |
|
3176 |
|
3177 TLiwVariant sysdata((TInt32)-100); |
|
3178 map->InsertL(KStatus,sysdata); |
|
3179 sysdata.Reset(); |
|
3180 |
|
3181 TLiwVariant sysparam(map); |
|
3182 TLiwGenericParam element ; |
|
3183 element.SetNameAndValueL(KSysData,sysparam); |
|
3184 sysparam.Reset(); |
|
3185 |
|
3186 iInparam->AppendL(entity); |
|
3187 |
|
3188 iInparam->AppendL(key); |
|
3189 iInparam->AppendL(element); |
|
3190 |
|
3191 element.Reset(); |
|
3192 |
|
3193 map->DecRef(); |
|
3194 CleanupStack::Pop(map); |
|
3195 |
|
3196 entity.Reset(); |
|
3197 entityname.Reset(); |
|
3198 key.Reset(); |
|
3199 keyname.Reset(); |
|
3200 sysdata.Reset(); |
|
3201 |
|
3202 //Set Vibra |
|
3203 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3204 result = err; |
|
3205 if(err == KErrNone) |
|
3206 { |
|
3207 pos = 0; |
|
3208 iOutparam->FindFirst( pos, KErrorCode ); |
|
3209 if(pos != KErrNotFound) |
|
3210 { |
|
3211 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3212 } |
|
3213 iOutparam->Reset(); |
|
3214 iInparam->Reset(); |
|
3215 |
|
3216 TBuf<50> buf; |
|
3217 buf.AppendNum(result); |
|
3218 iLog->Log(buf); |
|
3219 if(result != SErrNone) |
|
3220 { |
|
3221 result = 0; |
|
3222 |
|
3223 TLiwGenericParam entity; |
|
3224 TLiwVariant entityname; |
|
3225 TLiwGenericParam key; |
|
3226 TLiwVariant keyname; |
|
3227 |
|
3228 entityname.Set(KDisplay); |
|
3229 entity.SetNameAndValueL(KEntity,entityname); |
|
3230 |
|
3231 keyname.Set(KAutoLockTime); |
|
3232 key.SetNameAndValueL(KKey,keyname); |
|
3233 |
|
3234 //sysdata as map |
|
3235 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3236 CleanupStack::PushL(map); |
|
3237 |
|
3238 TLiwVariant sysdata((TInt32)5000); |
|
3239 map->InsertL(KStatus,sysdata); |
|
3240 sysdata.Reset(); |
|
3241 |
|
3242 TLiwVariant sysparam(map); |
|
3243 TLiwGenericParam element ; |
|
3244 element.SetNameAndValueL(KSysData,sysparam); |
|
3245 sysparam.Reset(); |
|
3246 |
|
3247 iInparam->AppendL(entity); |
|
3248 |
|
3249 iInparam->AppendL(key); |
|
3250 iInparam->AppendL(element); |
|
3251 |
|
3252 element.Reset(); |
|
3253 |
|
3254 map->DecRef(); |
|
3255 CleanupStack::Pop(map); |
|
3256 |
|
3257 entity.Reset(); |
|
3258 entityname.Reset(); |
|
3259 key.Reset(); |
|
3260 keyname.Reset(); |
|
3261 sysdata.Reset(); |
|
3262 |
|
3263 //Set Vibra |
|
3264 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3265 result = err; |
|
3266 if(err == KErrNone) |
|
3267 { |
|
3268 pos = 0; |
|
3269 |
|
3270 iOutparam->FindFirst( pos, KErrorCode ); |
|
3271 if(pos != KErrNotFound) |
|
3272 { |
|
3273 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3274 } |
|
3275 iOutparam->Reset(); |
|
3276 iInparam->Reset(); |
|
3277 |
|
3278 TBuf<50> buf; |
|
3279 buf.AppendNum(result); |
|
3280 iLog->Log(buf); |
|
3281 if(result != SErrNone) |
|
3282 { |
|
3283 result = 0; |
|
3284 } |
|
3285 else |
|
3286 { |
|
3287 result = -1; |
|
3288 } |
|
3289 } |
|
3290 } |
|
3291 else |
|
3292 { |
|
3293 result = -1; |
|
3294 } |
|
3295 } |
|
3296 |
|
3297 __UHEAP_MARKEND; |
|
3298 return result; |
|
3299 |
|
3300 } |
|
3301 |
|
3302 // ----------------------------------------------------------------------------- |
|
3303 // Ctsysinfoprovidertests::SetScreenSaverTimeout |
|
3304 // with KLiwOptASyncronous bit set for a synchronous request. |
|
3305 // ----------------------------------------------------------------------------- |
|
3306 // |
|
3307 TInt Ctsysinfoprovidertests::SetWallpaper( CStifItemParser& /*aItem*/) |
|
3308 { |
|
3309 TInt result =KErrNone; |
|
3310 |
|
3311 _LIT( KExample, "SupportedLang:" ); |
|
3312 iLog->Log( KExample ); |
|
3313 TInt pos = 0; |
|
3314 |
|
3315 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
3316 |
|
3317 Init(); |
|
3318 __UHEAP_MARK; |
|
3319 |
|
3320 TLiwGenericParam entity; |
|
3321 TLiwVariant entityname; |
|
3322 TLiwGenericParam key; |
|
3323 TLiwVariant keyname; |
|
3324 |
|
3325 entityname.Set(KDisplay); |
|
3326 entity.SetNameAndValueL(KEntity,entityname); |
|
3327 |
|
3328 keyname.Set(KWallpaper); |
|
3329 key.SetNameAndValueL(KKey,keyname); |
|
3330 |
|
3331 //sysdata as map |
|
3332 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3333 CleanupStack::PushL(map); |
|
3334 |
|
3335 _LIT(KWallPaperPath,"Statuswereewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwergregrvbrtbrbhbbyhbgrthgrtgrtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttfcfsdvdfvfddddddddvdvhrtttttttteyeyeyeyfgvsdterrrrrrrrrrrrrrrrrrrrrrrrrrrrrrregeeeeeeeeeeeeeeeeeeeeeeergergrewghrthrtrtrtrtrtrtrtrtrtrtrtwhrrrrtttwrwthtrwwtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttw"); |
|
3336 TLiwVariant sysdata(KWallPaperPath); |
|
3337 map->InsertL(KStatus,sysdata); |
|
3338 sysdata.Reset(); |
|
3339 |
|
3340 TLiwVariant sysparam(map); |
|
3341 TLiwGenericParam element ; |
|
3342 element.SetNameAndValueL(KSysData,sysparam); |
|
3343 sysparam.Reset(); |
|
3344 |
|
3345 iInparam->AppendL(entity); |
|
3346 |
|
3347 iInparam->AppendL(key); |
|
3348 iInparam->AppendL(element); |
|
3349 |
|
3350 element.Reset(); |
|
3351 |
|
3352 map->DecRef(); |
|
3353 CleanupStack::Pop(map); |
|
3354 |
|
3355 entity.Reset(); |
|
3356 entityname.Reset(); |
|
3357 key.Reset(); |
|
3358 keyname.Reset(); |
|
3359 sysdata.Reset(); |
|
3360 |
|
3361 //Set Vibra |
|
3362 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3363 result = err; |
|
3364 if(err == KErrNone) |
|
3365 { |
|
3366 pos = 0; |
|
3367 iOutparam->FindFirst( pos, KErrorCode ); |
|
3368 if(pos != KErrNotFound) |
|
3369 { |
|
3370 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3371 } |
|
3372 iOutparam->Reset(); |
|
3373 iInparam->Reset(); |
|
3374 |
|
3375 TBuf<50> buf; |
|
3376 buf.AppendNum(result); |
|
3377 iLog->Log(buf); |
|
3378 if(result != SErrNone) |
|
3379 { |
|
3380 result = 0; |
|
3381 |
|
3382 TLiwGenericParam entity; |
|
3383 TLiwVariant entityname; |
|
3384 TLiwGenericParam key; |
|
3385 TLiwVariant keyname; |
|
3386 |
|
3387 entityname.Set(KDisplay); |
|
3388 entity.SetNameAndValueL(KEntity,entityname); |
|
3389 |
|
3390 keyname.Set(KWallpaper); |
|
3391 key.SetNameAndValueL(KKey,keyname); |
|
3392 |
|
3393 //sysdata as map |
|
3394 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3395 CleanupStack::PushL(map); |
|
3396 |
|
3397 _LIT(KWallPaperPath2,"c:\\data\\Others\\sysinfo.txt"); |
|
3398 TLiwVariant sysdata(KWallPaperPath2); |
|
3399 map->InsertL(KStatus,sysdata); |
|
3400 sysdata.Reset(); |
|
3401 |
|
3402 TLiwVariant sysparam(map); |
|
3403 TLiwGenericParam element ; |
|
3404 element.SetNameAndValueL(KSysData,sysparam); |
|
3405 sysparam.Reset(); |
|
3406 |
|
3407 iInparam->AppendL(entity); |
|
3408 |
|
3409 iInparam->AppendL(key); |
|
3410 iInparam->AppendL(element); |
|
3411 |
|
3412 element.Reset(); |
|
3413 |
|
3414 map->DecRef(); |
|
3415 CleanupStack::Pop(map); |
|
3416 |
|
3417 entity.Reset(); |
|
3418 entityname.Reset(); |
|
3419 key.Reset(); |
|
3420 keyname.Reset(); |
|
3421 sysdata.Reset(); |
|
3422 |
|
3423 //Set Vibra |
|
3424 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3425 result = err; |
|
3426 if(err == KErrNone) |
|
3427 { |
|
3428 iOutparam->FindFirst( pos, KErrorCode ); |
|
3429 if(pos != KErrNotFound) |
|
3430 { |
|
3431 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3432 } |
|
3433 iOutparam->Reset(); |
|
3434 iInparam->Reset(); |
|
3435 |
|
3436 if(result == SErrBadArgumentType) |
|
3437 { |
|
3438 result = 0; |
|
3439 } |
|
3440 else |
|
3441 { |
|
3442 result = -1; |
|
3443 } |
|
3444 } |
|
3445 }//result |
|
3446 }//err |
|
3447 else |
|
3448 { |
|
3449 result = -1; |
|
3450 } |
|
3451 |
|
3452 __UHEAP_MARKEND; |
|
3453 return result; |
|
3454 |
|
3455 } |
|
3456 |
|
3457 // ----------------------------------------------------------------------------- |
|
3458 // Ctsysinfoprovidertests::SetScreenSaverTimeout |
|
3459 // with KLiwOptASyncronous bit set for a synchronous request. |
|
3460 // ----------------------------------------------------------------------------- |
|
3461 // |
|
3462 TInt Ctsysinfoprovidertests::SetLightTimeOut( CStifItemParser& /*aItem*/) |
|
3463 { |
|
3464 TInt result =KErrNone; |
|
3465 |
|
3466 _LIT( KExample, "SupportedLang:" ); |
|
3467 iLog->Log( KExample ); |
|
3468 TInt pos = 0; |
|
3469 |
|
3470 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
3471 |
|
3472 Init(); |
|
3473 __UHEAP_MARK; |
|
3474 |
|
3475 TLiwGenericParam entity; |
|
3476 TLiwVariant entityname; |
|
3477 TLiwGenericParam key; |
|
3478 TLiwVariant keyname; |
|
3479 |
|
3480 entityname.Set(KDisplay); |
|
3481 entity.SetNameAndValueL(KEntity,entityname); |
|
3482 |
|
3483 keyname.Set(KLightTimeOut); |
|
3484 key.SetNameAndValueL(KKey,keyname); |
|
3485 |
|
3486 //sysdata as map |
|
3487 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3488 CleanupStack::PushL(map); |
|
3489 |
|
3490 TLiwVariant sysdata((TInt32)-100); |
|
3491 map->InsertL(KStatus,sysdata); |
|
3492 sysdata.Reset(); |
|
3493 |
|
3494 TLiwVariant sysparam(map); |
|
3495 TLiwGenericParam element ; |
|
3496 element.SetNameAndValueL(KSysData,sysparam); |
|
3497 sysparam.Reset(); |
|
3498 |
|
3499 iInparam->AppendL(entity); |
|
3500 |
|
3501 iInparam->AppendL(key); |
|
3502 iInparam->AppendL(element); |
|
3503 |
|
3504 element.Reset(); |
|
3505 |
|
3506 map->DecRef(); |
|
3507 CleanupStack::Pop(map); |
|
3508 |
|
3509 entity.Reset(); |
|
3510 entityname.Reset(); |
|
3511 key.Reset(); |
|
3512 keyname.Reset(); |
|
3513 sysdata.Reset(); |
|
3514 |
|
3515 //Set Vibra |
|
3516 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3517 result = err; |
|
3518 if(err == KErrNone) |
|
3519 { |
|
3520 pos = 0; |
|
3521 iOutparam->FindFirst( pos, KErrorCode ); |
|
3522 if(pos != KErrNotFound) |
|
3523 { |
|
3524 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3525 } |
|
3526 iOutparam->Reset(); |
|
3527 iInparam->Reset(); |
|
3528 |
|
3529 TBuf<50> buf; |
|
3530 buf.AppendNum(result); |
|
3531 iLog->Log(buf); |
|
3532 if(result != SErrNone) |
|
3533 { |
|
3534 result = 0; |
|
3535 |
|
3536 TLiwGenericParam entity; |
|
3537 TLiwVariant entityname; |
|
3538 TLiwGenericParam key; |
|
3539 TLiwVariant keyname; |
|
3540 |
|
3541 entityname.Set(KDisplay); |
|
3542 entity.SetNameAndValueL(KEntity,entityname); |
|
3543 |
|
3544 keyname.Set(KLightTimeOut); |
|
3545 key.SetNameAndValueL(KKey,keyname); |
|
3546 |
|
3547 //sysdata as map |
|
3548 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3549 CleanupStack::PushL(map); |
|
3550 |
|
3551 TLiwVariant sysdata((TInt32)5000); |
|
3552 map->InsertL(KStatus,sysdata); |
|
3553 sysdata.Reset(); |
|
3554 |
|
3555 TLiwVariant sysparam(map); |
|
3556 TLiwGenericParam element ; |
|
3557 element.SetNameAndValueL(KSysData,sysparam); |
|
3558 sysparam.Reset(); |
|
3559 |
|
3560 iInparam->AppendL(entity); |
|
3561 |
|
3562 iInparam->AppendL(key); |
|
3563 iInparam->AppendL(element); |
|
3564 |
|
3565 element.Reset(); |
|
3566 |
|
3567 map->DecRef(); |
|
3568 CleanupStack::Pop(map); |
|
3569 |
|
3570 entity.Reset(); |
|
3571 entityname.Reset(); |
|
3572 key.Reset(); |
|
3573 keyname.Reset(); |
|
3574 sysdata.Reset(); |
|
3575 |
|
3576 //Set Vibra |
|
3577 TRAPD(err,iInterface->ExecuteCmdL(KSetInfo,*iInparam,*iOutparam)); |
|
3578 result = err; |
|
3579 if(err == KErrNone) |
|
3580 { |
|
3581 pos = 0; |
|
3582 iOutparam->FindFirst( pos, KErrorCode ); |
|
3583 if(pos != KErrNotFound) |
|
3584 { |
|
3585 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3586 } |
|
3587 iOutparam->Reset(); |
|
3588 iInparam->Reset(); |
|
3589 |
|
3590 TBuf<50> buf; |
|
3591 buf.AppendNum(result); |
|
3592 iLog->Log(buf); |
|
3593 if(result != SErrNone) |
|
3594 { |
|
3595 result = 0; |
|
3596 } |
|
3597 else |
|
3598 { |
|
3599 result = -1; |
|
3600 } |
|
3601 } |
|
3602 } |
|
3603 else |
|
3604 { |
|
3605 result = -1; |
|
3606 } |
|
3607 } |
|
3608 |
|
3609 __UHEAP_MARKEND; |
|
3610 return result; |
|
3611 |
|
3612 } |
|
3613 |
|
3614 |
|
3615 |
|
3616 TInt Ctsysinfoprovidertests::GetDriveInfoL(CStifItemParser& /*aItem*/) |
|
3617 { |
|
3618 TInt result =KErrNone; |
|
3619 |
|
3620 _LIT( KExample, "SupportedLang:" ); |
|
3621 iLog->Log( KExample ); |
|
3622 TInt pos = 0; |
|
3623 |
|
3624 TInt32 oldDisplayLang = 0 ,newDisplayLang = 0,changedDisplayLang = 0; |
|
3625 |
|
3626 Init(); |
|
3627 __UHEAP_MARK; |
|
3628 |
|
3629 TLiwGenericParam entity; |
|
3630 TLiwVariant entityname; |
|
3631 TLiwGenericParam key; |
|
3632 TLiwVariant keyname; |
|
3633 |
|
3634 entityname.Set(KMemory); |
|
3635 entity.SetNameAndValueL(KEntity,entityname); |
|
3636 |
|
3637 keyname.Set(KDriveInfo); |
|
3638 key.SetNameAndValueL(KKey,keyname); |
|
3639 |
|
3640 //sysdata as map |
|
3641 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3642 CleanupStack::PushL(map); |
|
3643 |
|
3644 _LIT(KDrivePath,"p:\\"); |
|
3645 TLiwVariant sysdata(KDrivePath); |
|
3646 map->InsertL(KDriveNo,sysdata); |
|
3647 sysdata.Reset(); |
|
3648 |
|
3649 TLiwVariant sysparam(map); |
|
3650 TLiwGenericParam element ; |
|
3651 element.SetNameAndValueL(KSysData,sysparam); |
|
3652 sysparam.Reset(); |
|
3653 |
|
3654 iInparam->AppendL(entity); |
|
3655 |
|
3656 iInparam->AppendL(key); |
|
3657 iInparam->AppendL(element); |
|
3658 |
|
3659 element.Reset(); |
|
3660 |
|
3661 map->DecRef(); |
|
3662 CleanupStack::Pop(map); |
|
3663 |
|
3664 entity.Reset(); |
|
3665 entityname.Reset(); |
|
3666 key.Reset(); |
|
3667 keyname.Reset(); |
|
3668 sysdata.Reset(); |
|
3669 |
|
3670 //Set Vibra |
|
3671 TRAPD(err,iInterface->ExecuteCmdL(KGetInfo,*iInparam,*iOutparam)); |
|
3672 result = err; |
|
3673 if(err == KErrNone) |
|
3674 { |
|
3675 pos = 0; |
|
3676 iOutparam->FindFirst( pos, KErrorCode ); |
|
3677 if(pos != KErrNotFound) |
|
3678 { |
|
3679 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3680 } |
|
3681 iOutparam->Reset(); |
|
3682 iInparam->Reset(); |
|
3683 |
|
3684 TBuf<50> buf; |
|
3685 buf.AppendNum(result); |
|
3686 iLog->Log(buf); |
|
3687 if(result == SErrServiceNotReady) |
|
3688 { |
|
3689 result = 0; |
|
3690 |
|
3691 TLiwGenericParam entity; |
|
3692 TLiwVariant entityname; |
|
3693 TLiwGenericParam key; |
|
3694 TLiwVariant keyname; |
|
3695 |
|
3696 entityname.Set(KMemory); |
|
3697 entity.SetNameAndValueL(KEntity,entityname); |
|
3698 |
|
3699 keyname.Set(KDriveInfo); |
|
3700 key.SetNameAndValueL(KKey,keyname); |
|
3701 |
|
3702 //sysdata as map |
|
3703 CLiwDefaultMap* map = CLiwDefaultMap::NewL(); |
|
3704 CleanupStack::PushL(map); |
|
3705 |
|
3706 _LIT(KDrivePath2,"aath:\\"); |
|
3707 TLiwVariant sysdata(KDrivePath2); |
|
3708 map->InsertL(KDriveNo,sysdata); |
|
3709 sysdata.Reset(); |
|
3710 |
|
3711 TLiwVariant sysparam(map); |
|
3712 TLiwGenericParam element ; |
|
3713 element.SetNameAndValueL(KSysData,sysparam); |
|
3714 sysparam.Reset(); |
|
3715 |
|
3716 iInparam->AppendL(entity); |
|
3717 |
|
3718 iInparam->AppendL(key); |
|
3719 iInparam->AppendL(element); |
|
3720 |
|
3721 element.Reset(); |
|
3722 |
|
3723 map->DecRef(); |
|
3724 CleanupStack::Pop(map); |
|
3725 |
|
3726 entity.Reset(); |
|
3727 entityname.Reset(); |
|
3728 key.Reset(); |
|
3729 keyname.Reset(); |
|
3730 sysdata.Reset(); |
|
3731 |
|
3732 //Set Vibra |
|
3733 TRAPD(err,iInterface->ExecuteCmdL(KGetInfo,*iInparam,*iOutparam)); |
|
3734 result = err; |
|
3735 if(err == KErrNone) |
|
3736 { |
|
3737 pos = 0; |
|
3738 iOutparam->FindFirst( pos, KErrorCode ); |
|
3739 if(pos != KErrNotFound) |
|
3740 { |
|
3741 result = (TInt)((*iOutparam)[pos].Value().AsTInt32()); |
|
3742 } |
|
3743 TBuf<50> buf; |
|
3744 buf.AppendNum(result); |
|
3745 iLog->Log(buf); |
|
3746 if(result == SErrBadArgumentType) |
|
3747 { |
|
3748 result = 0; |
|
3749 } |
|
3750 else |
|
3751 { |
|
3752 result = -1; |
|
3753 } |
|
3754 } |
|
3755 |
|
3756 iOutparam->Reset(); |
|
3757 iInparam->Reset(); |
|
3758 |
|
3759 } |
|
3760 else |
|
3761 { |
|
3762 result = -1; |
|
3763 } |
|
3764 } |
|
3765 |
|
3766 __UHEAP_MARKEND; |
|
3767 return result; |
|
3768 |
|
3769 } |
|
3770 |
|
3771 // ----------------------------------------------------------------------------- |
|
3772 // Ctsysinfoprovidertests::UserInactivityNotify |
|
3773 // negative user inactivity time value |
|
3774 // ----------------------------------------------------------------------------- |
|
3775 // |
|
3776 TInt Ctsysinfoprovidertests::UserInactivityNotify(CStifItemParser& /*aItem*/) |
|
3777 { |
|
3778 int ret=0; |
|
3779 ret = UserInactivity(iLog); |
|
3780 |
|
3781 if(ret==0) |
|
3782 return KErrNone; |
|
3783 else |
|
3784 return KErrGeneral; |
|
3785 } |
|
3786 |