|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Terminal Control DM Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /* |
|
20 |
|
21 ./Terminal Security -+--> FileScan (E) -+--> Execute (E) |
|
22 | |
|
23 | |
|
24 |--> Results (G) |
|
25 |
|
26 |
|
27 ./Terminal Security -+--> FileDelete (E) |
|
28 |
|
29 |
|
30 ./Terminal Security -+--> DeviceWipe (E) |
|
31 |
|
32 |
|
33 ./Terminal Security -+--> Reboot (E) |
|
34 |
|
35 |
|
36 ./Terminal Security -+--> DeviceLock (G) -+--> Autolock Period : int (GR) |
|
37 | |
|
38 | |
|
39 |--> LockLevel : int (GR) |
|
40 | |
|
41 | |
|
42 |--> LockCode : int (R) |
|
43 | |
|
44 | |
|
45 |--> Max Autolock Period : int (GR) |
|
46 | |
|
47 |--> Lock Code min length : int (GR) |
|
48 | |
|
49 |--> Lock Code max length : int (GR) |
|
50 | |
|
51 |--> Lock Code require upper and lower case letters : bool (GR) |
|
52 | |
|
53 |--> Lock Code require characters and numbers : bool (GR) |
|
54 | |
|
55 |--> Lock Code max repeated chars : int (GR) |
|
56 | |
|
57 |--> Lock Code history buffer : int (GR) |
|
58 | |
|
59 |--> Lock Code expiration : int (GR) |
|
60 | |
|
61 |--> Lock Code min change tolerance : int (GR) |
|
62 | |
|
63 |--> Lock Code min change interval : int (GR) |
|
64 | |
|
65 |--> Lock Code check specific strings : bool (GR) |
|
66 | |
|
67 |--> Lock Code disallow specific strings : chr (R) |
|
68 | |
|
69 |--> Lock Code allow specific strings : chr (R) |
|
70 | |
|
71 |--> Lock Code clear specific strings : null (E) |
|
72 | |
|
73 |--> Lock Code max attempts : int (GR) |
|
74 | |
|
75 |--> Lock Code ConsecutiveNumbers : bool (GR) |
|
76 | |
|
77 |--> Lock Code min special chars : int (GR) |
|
78 | |
|
79 |--> Lock code disallow simple : bool (GR) |
|
80 |
|
81 |
|
82 |
|
83 ./Terminal Security -+--> Local Operations (G) -+--> Start (E) |
|
84 | |
|
85 | |
|
86 |--> Stop (E) |
|
87 |
|
88 |
|
89 ./Terminal Security -+--> Processes (G) -+--> <X> * (G) -+--> ID (G) |
|
90 | |
|
91 | |
|
92 |--> FromRAM (G) |
|
93 | |
|
94 | |
|
95 |--> MemoryInfo (G) |
|
96 | |
|
97 | |
|
98 |--> Filename (G) |
|
99 |
|
100 */ |
|
101 |
|
102 #ifdef __WINS__ |
|
103 #define __STIF_EMULATOR_TESTING__ |
|
104 #endif |
|
105 // --------------------------------------------------------------------------- |
|
106 #include "tcadapter.h" |
|
107 |
|
108 // symbian |
|
109 #ifndef __WINS_DEBUG_TESTING__ |
|
110 #include <implementationproxy.h> // For TImplementationProxy definition |
|
111 #endif |
|
112 #include <fbs.h> |
|
113 #include <f32file.h> |
|
114 #include <imcvcodc.h> |
|
115 // s60 |
|
116 // tarm |
|
117 #include <DMCert.h> |
|
118 #include <SettingEnforcementInfo.h> |
|
119 #include <PolicyEngineXACML.h> |
|
120 #include "nsmldmuri.h" |
|
121 #include "TPtrC8I.h" |
|
122 |
|
123 #ifdef __Sml_DEBUG__ |
|
124 #pragma message("Sml Debugging is ON!") |
|
125 #endif |
|
126 |
|
127 #include "debug.h" |
|
128 #include <featmgr.h> |
|
129 const TInt KFlatBufSize = 128; |
|
130 const TInt KFlatMimeBufSize = 20; |
|
131 |
|
132 #if defined( __WINS_DEBUG_TESTING__ ) || defined ( __STIF_EMULATOR_TESTING__ ) |
|
133 _LIT( KDebugFileName, "C:\\tcadapter.log" ); |
|
134 #endif |
|
135 |
|
136 |
|
137 const TInt CTcAdapter::iAccessTypeList[ETcNodeNotUsedAndAlwaysLast+1] = |
|
138 { |
|
139 /*ETcNodeTerminalControl*/ CTcAdapter::EGet |
|
140 ,/*ETcNodeFileScan*/ CTcAdapter::EExecute |
|
141 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
142 ,/*ETcNodeFileScanExecute*/ CTcAdapter::EExecute |
|
143 #endif |
|
144 ,/*ETcNodeFileScanResults*/ CTcAdapter::EGet |
|
145 ,/*ETcNodeFileDelete*/ CTcAdapter::EExecute |
|
146 ,/*ETcNodeDeviceLock*/ CTcAdapter::EGet |
|
147 ,/*ETcNodeAutoLockPeriod*/ CTcAdapter::EGet | CTcAdapter::EReplace |
|
148 ,/*ETcNodeMaxAutoLockPeriod*/ CTcAdapter::EGet | CTcAdapter::EReplace |
|
149 ,/*ETcNodeLockLevel*/ CTcAdapter::EGet | CTcAdapter::EReplace |
|
150 ,/*ETcNodeLockCode*/ CTcAdapter::EReplace |
|
151 // --------- Enhanced features BEGIN ------------------ |
|
152 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
153 ,/*ETcNodeLockCodeMinLength*/ CTcAdapter::EGet | CTcAdapter::EReplace |
|
154 ,/*ETcNodeLockCodeMaxLength*/ CTcAdapter::EGet | CTcAdapter::EReplace |
|
155 ,/*ETcNodeLockCodeRequireUpperAndLower*/ |
|
156 CTcAdapter::EGet | CTcAdapter::EReplace |
|
157 ,/*ETcNodeLockCodeRequireCharsAndNumbers*/ |
|
158 CTcAdapter::EGet | CTcAdapter::EReplace |
|
159 ,/*ETcNodeLockCodeMaxRepeatedCharacters*/ |
|
160 CTcAdapter::EGet | CTcAdapter::EReplace |
|
161 ,/*ETcNodeLockCodeHistoryBuffer*/ |
|
162 CTcAdapter::EGet | CTcAdapter::EReplace |
|
163 ,/*ETcNodeLockCodeExpiration*/ |
|
164 CTcAdapter::EGet | CTcAdapter::EReplace |
|
165 ,/*ETcNodeLockCodeMinChangeTolerance*/ |
|
166 CTcAdapter::EGet | CTcAdapter::EReplace |
|
167 ,/*ETcNodeLockCodeMinChangeInterval*/ |
|
168 CTcAdapter::EGet | CTcAdapter::EReplace |
|
169 ,/*ETcNodeLockCodeCheckSpecificStrings*/ |
|
170 CTcAdapter::EGet | CTcAdapter::EReplace |
|
171 ,/*ETcNodeLockCodeDisallowSpecific*/ |
|
172 CTcAdapter::EReplace |
|
173 ,/*ETcNodeLockCodeAllowSpecific*/ |
|
174 CTcAdapter::EReplace |
|
175 ,/*ETcNodeLockCodeClearSpecificStrings*/ |
|
176 CTcAdapter::EExecute |
|
177 ,/*ETcNodeLockCodeMaxAttempts*/ |
|
178 CTcAdapter::EGet | CTcAdapter::EReplace |
|
179 ,/*ETcNodeLockConsecutiveNumbers*/ |
|
180 CTcAdapter::EGet | CTcAdapter::EReplace |
|
181 ,/*ETcNodeLockCodeMinSpecialCharacters*/ |
|
182 CTcAdapter::EGet | CTcAdapter::EReplace |
|
183 ,/*ETcNodeLockDisallowSimple*/ |
|
184 CTcAdapter::EGet | CTcAdapter::EReplace |
|
185 |
|
186 |
|
187 //#endif |
|
188 // --------- Enhanced features END -------------------- |
|
189 ,/*ETcNodeDeviceWipe*/ CTcAdapter::EExecute |
|
190 ,/*ETcNodeProcesses*/ CTcAdapter::EGet |
|
191 ,/*ETcNodeProcessesX*/ CTcAdapter::EGet |
|
192 ,/*ETcNodeID*/ CTcAdapter::EGet |
|
193 ,/*ETcNodeFromRAM*/ CTcAdapter::EGet |
|
194 ,/*ETcNodeMemoryInfo*/ CTcAdapter::EGet |
|
195 ,/*ETcNodeFilename*/ CTcAdapter::EGet |
|
196 ,/*ETcNodeReboot*/ CTcAdapter::EExecute |
|
197 ,/*ETcNodeLocalOperations*/ CTcAdapter::EGet |
|
198 ,/*ETcNodeStart*/ CTcAdapter::EExecute |
|
199 ,/*ETcNodeStop*/ CTcAdapter::EExecute |
|
200 ,/**/ CTcAdapter::ENoAccess |
|
201 }; |
|
202 |
|
203 // -------------------------------------------------------------------- |
|
204 // CTcAdapter* CTcAdapter::NewL( ) |
|
205 // -------------------------------------------------------------------- |
|
206 CTcAdapter* CTcAdapter::NewL( MSmlDmCallback* aDmCallback ) |
|
207 { |
|
208 RDEBUG("CTcAdapter::NewL()"); |
|
209 |
|
210 CTcAdapter* self = NewLC( aDmCallback ); |
|
211 CleanupStack::Pop( self ); |
|
212 return self; |
|
213 } |
|
214 |
|
215 // --------------------------------------------------------------------- |
|
216 // CTcAdapter* CTcAdapter::NewLC( ) |
|
217 // --------------------------------------------------------------------- |
|
218 CTcAdapter* CTcAdapter::NewLC( MSmlDmCallback* aDmCallback ) |
|
219 { |
|
220 RDEBUG("CTcAdapter::NewLC()"); |
|
221 |
|
222 CTcAdapter* self = new( ELeave ) CTcAdapter(aDmCallback); |
|
223 CleanupStack::PushL( self ); |
|
224 self->ConstructL( aDmCallback ); |
|
225 return self; |
|
226 } |
|
227 |
|
228 // -------------------------------------------------------------------- |
|
229 // CTcAdapter::CTcAdapter() |
|
230 // -------------------------------------------------------------------- |
|
231 CTcAdapter::CTcAdapter(TAny* aEcomArguments) |
|
232 : CTARMDmAdapter((MSmlDmCallback*)aEcomArguments) |
|
233 , iConnected(EFalse) |
|
234 , iAutoLockPeriod(-1) |
|
235 , iLockLevel(-1) |
|
236 , iMaxAutoLockPeriod(-1) |
|
237 // --------- Enhanced features BEGIN ------------------ |
|
238 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
239 , iLockCodeMinLength( -1 ) |
|
240 , iLockCodeMaxLength( -1 ) |
|
241 , iLockCodeRequireUpperAndLowerInt( -1 ) |
|
242 , iLockCodeRequireCharsAndNumbersInt( -1 ) |
|
243 , iLockCodeMaxRepeatedCharacters( -1 ) |
|
244 , iLockCodeHistoryBuffer( -1 ) |
|
245 , iLockCodeExpiration( -1 ) |
|
246 , iLockCodeMinChangeTolerance( -1 ) |
|
247 , iLockCodeMinChangeInterval( -1 ) |
|
248 , iLockCodeCheckSpecificStringsInt( -1 ) |
|
249 , iLockCodeMaxAttempts( -1 ) |
|
250 , iLockCodeConsecutiveNumbersInt( -1 ) |
|
251 , iLockCodeMinSpecialCharacters( -1 ) |
|
252 , iLockCodeDisallowSimpleInt( -1 ) |
|
253 //#endif |
|
254 // --------- Enhanced features END -------------------- |
|
255 |
|
256 { |
|
257 memset(&iAccessHistory[0], CTcAdapter::ENoAccess, sizeof(iAccessHistory)); |
|
258 } |
|
259 |
|
260 // ------------------------------------------------------------------------- |
|
261 // CTcAdapter::~CTcAdapter() |
|
262 // ------------------------------------------------------------------------- |
|
263 CTcAdapter::~CTcAdapter() |
|
264 { |
|
265 RDEBUG("CTcAdapter::~CTcAdapter()"); |
|
266 |
|
267 iTCSession.Close(); |
|
268 iTC.Close(); |
|
269 } |
|
270 |
|
271 // ------------------------------------------------------------------------- |
|
272 // CTcAdapter::DDFVersionL() |
|
273 // ------------------------------------------------------------------------- |
|
274 void CTcAdapter::DDFVersionL( CBufBase& aDDFVersion ) |
|
275 { |
|
276 RDEBUG("CTcAdapter::DDFVersionL()"); |
|
277 |
|
278 aDDFVersion.InsertL( 0, KSmlTCDDFVersion ); |
|
279 } |
|
280 |
|
281 // ------------------------------------------------------------------------- |
|
282 // CTcAdapter::DDFStructureL() |
|
283 // |
|
284 // ------------------------------------------------------------------------- |
|
285 void CTcAdapter::DDFStructureL( MSmlDmDDFObject& aDDF ) |
|
286 { |
|
287 RDEBUG("CTcAdapter::DDFStructureL()" ); |
|
288 |
|
289 TSmlDmAccessTypes accessTypesGet; |
|
290 accessTypesGet.SetGet(); |
|
291 |
|
292 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
293 TSmlDmAccessTypes accessTypeExecute; |
|
294 accessTypeExecute.SetExec(); |
|
295 #endif |
|
296 |
|
297 /* |
|
298 Node: ./TerminalSecurity |
|
299 This node is the root node for all terminal control functionality. |
|
300 · Support: Mandatory |
|
301 · Occurs: One |
|
302 · Format: Node |
|
303 · Access Types: Get |
|
304 · Values: N/A |
|
305 |
|
306 */ |
|
307 MSmlDmDDFObject& tc = aDDF.AddChildObjectL( KTCNodeName ); |
|
308 FillNodeInfoL(tc, accessTypesGet, MSmlDmDDFObject::EOne, |
|
309 MSmlDmDDFObject::EPermanent, |
|
310 MSmlDmDDFObject::ENode, KTCNodeDescription, KNullDesC8() ); |
|
311 |
|
312 TSmlDmAccessTypes accessTypesExec; |
|
313 accessTypesExec.SetExec(); |
|
314 |
|
315 /* |
|
316 Node: ./TerminalSecurity/FileScan |
|
317 The file scan feature delivers to admin a list |
|
318 of files or folders found in device. |
|
319 · Support: Mandatory |
|
320 · Occurs: One |
|
321 · Format: Node |
|
322 · Access Types: Exec |
|
323 · Values: N/A |
|
324 |
|
325 */ |
|
326 MSmlDmDDFObject& fs = tc.AddChildObjectL( KTCFileScanNodeName ); |
|
327 FillNodeInfoL( fs, accessTypesExec, MSmlDmDDFObject::EOne, |
|
328 MSmlDmDDFObject::EPermanent, |
|
329 MSmlDmDDFObject::ENode, KTCFileScanNodeDescription, KNullDesC8() ); |
|
330 |
|
331 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
332 /* |
|
333 Node: ./TerminalSecurity/FileScan/Execute |
|
334 This node can be used to execute file scan operation. |
|
335 · Support: Mandatory |
|
336 · Occurs: One |
|
337 · Format: NULL |
|
338 · Access Types: Exec |
|
339 · Values: N/A |
|
340 */ |
|
341 MSmlDmDDFObject& fse = fs.AddChildObjectL( KTCFileScanExecuteNodeName ); |
|
342 FillNodeInfoL( fse, accessTypeExecute, MSmlDmDDFObject::EOne, |
|
343 MSmlDmDDFObject::EPermanent, |
|
344 MSmlDmDDFObject::ENull, |
|
345 KTCFileScanExecuteNodeDescription, KNullDesC8() ); |
|
346 #endif |
|
347 |
|
348 /* |
|
349 Node: ./TerminalSecurity/FileScan/Results |
|
350 This node will hold the scan results |
|
351 · Support: Mandatory |
|
352 · Occurs: One |
|
353 · Format: Xml |
|
354 · Access Types: Get |
|
355 · Values: extended Obex folder listing objects |
|
356 */ |
|
357 MSmlDmDDFObject& fsr = fs.AddChildObjectL( KTCFileScanResultsNodeName ); |
|
358 FillNodeInfoL( fsr, accessTypesGet, MSmlDmDDFObject::EOne, |
|
359 MSmlDmDDFObject::EPermanent, |
|
360 MSmlDmDDFObject::EXml, KTCFileScanResultsNodeDescription, |
|
361 KSmlTCTextXml() ); |
|
362 |
|
363 /* |
|
364 Node: ./TerminalSecurity/FileDelete |
|
365 Deletes a file or empty folder |
|
366 · Support: Mandatory |
|
367 · Occurs: One |
|
368 · Format: N/A |
|
369 · Access Types: Exec |
|
370 · Values: N/A |
|
371 */ |
|
372 MSmlDmDDFObject& fd = tc.AddChildObjectL( KTCFileDeleteNodeName ); |
|
373 FillNodeInfoL( fd, accessTypesExec, MSmlDmDDFObject::EOne, |
|
374 MSmlDmDDFObject::EPermanent, |
|
375 MSmlDmDDFObject::ENode, KTCFileDeleteNodeDescription, KNullDesC8() ); |
|
376 |
|
377 /* |
|
378 Node: ./TerminalSecurity/DeviceLock |
|
379 The parent node for all DeviceLock related nodes |
|
380 · Support: Mandatory |
|
381 · Occurs: One |
|
382 · Format: Node |
|
383 · Access Types: Get |
|
384 · Values: N/A |
|
385 */ |
|
386 MSmlDmDDFObject& dl = tc.AddChildObjectL( KTCDeviceLockNodeName ); |
|
387 FillNodeInfoL( dl, accessTypesGet, MSmlDmDDFObject::EOne, |
|
388 MSmlDmDDFObject::EPermanent, |
|
389 MSmlDmDDFObject::ENode, KTCDeviceLockNodeDescription, |
|
390 KNullDesC8() ); |
|
391 |
|
392 TSmlDmAccessTypes accessTypesGetReplace; |
|
393 accessTypesGetReplace.SetGet(); |
|
394 accessTypesGetReplace.SetReplace(); |
|
395 |
|
396 /* |
|
397 Node: ./TerminalSecurity/DeviceLock/AutoLockPeriod |
|
398 AutoLockPeriod is an integer that tells after how many |
|
399 minutes the device will be automatically locked if not used |
|
400 · Status: Optional |
|
401 · Occurs: One |
|
402 · Format: integer |
|
403 · Access Types: Get, Replace |
|
404 · Values: Any integer in range device accepts. |
|
405 |
|
406 */ |
|
407 MSmlDmDDFObject& alp = dl.AddChildObjectL( KTCAutoLockPeriodNodeName ); |
|
408 FillNodeInfoL( alp, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
409 MSmlDmDDFObject::EPermanent, |
|
410 MSmlDmDDFObject::EInt, KTCAutoLockPeriodNodeDescription, |
|
411 KSmlTCTextPlain() ); |
|
412 |
|
413 /* |
|
414 Node: ./TerminalSecurity/DeviceLock/MaxAutoLockPeriod |
|
415 MaxAutoLockPeriod is an integer that tells maximum value of AutoLockPeriod |
|
416 · Status: Optional |
|
417 · Occurs: One |
|
418 · Format: integer |
|
419 · Access Types: Get, Replace |
|
420 · Values: Any integer in range device accepts. |
|
421 |
|
422 */ |
|
423 MSmlDmDDFObject& malp = dl.AddChildObjectL( KTCMaxAutoLockPeriodNodeName ); |
|
424 FillNodeInfoL( malp, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
425 MSmlDmDDFObject::EPermanent, |
|
426 MSmlDmDDFObject::EInt, KTCMaxAutoLockPeriodNodeDescription, |
|
427 KSmlTCTextPlain() ); |
|
428 |
|
429 /* |
|
430 Node: ./TerminalSecurity/DeviceLock/LockLevel |
|
431 Lock level tells whether lock is enabled, and what type of lock it is |
|
432 · Support: Mandatory |
|
433 · Occurs: One |
|
434 · Format: integer |
|
435 · Access Types: Get, Replace |
|
436 · Values: See examples below |
|
437 |
|
438 Example Values: |
|
439 0 - indicates lock is disabled |
|
440 1 - Indicates user lock is active. |
|
441 User can open lock by User secure code. |
|
442 2 - indicates admin lock is active. |
|
443 Lock can be opened only by Admin secure code. |
|
444 */ |
|
445 MSmlDmDDFObject& ll = dl.AddChildObjectL( KTCLockLevelNodeName ); |
|
446 FillNodeInfoL( ll, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
447 MSmlDmDDFObject::EPermanent, |
|
448 MSmlDmDDFObject::EInt, KTCLockLevelNodeDescription, KSmlTCTextPlain() ); |
|
449 |
|
450 TSmlDmAccessTypes accessTypesReplace; |
|
451 accessTypesReplace.SetReplace(); |
|
452 |
|
453 /* |
|
454 Node: ./TerminalSecurity/DeviceLock/LockCode |
|
455 LockCode is the character sequence that is needed to open locked device |
|
456 · Status: Optional |
|
457 · Occurs: One |
|
458 · Format: chr |
|
459 · Access Types: Replace |
|
460 · Values: Depends on device. |
|
461 */ |
|
462 MSmlDmDDFObject& lc = dl.AddChildObjectL( KTCLockCodeNodeName ); |
|
463 FillNodeInfoL( lc, accessTypesReplace, MSmlDmDDFObject::EOne, |
|
464 MSmlDmDDFObject::EPermanent, |
|
465 MSmlDmDDFObject::EChr, KTCLockCodeNodeDescription, KSmlTCTextPlain() ); |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
477 // -------- Enhanced features BEGIN |
|
478 |
|
479 /* |
|
480 Node: ./TerminalSecurity/DeviceLock/LockCodeMinLength |
|
481 LockCode minimum length, 4-256 characters |
|
482 · Status: Optional |
|
483 · Occurs: One |
|
484 · Format: integer |
|
485 · Access Types: Get, Replace |
|
486 · Values: Depends on device. |
|
487 */ |
|
488 MSmlDmDDFObject& lcmin = dl.AddChildObjectL( KTCLockCodeMinLengthNodeName ); |
|
489 FillNodeInfoL( lcmin, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
490 MSmlDmDDFObject::EPermanent, |
|
491 MSmlDmDDFObject::EInt, KTCLockCodeMinLengthNodeDescription, |
|
492 KSmlTCTextPlain() ); |
|
493 |
|
494 |
|
495 /* |
|
496 Node: ./TerminalSecurity/DeviceLock/LockCodeMaxLength |
|
497 LockCode maximum length, 4-256 characters |
|
498 · Status: Optional |
|
499 · Occurs: One |
|
500 · Format: integer |
|
501 · Access Types: Get, Replace |
|
502 · Values: Depends on device. |
|
503 */ |
|
504 MSmlDmDDFObject& lcmax = dl.AddChildObjectL( KTCLockCodeMaxLengthNodeName ); |
|
505 FillNodeInfoL( lcmax, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
506 MSmlDmDDFObject::EPermanent, |
|
507 MSmlDmDDFObject::EInt, KTCLockCodeMaxLengthNodeDescription, |
|
508 KSmlTCTextPlain() ); |
|
509 |
|
510 |
|
511 /* |
|
512 Node: ./TerminalSecurity/DeviceLock/LockCodeRequireUpperAndLower |
|
513 If enabled the LockCode must contain both upper and lower case letters |
|
514 · Status: Optional |
|
515 · Occurs: One |
|
516 · Format: bool |
|
517 · Access Types: Get, Replace |
|
518 · Values: Depends on device. |
|
519 */ |
|
520 MSmlDmDDFObject& lcrequl = |
|
521 dl.AddChildObjectL( KTCLockCodeRequireUpperAndLowerNodeName ); |
|
522 FillNodeInfoL( lcrequl, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
523 MSmlDmDDFObject::EPermanent, |
|
524 MSmlDmDDFObject::EBool, KTCLockCodeRequireUpperAndLowerNodeDescription, |
|
525 KSmlTCTextPlain() ); |
|
526 |
|
527 |
|
528 /* |
|
529 Node: ./TerminalSecurity/DeviceLock/LockCodeRequireCharsAndNumbers |
|
530 If enabled the LockCode must contain both chars and numbers |
|
531 · Status: Optional |
|
532 · Occurs: One |
|
533 · Format: bool |
|
534 · Access Types: Get, Replace |
|
535 · Values: Depends on device. |
|
536 */ |
|
537 MSmlDmDDFObject& lcreqcn = |
|
538 dl.AddChildObjectL( KTCLockCodeRequireCharsAndNumbersNodeName ); |
|
539 FillNodeInfoL( lcreqcn, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
540 MSmlDmDDFObject::EPermanent, |
|
541 MSmlDmDDFObject::EBool, |
|
542 KTCLockCodeRequireCharsAndNumbersNodeDescription, |
|
543 KSmlTCTextPlain() ); |
|
544 |
|
545 |
|
546 /* |
|
547 Node: ./TerminalSecurity/DeviceLock/LockCodeMaxRepeatedCharacters |
|
548 Tells how many times a single character can be used in a password. |
|
549 Values between 0 and 4, 0 = no restriction |
|
550 · Status: Optional |
|
551 · Occurs: One |
|
552 · Format: integer |
|
553 · Access Types: Get, Replace |
|
554 · Values: Depends on device. |
|
555 */ |
|
556 MSmlDmDDFObject& lcmaxrc = |
|
557 dl.AddChildObjectL( KTCLockCodeMaxRepeatedCharactersNodeName ); |
|
558 FillNodeInfoL( lcmaxrc, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
559 MSmlDmDDFObject::EPermanent, |
|
560 MSmlDmDDFObject::EInt, KTCLockCodeMaxRepeatedCharactersNodeDescription, |
|
561 KSmlTCTextPlain() ); |
|
562 |
|
563 |
|
564 /* |
|
565 Node: ./TerminalSecurity/DeviceLock/LockCodeHistoryBuffer |
|
566 History buffer for previously used lock codes. 0 = no restriction, |
|
567 1-X = the lock code can not match the previous X lock codes |
|
568 · Status: Optional |
|
569 · Occurs: One |
|
570 · Format: integer |
|
571 · Access Types: Get, Replace |
|
572 · Values: Depends on device. |
|
573 */ |
|
574 MSmlDmDDFObject& lchb = |
|
575 dl.AddChildObjectL( KTCLockCodeHistoryBufferNodeName ); |
|
576 FillNodeInfoL( lchb, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
577 MSmlDmDDFObject::EPermanent, |
|
578 MSmlDmDDFObject::EInt, KTCLockCodeHistoryBufferNodeDescription, |
|
579 KSmlTCTextPlain() ); |
|
580 |
|
581 |
|
582 /* |
|
583 Node: ./TerminalSecurity/DeviceLock/LockCodeExpiration |
|
584 The password expires after X days, 0 = no restriction, 1-365 |
|
585 · Status: Optional |
|
586 · Occurs: One |
|
587 · Format: integer |
|
588 · Access Types: Get, Replace |
|
589 · Values: Depends on device. |
|
590 */ |
|
591 MSmlDmDDFObject& lce = dl.AddChildObjectL( KTCLockCodeExpirationNodeName ); |
|
592 FillNodeInfoL( lce, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
593 MSmlDmDDFObject::EPermanent, |
|
594 MSmlDmDDFObject::EInt, KTCLockCodeExpirationNodeDescription, |
|
595 KSmlTCTextPlain() ); |
|
596 |
|
597 |
|
598 /* |
|
599 Node: ./TerminalSecurity/DeviceLock/LockCodeMinChangeTolerance |
|
600 The user can change the password only X times before |
|
601 'minimum change interval' hours has passed |
|
602 · Status: Optional |
|
603 · Occurs: One |
|
604 · Format: integer |
|
605 · Access Types: Get, Replace |
|
606 · Values: Depends on device. |
|
607 */ |
|
608 MSmlDmDDFObject& lcmct = |
|
609 dl.AddChildObjectL( KTCLockCodeMinChangeToleranceNodeName ); |
|
610 FillNodeInfoL( lcmct, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
611 MSmlDmDDFObject::EPermanent, |
|
612 MSmlDmDDFObject::EInt, KTCLockCodeMinChangeToleranceNodeDescription, |
|
613 KSmlTCTextPlain() ); |
|
614 |
|
615 |
|
616 /* |
|
617 Node: ./TerminalSecurity/DeviceLock/LockCodeMinChangeInterval |
|
618 The user cannot change the password more than 'minimum change |
|
619 tolerance' times before X hours have passed since the previous change |
|
620 · Status: Optional |
|
621 · Occurs: One |
|
622 · Format: integer |
|
623 · Access Types: Get, Replace |
|
624 · Values: Depends on device. |
|
625 */ |
|
626 MSmlDmDDFObject& lcmci = |
|
627 dl.AddChildObjectL( KTCLockCodeMinChangeIntervalNodeName ); |
|
628 FillNodeInfoL( lcmci, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
629 MSmlDmDDFObject::EPermanent, |
|
630 MSmlDmDDFObject::EInt, KTCLockCodeMinChangeIntervalNodeDescription, |
|
631 KSmlTCTextPlain() ); |
|
632 |
|
633 |
|
634 /* |
|
635 Node: ./TerminalSecurity/DeviceLock/LockCodeCheckSpecificStrings |
|
636 0 = No restriction, 1 = The password cannot match a string in the |
|
637 set of strings given by the next three calls |
|
638 · Status: Optional |
|
639 · Occurs: One |
|
640 · Format: bool |
|
641 · Access Types: Get, Replace |
|
642 · Values: Depends on device. |
|
643 */ |
|
644 MSmlDmDDFObject& lccss = dl.AddChildObjectL( |
|
645 KTCLockCodeCheckSpecificStringsNodeName ); |
|
646 FillNodeInfoL( lccss, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
647 MSmlDmDDFObject::EPermanent, |
|
648 MSmlDmDDFObject::EBool, |
|
649 KTCLockCodeCheckSpecificStringsNodeDescription, |
|
650 KSmlTCTextPlain() ); |
|
651 |
|
652 |
|
653 /* |
|
654 Node: ./TerminalSecurity/DeviceLock/LockCodeDisallowSpecific |
|
655 Disallow the specific string/strings given. |
|
656 Individual strings can be separated with ';' |
|
657 · Status: Optional |
|
658 · Occurs: One |
|
659 · Format: chr |
|
660 · Access Types: Replace |
|
661 · Values: Depends on device. |
|
662 */ |
|
663 MSmlDmDDFObject& lcds = dl.AddChildObjectL( |
|
664 KTCLockCodeDisallowSpecificNodeName ); |
|
665 FillNodeInfoL( lcds, accessTypesReplace, MSmlDmDDFObject::EOne, |
|
666 MSmlDmDDFObject::EPermanent, |
|
667 MSmlDmDDFObject::EChr, KTCLockCodeDisallowSpecificNodeDescription, |
|
668 KSmlTCTextPlain() ); |
|
669 |
|
670 /* |
|
671 Node: ./TerminalSecurity/DeviceLock/LockCodeAllowSpecific |
|
672 Allow the specific string/strings given. |
|
673 Individual strings can be separated with ';' |
|
674 · Status: Optional |
|
675 · Occurs: One |
|
676 · Format: chr |
|
677 · Access Types: Replace |
|
678 · Values: Depends on device. |
|
679 */ |
|
680 MSmlDmDDFObject& lcas = dl.AddChildObjectL( |
|
681 KTCLockCodeAllowSpecificNodeName ); |
|
682 FillNodeInfoL( lcas, accessTypesReplace, MSmlDmDDFObject::EOne, |
|
683 MSmlDmDDFObject::EPermanent, |
|
684 MSmlDmDDFObject::EChr, KTCLockCodeAllowSpecificNodeDescription, |
|
685 KSmlTCTextPlain() ); |
|
686 |
|
687 |
|
688 /* |
|
689 Node: ./TerminalSecurity/DeviceLock/LockCodeClearSpecificStrings |
|
690 Clear the specific string -buffer |
|
691 · Status: Optional |
|
692 · Occurs: One |
|
693 · Format: null |
|
694 · Access Types: Exec |
|
695 · Values: Depends on device. |
|
696 */ |
|
697 MSmlDmDDFObject& lcclss = dl.AddChildObjectL( |
|
698 KTCLockCodeClearSpecificStringsNodeName ); |
|
699 FillNodeInfoL( lcclss, accessTypesExec, MSmlDmDDFObject::EOne, |
|
700 MSmlDmDDFObject::EPermanent, |
|
701 MSmlDmDDFObject::ENull, KTCLockCodeClearSpecificStringsNodeDescription, |
|
702 KSmlTCTextPlain() ); |
|
703 |
|
704 |
|
705 /* |
|
706 Node: ./TerminalSecurity/DeviceLock/LockCodeMaxAttempts |
|
707 0 = No restriction, 3-100 = The device is "hard" reset after the |
|
708 user has consecutively failed X times to answer the password query |
|
709 · Status: Optional |
|
710 · Occurs: One |
|
711 · Format: integer |
|
712 · Access Types: Get, Replace |
|
713 · Values: Depends on device. |
|
714 */ |
|
715 MSmlDmDDFObject& lcma = dl.AddChildObjectL( |
|
716 KTCLockCodeMaxAttemptsNodeName ); |
|
717 FillNodeInfoL( lcma, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
718 MSmlDmDDFObject::EPermanent, |
|
719 MSmlDmDDFObject::EInt, KTCLockCodeMaxAttemptsNodeDescription, |
|
720 KSmlTCTextPlain() ); |
|
721 |
|
722 |
|
723 /* |
|
724 Node: ./TerminalSecurity/DeviceLock/ConsecutiveNumbers |
|
725 0 = No restriction, 3-100 = The device is "hard" reset after the |
|
726 user has consecutively failed X times to answer the password query |
|
727 · Status: Optional |
|
728 · Occurs: One |
|
729 · Format: bool |
|
730 · Access Types: Get, Replace |
|
731 · Values: Depends on device. |
|
732 */ |
|
733 MSmlDmDDFObject& lccon = dl.AddChildObjectL( |
|
734 KTCLockCodeConsecutiveNumbersNodeName ); |
|
735 FillNodeInfoL( lccon, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
736 MSmlDmDDFObject::EPermanent, |
|
737 MSmlDmDDFObject::EInt, KTCLockCodeConsecutiveNumbersNodeDescription, |
|
738 KSmlTCTextPlain() ); |
|
739 |
|
740 /* |
|
741 Node: ./TerminalSecurity/DeviceLock/LockCodeMinSpecialCharacters |
|
742 Tells the least number of special characters the lock code must contain. |
|
743 Values between 0 and 255, 0 = no restriction |
|
744 · Status: Optional |
|
745 · Occurs: One |
|
746 · Format: integer |
|
747 · Access Types: Get, Replace |
|
748 · Values: Depends on device. |
|
749 */ |
|
750 MSmlDmDDFObject& lcminsc = |
|
751 dl.AddChildObjectL( KTCLockCodeMinSpecialCharactersNodeName ); |
|
752 FillNodeInfoL( lcminsc, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
753 MSmlDmDDFObject::EPermanent, |
|
754 MSmlDmDDFObject::EInt, KTCLockCodeMinSpecialCharactersNodeDescription, |
|
755 KSmlTCTextPlain() ); |
|
756 |
|
757 |
|
758 /* |
|
759 Node: ./TerminalSecurity/DeviceLock/DisallowSimple |
|
760 0 = No restriction, 1 = Password cannot be a simple string. |
|
761 · Status: Optional |
|
762 · Occurs: One |
|
763 · Format: bool |
|
764 · Access Types: Get, Replace |
|
765 · Values: Depends on device. |
|
766 */ |
|
767 MSmlDmDDFObject& lcdissim = dl.AddChildObjectL( |
|
768 KTCLockCodeDisallowSimpleNodeName ); |
|
769 FillNodeInfoL( lcdissim, accessTypesGetReplace, MSmlDmDDFObject::EOne, |
|
770 MSmlDmDDFObject::EPermanent, |
|
771 MSmlDmDDFObject::EInt, KTCLockCodeDisallowSimpleNodeDescription, |
|
772 KSmlTCTextPlain() ); |
|
773 |
|
774 |
|
775 // -------- Enhanced features END |
|
776 //#endif |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 /* |
|
788 Node: ./TerminalSecurity/DeviceWipe |
|
789 Executing this node will wipe device data, after which the device is |
|
790 completely resetted so that all non-permanent data will be lost |
|
791 · Support: Mandatory |
|
792 · Occurs: One |
|
793 · Format: chr |
|
794 · Access Types: Exec |
|
795 · Values: If none, performs complete wipe, if "RFS", |
|
796 then only settings are resetted |
|
797 |
|
798 */ |
|
799 MSmlDmDDFObject& dw = tc.AddChildObjectL( KTCDeviceWipeNodeName ); |
|
800 FillNodeInfoL( dw, accessTypesExec, MSmlDmDDFObject::EOne, |
|
801 MSmlDmDDFObject::EPermanent, |
|
802 MSmlDmDDFObject::ENode, KTCDeviceWipeNodeDescription, |
|
803 KNullDesC8() ); |
|
804 |
|
805 /* |
|
806 Node: ./TerminalSecurity/LocalOperations |
|
807 This node is common parent for all local operations |
|
808 · Support: Mandatory |
|
809 · Occurs: One |
|
810 · Format: Node |
|
811 · Access Types: Get |
|
812 · Values: N/A |
|
813 */ |
|
814 MSmlDmDDFObject& lo = tc.AddChildObjectL( KTCLocalOperationsNodeName ); |
|
815 FillNodeInfoL( lo, accessTypesGet, MSmlDmDDFObject::EOne, |
|
816 MSmlDmDDFObject::EPermanent, |
|
817 MSmlDmDDFObject::ENode, KTCLocalOperationsNodeDescription, |
|
818 KNullDesC8() ); |
|
819 |
|
820 /* |
|
821 Node: ./TerminalSecurity/LocalOperations/Start |
|
822 Exec command causes device to start an application |
|
823 · Support: Optional |
|
824 · Occurs: One |
|
825 · Format: Chr |
|
826 · Access Types: Exec |
|
827 · Values: URI to Application management inventory |
|
828 */ |
|
829 MSmlDmDDFObject& sta = lo.AddChildObjectL( KTCStartNodeName ); |
|
830 FillNodeInfoL( sta, accessTypesExec, MSmlDmDDFObject::EOne, |
|
831 MSmlDmDDFObject::EPermanent, |
|
832 MSmlDmDDFObject::EChr, KTCStartNodeDescription, KNullDesC8() ); |
|
833 |
|
834 /* |
|
835 Node: ./TerminalSecurity/LocalOperations/Stop |
|
836 Exec command causes device to stop an application or process |
|
837 · Support: Optional |
|
838 · Occurs: One |
|
839 · Format: Chr |
|
840 · Access Types: Exec |
|
841 · Values: URI to Application management or process inventory |
|
842 */ |
|
843 MSmlDmDDFObject& sto = lo.AddChildObjectL( KTCStopNodeName ); |
|
844 FillNodeInfoL( sto, accessTypesExec, MSmlDmDDFObject::EOne, |
|
845 MSmlDmDDFObject::EPermanent, |
|
846 MSmlDmDDFObject::EChr, KTCStopNodeDescription, KNullDesC8() ); |
|
847 |
|
848 /* |
|
849 Node: ./TerminalSecurity/Processes |
|
850 This is root for all process related information |
|
851 that is available for the admin |
|
852 · Status: Optional |
|
853 · Occurs: One |
|
854 · Format: Node |
|
855 · Access Types: Get |
|
856 · Values: N/A |
|
857 */ |
|
858 MSmlDmDDFObject& pr = tc.AddChildObjectL( KTCProcessesNodeName ); |
|
859 FillNodeInfoL( pr, accessTypesGet, MSmlDmDDFObject::EOne, |
|
860 MSmlDmDDFObject::EPermanent, |
|
861 MSmlDmDDFObject::ENode, KTCProcessesNodeDescription, KNullDesC8() ); |
|
862 |
|
863 /* |
|
864 Node: ./TerminalSecurity/Processes/<X> |
|
865 This node is placeholder for an identity of a process |
|
866 · Status: Optional |
|
867 · Occurs: ZeroOrMore |
|
868 · Format: Node |
|
869 · Access Types: Get |
|
870 Values: N/A |
|
871 */ |
|
872 MSmlDmDDFObject& dyna = pr.AddChildObjectGroupL( ); |
|
873 FillNodeInfoL( dyna, accessTypesGet, MSmlDmDDFObject::EZeroOrMore, |
|
874 MSmlDmDDFObject::EDynamic, |
|
875 MSmlDmDDFObject::ENode, KTCProcessesDynaNodeDescription, |
|
876 KNullDesC8() ); |
|
877 |
|
878 /* |
|
879 Node: ./TerminalSecurity/Processes/<X>/ID |
|
880 This leaf node holds the unique id of the process |
|
881 · Status: Optional |
|
882 · Occurs: One |
|
883 · Format: Chr |
|
884 · Access Types: Get |
|
885 · Values: Depend on device |
|
886 */ |
|
887 MSmlDmDDFObject& id = dyna.AddChildObjectL( KTCIDNodeName ); |
|
888 FillNodeInfoL( id, accessTypesGet, MSmlDmDDFObject::EOne, |
|
889 MSmlDmDDFObject::EPermanent, |
|
890 MSmlDmDDFObject::EChr, KTCIDNodeDescription, KSmlTCTextPlain() ); |
|
891 |
|
892 /* |
|
893 Node: ./TerminalSecurity/Processes/<X>/FromRAM |
|
894 This leaf holds knowledge whether the process has been |
|
895 loaded from RAM or ROM. |
|
896 · Status: Optional |
|
897 · Occurs: One |
|
898 · Format: bool |
|
899 · Access Types: Get |
|
900 · Values: true, if process is loaded from dynamic memory, false otherwise |
|
901 */ |
|
902 MSmlDmDDFObject& ram = dyna.AddChildObjectL( KTCFromRAMNodeName ); |
|
903 FillNodeInfoL( ram, accessTypesGet, MSmlDmDDFObject::EOne, |
|
904 MSmlDmDDFObject::EPermanent, |
|
905 MSmlDmDDFObject::EBool, KTCFromRAMNodeDescription, KSmlTCTextPlain() ); |
|
906 |
|
907 /* |
|
908 Node: ./TerminalSecurity/Processes/<X>/MemoryInfo |
|
909 This node holds some extra information about memory usage of the process |
|
910 · Status: Optional |
|
911 · Occurs: One |
|
912 · Format: Xml |
|
913 · Access Types: Get |
|
914 · Values: N/A |
|
915 */ |
|
916 MSmlDmDDFObject& mi = dyna.AddChildObjectL( KTCMemoryInfoNodeName ); |
|
917 FillNodeInfoL( mi, accessTypesGet, MSmlDmDDFObject::EOne, |
|
918 MSmlDmDDFObject::EPermanent, |
|
919 MSmlDmDDFObject::EXml, |
|
920 KTCMemoryInfoNodeDescription, KSmlTCTextPlain() ); |
|
921 |
|
922 /* |
|
923 Node: ./TerminalSecurity/Processes/<X>/Filename |
|
924 This node holds the filename of the process. |
|
925 |
|
926 · Status: Optional |
|
927 · Occurs: One |
|
928 · Format: Chr |
|
929 · Access Types: Get |
|
930 · Values: Filename without path |
|
931 */ |
|
932 MSmlDmDDFObject& fn = dyna.AddChildObjectL( KTCProcessFilenameNodeName ); |
|
933 FillNodeInfoL( fn, accessTypesGet, MSmlDmDDFObject::EOne, |
|
934 MSmlDmDDFObject::EPermanent, |
|
935 MSmlDmDDFObject::EChr, KTCProcessFilenameNodeDescription, |
|
936 KSmlTCTextPlain() ); |
|
937 |
|
938 /* |
|
939 Node: ./TerminalSecurity/Reboot |
|
940 Exec command causes device to be restarted after the end of |
|
941 current management command sequence. |
|
942 · Status: Optional |
|
943 · Occurs: One |
|
944 · Format: chr |
|
945 · Access Types: Exec |
|
946 · Values: N/A |
|
947 |
|
948 */ |
|
949 MSmlDmDDFObject& reb = tc.AddChildObjectL( KTCRebootNodeName ); |
|
950 FillNodeInfoL( reb, accessTypesExec, MSmlDmDDFObject::EOne, |
|
951 MSmlDmDDFObject::EPermanent, |
|
952 MSmlDmDDFObject::ENode, KTCRebootNodeDescription, KNullDesC8() ); |
|
953 } |
|
954 |
|
955 // --------------------------------------------------------------------------- |
|
956 // CTcAdapter::_UpdateLeafObjectL() |
|
957 // -------------------------------------------------------------------------- |
|
958 void CTcAdapter::_UpdateLeafObjectL( const TDesC8& aURI, |
|
959 const TDesC8& aLUID, |
|
960 const TDesC8& aObject, |
|
961 const TDesC8& aType, |
|
962 const TInt aStatusRef) |
|
963 { |
|
964 RDEBUG("CTcAdapter::_UpdateLeafObjectL()"); |
|
965 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
966 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
967 TRAPD( err, _UpdateLeafObjectToBeTrappedL( uriPtrc, aLUID, aObject, aType, aStatusRef ) ) |
|
968 #else |
|
969 TRAPD( err, _UpdateLeafObjectToBeTrappedL( aURI, aLUID, aObject, aType, aStatusRef ) ) |
|
970 #endif |
|
971 |
|
972 CSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
973 |
|
974 if( err != KErrNone ) |
|
975 { |
|
976 status = CSmlDmAdapter::EError; |
|
977 } |
|
978 |
|
979 Callback().SetStatusL( aStatusRef, status ); |
|
980 } |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 void CTcAdapter::_UpdateLeafObjectToBeTrappedL( const TDesC8& aURI, |
|
986 const TDesC8& /*aLUID*/, |
|
987 const TDesC8& aObject, |
|
988 const TDesC8& /*aType*/, |
|
989 const TInt /*aStatusRef*/) |
|
990 { |
|
991 RDEBUG("CTcAdapter::_UpdateLeafObjectToBeTrappedL()"); |
|
992 |
|
993 TLex8 lex( aObject ); |
|
994 TInt value; |
|
995 |
|
996 // Check the aObject-string for truth-values true/false |
|
997 TInt boolValue = -1; |
|
998 if ( aObject.CompareF( KTCValueTrue ) == 0 ) |
|
999 { |
|
1000 boolValue = 1; |
|
1001 } |
|
1002 else if ( aObject.CompareF( KTCValueFalse ) == 0 ) |
|
1003 { |
|
1004 boolValue = 0; |
|
1005 } |
|
1006 |
|
1007 User::LeaveIfError( CheckTerminalControlSession() ); |
|
1008 |
|
1009 CTcAdapter::TTcNodeIdentifier identifier = GetNodeIdentifier(aURI); |
|
1010 |
|
1011 if( ( iAccessTypeList[identifier] & CTcAdapter::EReplace) |
|
1012 == CTcAdapter::EReplace ) |
|
1013 { |
|
1014 iAccessHistory[identifier] |= CTcAdapter::EReplace; |
|
1015 |
|
1016 switch( identifier ) |
|
1017 { |
|
1018 case ETcNodeAutoLockPeriod: |
|
1019 { |
|
1020 User::LeaveIfError( lex.Val( value ) ); |
|
1021 if( -1 == iAutoLockPeriod ) |
|
1022 { |
|
1023 TInt err = iTCSession.GetAutolockPeriod( iAutoLockPeriod ); |
|
1024 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1025 { |
|
1026 User::Leave( err ); |
|
1027 } |
|
1028 } |
|
1029 User::LeaveIfError( iTCSession.SetAutolockPeriod( value ) ); |
|
1030 } |
|
1031 break; |
|
1032 |
|
1033 case ETcNodeMaxAutoLockPeriod: |
|
1034 { |
|
1035 User::LeaveIfError( lex.Val( value ) ); |
|
1036 if( -1 == iMaxAutoLockPeriod ) |
|
1037 { |
|
1038 TInt err = |
|
1039 iTCSession.GetMaxAutolockPeriod( iMaxAutoLockPeriod ); |
|
1040 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1041 { |
|
1042 User::Leave( err ); |
|
1043 } |
|
1044 } |
|
1045 User::LeaveIfError( iTCSession.SetMaxAutolockPeriod( value ) ); |
|
1046 } |
|
1047 break; |
|
1048 |
|
1049 case ETcNodeLockLevel: |
|
1050 { |
|
1051 // Truncate any White Space before or after the value. |
|
1052 |
|
1053 if(!lex.Eos()) |
|
1054 { |
|
1055 lex.SkipSpace(); |
|
1056 User::LeaveIfError( lex.Val( value ) ); |
|
1057 lex.SkipSpaceAndMark(); |
|
1058 // Validate if there is a white space separated string. |
|
1059 if (lex.Peek()!=0) |
|
1060 User::Leave( KErrNotSupported ); |
|
1061 } |
|
1062 else |
|
1063 User::Leave( KErrNotSupported ); |
|
1064 |
|
1065 if( -1 == iLockLevel ) |
|
1066 { |
|
1067 TInt err = iTCSession.GetDeviceLockLevel( iLockLevel ); |
|
1068 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1069 { |
|
1070 User::Leave( err ); |
|
1071 } |
|
1072 } |
|
1073 User::LeaveIfError( iTCSession.SetDeviceLockLevel( value ) ); |
|
1074 } |
|
1075 break; |
|
1076 |
|
1077 case ETcNodeLockCode: |
|
1078 { |
|
1079 User::LeaveIfError( iTCSession.SetDeviceLockCode( aObject ) ); |
|
1080 } |
|
1081 break; |
|
1082 |
|
1083 // --------- Enhanced features BEGIN ------------------ |
|
1084 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
1085 |
|
1086 case ETcNodeLockCodeMinLength: |
|
1087 { |
|
1088 User::LeaveIfError( lex.Val( value ) ); |
|
1089 if( -1 == iLockCodeMinLength ) |
|
1090 { |
|
1091 TInt err = |
|
1092 iTCSession.GetPasscodeMinLength( iLockCodeMinLength ); |
|
1093 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1094 { |
|
1095 User::Leave( err ); |
|
1096 } |
|
1097 } |
|
1098 User::LeaveIfError( iTCSession.SetPasscodeMinLength( value ) ); |
|
1099 } |
|
1100 break; |
|
1101 |
|
1102 case ETcNodeLockCodeMaxLength: |
|
1103 { |
|
1104 User::LeaveIfError( lex.Val( value ) ); |
|
1105 if( -1 == iLockCodeMaxLength ) |
|
1106 { |
|
1107 TInt err = |
|
1108 iTCSession.GetPasscodeMaxLength( iLockCodeMaxLength ); |
|
1109 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1110 { |
|
1111 User::Leave( err ); |
|
1112 } |
|
1113 } |
|
1114 User::LeaveIfError( iTCSession.SetPasscodeMaxLength( value ) ); |
|
1115 } |
|
1116 break; |
|
1117 |
|
1118 case ETcNodeLockCodeRequireUpperAndLower: |
|
1119 { |
|
1120 if ( boolValue == -1 ) |
|
1121 { |
|
1122 User::LeaveIfError( lex.Val( value ) ); |
|
1123 } |
|
1124 else |
|
1125 { |
|
1126 value = boolValue; |
|
1127 } |
|
1128 |
|
1129 if( -1 == iLockCodeRequireUpperAndLowerInt ) |
|
1130 { |
|
1131 TInt err = |
|
1132 iTCSession.GetPasscodeRequireUpperAndLower( |
|
1133 iLockCodeRequireUpperAndLower ); |
|
1134 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1135 { |
|
1136 User::Leave( err ); |
|
1137 } |
|
1138 iLockCodeRequireUpperAndLowerInt = 0; |
|
1139 } |
|
1140 User::LeaveIfError( |
|
1141 iTCSession.SetPasscodeRequireUpperAndLower( value ) ); |
|
1142 } |
|
1143 break; |
|
1144 |
|
1145 case ETcNodeLockCodeRequireCharsAndNumbers: |
|
1146 { |
|
1147 if ( boolValue == -1 ) |
|
1148 { |
|
1149 User::LeaveIfError( lex.Val( value ) ); |
|
1150 } |
|
1151 else |
|
1152 { |
|
1153 value = boolValue; |
|
1154 } |
|
1155 |
|
1156 if( -1 == iLockCodeRequireCharsAndNumbersInt ) |
|
1157 { |
|
1158 TInt err = iTCSession.GetPasscodeRequireCharsAndNumbers( |
|
1159 iLockCodeRequireCharsAndNumbers ); |
|
1160 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1161 { |
|
1162 User::Leave( err ); |
|
1163 } |
|
1164 iLockCodeRequireCharsAndNumbersInt = 0; |
|
1165 } |
|
1166 User::LeaveIfError( |
|
1167 iTCSession.SetPasscodeRequireCharsAndNumbers( value ) ); |
|
1168 } |
|
1169 break; |
|
1170 |
|
1171 case ETcNodeLockCodeMaxRepeatedCharacters: |
|
1172 { |
|
1173 User::LeaveIfError( lex.Val( value ) ); |
|
1174 if( -1 == iLockCodeMaxRepeatedCharacters ) |
|
1175 { |
|
1176 TInt err = iTCSession.GetPasscodeMaxRepeatedCharacters( |
|
1177 iLockCodeMaxRepeatedCharacters ); |
|
1178 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1179 { |
|
1180 User::Leave( err ); |
|
1181 } |
|
1182 } |
|
1183 User::LeaveIfError( |
|
1184 iTCSession.SetPasscodeMaxRepeatedCharacters( value ) ); |
|
1185 } |
|
1186 break; |
|
1187 |
|
1188 case ETcNodeLockCodeHistoryBuffer: |
|
1189 { |
|
1190 User::LeaveIfError( lex.Val( value ) ); |
|
1191 if( -1 == iLockCodeHistoryBuffer ) |
|
1192 { |
|
1193 TInt err = iTCSession.GetPasscodeHistoryBuffer( |
|
1194 iLockCodeHistoryBuffer ); |
|
1195 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1196 { |
|
1197 User::Leave( err ); |
|
1198 } |
|
1199 } |
|
1200 User::LeaveIfError( |
|
1201 iTCSession.SetPasscodeHistoryBuffer( value ) ); |
|
1202 } |
|
1203 break; |
|
1204 |
|
1205 case ETcNodeLockCodeExpiration: |
|
1206 { |
|
1207 User::LeaveIfError( lex.Val( value ) ); |
|
1208 if( -1 == iLockCodeExpiration ) |
|
1209 { |
|
1210 TInt err = |
|
1211 iTCSession.GetPasscodeExpiration( iLockCodeExpiration ); |
|
1212 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1213 { |
|
1214 User::Leave( err ); |
|
1215 } |
|
1216 } |
|
1217 User::LeaveIfError( iTCSession.SetPasscodeExpiration( value ) ); |
|
1218 } |
|
1219 break; |
|
1220 |
|
1221 case ETcNodeLockCodeMinChangeTolerance: |
|
1222 { |
|
1223 User::LeaveIfError( lex.Val( value ) ); |
|
1224 if( -1 == iLockCodeMinChangeTolerance ) |
|
1225 { |
|
1226 TInt err = iTCSession.GetPasscodeMinChangeTolerance( |
|
1227 iLockCodeMinChangeTolerance ); |
|
1228 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1229 { |
|
1230 User::Leave( err ); |
|
1231 } |
|
1232 } |
|
1233 User::LeaveIfError( |
|
1234 iTCSession.SetPasscodeMinChangeTolerance( value ) ); |
|
1235 } |
|
1236 break; |
|
1237 |
|
1238 case ETcNodeLockCodeMinChangeInterval: |
|
1239 { |
|
1240 User::LeaveIfError( lex.Val( value ) ); |
|
1241 if( -1 == iLockCodeMinChangeInterval ) |
|
1242 { |
|
1243 TInt err = iTCSession.GetPasscodeMinChangeInterval( |
|
1244 iLockCodeMinChangeInterval ); |
|
1245 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1246 { |
|
1247 User::Leave( err ); |
|
1248 } |
|
1249 } |
|
1250 User::LeaveIfError( |
|
1251 iTCSession.SetPasscodeMinChangeInterval( value ) ); |
|
1252 } |
|
1253 break; |
|
1254 |
|
1255 case ETcNodeLockCodeCheckSpecificStrings: |
|
1256 { |
|
1257 if ( boolValue == -1 ) |
|
1258 { |
|
1259 User::LeaveIfError( lex.Val( value ) ); |
|
1260 } |
|
1261 else |
|
1262 { |
|
1263 value = boolValue; |
|
1264 } |
|
1265 |
|
1266 if( -1 == iLockCodeCheckSpecificStringsInt ) |
|
1267 { |
|
1268 TInt err = iTCSession.GetPasscodeCheckSpecificStrings( |
|
1269 iLockCodeCheckSpecificStrings ); |
|
1270 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1271 { |
|
1272 User::Leave( err ); |
|
1273 } |
|
1274 iLockCodeCheckSpecificStringsInt = 0; |
|
1275 } |
|
1276 User::LeaveIfError( |
|
1277 iTCSession.SetPasscodeCheckSpecificStrings( value ) ); |
|
1278 } |
|
1279 break; |
|
1280 |
|
1281 case ETcNodeLockCodeDisallowSpecific: |
|
1282 { |
|
1283 // no rollback possibility |
|
1284 TInt err = iTCSession.DisallowSpecificPasscodeString( aObject ); |
|
1285 if( err != KErrNone ) |
|
1286 { |
|
1287 User::Leave( err ); |
|
1288 } |
|
1289 } |
|
1290 break; |
|
1291 |
|
1292 case ETcNodeLockCodeAllowSpecific: |
|
1293 { |
|
1294 // no rollback possibility |
|
1295 TInt err = iTCSession.AllowSpecificPasscodeString( aObject ); |
|
1296 if( err != KErrNone ) |
|
1297 { |
|
1298 User::Leave( err ); |
|
1299 } |
|
1300 } |
|
1301 break; |
|
1302 |
|
1303 case ETcNodeLockCodeClearSpecificStrings: |
|
1304 { |
|
1305 TInt err = iTCSession.ClearSpecificPasscodeStrings(); |
|
1306 if( err != KErrNone ) |
|
1307 { |
|
1308 User::Leave( err ); |
|
1309 } |
|
1310 } |
|
1311 break; |
|
1312 |
|
1313 case ETcNodeLockCodeMaxAttempts: |
|
1314 { |
|
1315 User::LeaveIfError( lex.Val( value ) ); |
|
1316 if( -1 == iLockCodeMaxAttempts ) |
|
1317 { |
|
1318 TInt err = |
|
1319 iTCSession.GetPasscodeMaxAttempts( iLockCodeMaxAttempts ); |
|
1320 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1321 { |
|
1322 User::Leave( err ); |
|
1323 } |
|
1324 } |
|
1325 User::LeaveIfError( |
|
1326 iTCSession.SetPasscodeMaxAttempts( value ) ); |
|
1327 } |
|
1328 break; |
|
1329 |
|
1330 case ETcNodeLockConsecutiveNumbers: |
|
1331 { |
|
1332 if ( boolValue == -1 ) |
|
1333 { |
|
1334 User::LeaveIfError( lex.Val( value ) ); |
|
1335 } |
|
1336 else |
|
1337 { |
|
1338 value = boolValue; |
|
1339 } |
|
1340 |
|
1341 if( -1 == iLockCodeConsecutiveNumbersInt ) |
|
1342 { |
|
1343 TInt err = |
|
1344 iTCSession.GetPasscodeConsecutiveNumbers( |
|
1345 iLockCodeConsecutiveNumbers ); |
|
1346 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1347 { |
|
1348 User::Leave( err ); |
|
1349 } |
|
1350 iLockCodeConsecutiveNumbersInt = 0; |
|
1351 } |
|
1352 User::LeaveIfError( |
|
1353 iTCSession.SetPasscodeConsecutiveNumbers( value ) ); |
|
1354 } |
|
1355 break; |
|
1356 |
|
1357 case ETcNodeLockCodeMinSpecialCharacters: |
|
1358 { |
|
1359 User::LeaveIfError( lex.Val( value ) ); |
|
1360 if( -1 == iLockCodeMinSpecialCharacters ) |
|
1361 { |
|
1362 TInt err = iTCSession.GetPasscodeMinSpecialCharacters( |
|
1363 iLockCodeMinSpecialCharacters ); |
|
1364 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1365 { |
|
1366 User::Leave( err ); |
|
1367 } |
|
1368 } |
|
1369 User::LeaveIfError( |
|
1370 iTCSession.SetPasscodeMinSpecialCharacters( value ) ); |
|
1371 } |
|
1372 break; |
|
1373 |
|
1374 case ETcNodeLockDisallowSimple: |
|
1375 { |
|
1376 if ( boolValue == -1 ) |
|
1377 { |
|
1378 User::LeaveIfError( lex.Val( value ) ); |
|
1379 } |
|
1380 else |
|
1381 { |
|
1382 value = boolValue; |
|
1383 } |
|
1384 if( -1 == iLockCodeDisallowSimpleInt ) |
|
1385 { |
|
1386 TInt err = |
|
1387 iTCSession.GetPasscodeDisallowSimple( |
|
1388 iLockCodeDisallowSimple ); |
|
1389 if( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1390 { |
|
1391 User::Leave( err ); |
|
1392 } |
|
1393 iLockCodeDisallowSimpleInt = 0; |
|
1394 } |
|
1395 User::LeaveIfError( |
|
1396 iTCSession.SetPasscodeDisallowSimple( value ) ); |
|
1397 } |
|
1398 break; |
|
1399 //#endif |
|
1400 // --------- Enhanced features END -------------------- |
|
1401 |
|
1402 default: |
|
1403 { |
|
1404 User::Leave( KErrGeneral ); |
|
1405 } |
|
1406 break; |
|
1407 } |
|
1408 } |
|
1409 else |
|
1410 { |
|
1411 User::Leave( KErrGeneral ); |
|
1412 } |
|
1413 } |
|
1414 |
|
1415 // -------------------------------------------------------------------------- |
|
1416 // CTcAdapter::_UpdateLeafObjectL() |
|
1417 // ------------------------------------------------------------------------- |
|
1418 void CTcAdapter::_UpdateLeafObjectL( const TDesC8& /*aURI*/, |
|
1419 const TDesC8& /*aLUID*/, |
|
1420 RWriteStream*& /*aStream*/, |
|
1421 const TDesC8& /*aType*/, |
|
1422 TInt aStatusRef ) |
|
1423 { |
|
1424 RDEBUG("CTcAdapter::_UpdateLeafObjectL() (stream)"); |
|
1425 Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1426 } |
|
1427 |
|
1428 // ------------------------------------------------------------------- |
|
1429 // CTcAdapter::DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID ) |
|
1430 // ------------------------------------------------------------------- |
|
1431 void CTcAdapter::_DeleteObjectL( const TDesC8& /*aURI*/, |
|
1432 const TDesC8& /*aLUID*/, |
|
1433 const TInt aStatusRef) |
|
1434 { |
|
1435 RDEBUG("CTcAdapter::_DeleteObjectL()"); |
|
1436 Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1437 } |
|
1438 |
|
1439 // ------------------------------------------------------------------ |
|
1440 // CTcAdapter::FetchLeafObjectL |
|
1441 // ------------------------------------------------------------------ |
|
1442 |
|
1443 |
|
1444 |
|
1445 CSmlDmAdapter::TError CTcAdapter::FetchLeafObjectL( const TDesC8& aURI, |
|
1446 const TDesC8& aLUID, |
|
1447 const TDesC8& aType, |
|
1448 CBufFlat* aObject, |
|
1449 CBufFlat* aRetMime ) |
|
1450 { |
|
1451 RDEBUG("CTcAdapter::FetchLeafObjectL()"); |
|
1452 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
1453 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
1454 TRAPD( err, FetchLeafObjectToBeTrappedL( uriPtrc, aLUID, aType, aObject, aRetMime ) ); |
|
1455 #else |
|
1456 TRAPD( err, FetchLeafObjectToBeTrappedL( aURI, aLUID, aType, aObject, aRetMime ) ); |
|
1457 #endif |
|
1458 |
|
1459 CSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
1460 |
|
1461 if( err == KErrNotFound ) |
|
1462 { |
|
1463 status = CSmlDmAdapter::ENotFound; |
|
1464 } |
|
1465 else if( err != KErrNone ) |
|
1466 { |
|
1467 status = CSmlDmAdapter::EError; |
|
1468 } |
|
1469 |
|
1470 return status; |
|
1471 } |
|
1472 |
|
1473 |
|
1474 void CTcAdapter::FetchLeafObjectToBeTrappedL( const TDesC8& aURI, |
|
1475 const TDesC8& /*aLUID*/, |
|
1476 const TDesC8& /*aType*/, |
|
1477 CBufFlat* aObject, |
|
1478 CBufFlat* aRetMime ) |
|
1479 { |
|
1480 RDEBUG("CTcAdapter::FetchLeafObjectToBeTrappedL()"); |
|
1481 |
|
1482 TInt32 retVal; |
|
1483 TBuf8<MAX_NUMBER_OF_DIGITS_IN_10BASE_INT64> numBuf; |
|
1484 TPtrC8 segment(0, 0); |
|
1485 |
|
1486 User::LeaveIfError( CheckTerminalControlSession() ); |
|
1487 |
|
1488 CTcAdapter::TTcNodeIdentifier identifier = GetNodeIdentifier(aURI); |
|
1489 |
|
1490 if((iAccessTypeList[identifier] & CTcAdapter::EGet) == CTcAdapter::EGet) |
|
1491 { |
|
1492 iAccessHistory[identifier] |= CTcAdapter::EGet; |
|
1493 |
|
1494 switch(identifier) |
|
1495 { |
|
1496 case ETcNodeTerminalControl: |
|
1497 break; |
|
1498 |
|
1499 case ETcNodeFileScanResults: |
|
1500 { |
|
1501 iTCSession.FileScanResultsL( aObject ); |
|
1502 aRetMime->InsertL( 0, KSmlTCTextXml() ); |
|
1503 |
|
1504 #if defined( __WINS_DEBUG_TESTING__ ) || defined ( __STIF_EMULATOR_TESTING__ ) |
|
1505 { |
|
1506 RFs fs; |
|
1507 User::LeaveIfError( fs.Connect() ); |
|
1508 RFile f; |
|
1509 User::LeaveIfError( f.Replace(fs, |
|
1510 KDebugFileName, EFileShareExclusive|EFileWrite) ); |
|
1511 User::LeaveIfError( |
|
1512 f.Write(aObject->Ptr(0),aObject->Size()) ); |
|
1513 f.Close(); |
|
1514 fs.Close(); |
|
1515 } |
|
1516 #endif |
|
1517 } |
|
1518 break; |
|
1519 |
|
1520 case ETcNodeDeviceLock: |
|
1521 break; |
|
1522 |
|
1523 case ETcNodeAutoLockPeriod: |
|
1524 { |
|
1525 iTCSession.GetAutolockPeriod( retVal ); |
|
1526 numBuf.Num( retVal ); |
|
1527 aObject->InsertL(0, numBuf); |
|
1528 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1529 } |
|
1530 break; |
|
1531 |
|
1532 case ETcNodeMaxAutoLockPeriod: |
|
1533 { |
|
1534 iTCSession.GetMaxAutolockPeriod( retVal ); |
|
1535 numBuf.Num( retVal ); |
|
1536 aObject->InsertL(0, numBuf); |
|
1537 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1538 } |
|
1539 break; |
|
1540 |
|
1541 case ETcNodeLockLevel: |
|
1542 { |
|
1543 iTCSession.GetDeviceLockLevel( retVal ); |
|
1544 numBuf.Num( retVal ); |
|
1545 aObject->InsertL(0, numBuf); |
|
1546 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1547 } |
|
1548 break; |
|
1549 |
|
1550 // --------- Enhanced features BEGIN ------------------ |
|
1551 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
1552 |
|
1553 case ETcNodeLockCodeMinLength: |
|
1554 { |
|
1555 TInt err = iTCSession.GetPasscodeMinLength( retVal ); |
|
1556 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1557 { |
|
1558 User::Leave( err ); |
|
1559 } |
|
1560 else if ( err == KErrNotFound ) // Param not set |
|
1561 { |
|
1562 retVal = KTCPassCodeMinLen; |
|
1563 } |
|
1564 numBuf.Num( retVal ); |
|
1565 aObject->InsertL( 0, numBuf ); |
|
1566 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1567 } |
|
1568 break; |
|
1569 |
|
1570 case ETcNodeLockCodeMaxLength: |
|
1571 { |
|
1572 TInt err = iTCSession.GetPasscodeMaxLength( retVal ); |
|
1573 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1574 { |
|
1575 User::Leave( err ); |
|
1576 } |
|
1577 else if ( err == KErrNotFound ) // Param not set |
|
1578 { |
|
1579 retVal = KTCPassCodeMaxLen; |
|
1580 } |
|
1581 numBuf.Num( retVal ); |
|
1582 aObject->InsertL( 0, numBuf ); |
|
1583 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1584 } |
|
1585 break; |
|
1586 |
|
1587 case ETcNodeLockCodeRequireUpperAndLower: |
|
1588 { |
|
1589 TBool require( EFalse ); |
|
1590 |
|
1591 TInt err = |
|
1592 iTCSession.GetPasscodeRequireUpperAndLower( require ); |
|
1593 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1594 { |
|
1595 User::Leave( err ); |
|
1596 } |
|
1597 else if ( err == KErrNotFound ) // Param not set |
|
1598 { |
|
1599 require = EFalse; |
|
1600 } |
|
1601 |
|
1602 if ( !require ) |
|
1603 { |
|
1604 numBuf.Copy( KTCValueFalse ); |
|
1605 } |
|
1606 else |
|
1607 { |
|
1608 numBuf.Copy( KTCValueTrue ); |
|
1609 } |
|
1610 aObject->InsertL( 0, numBuf ); |
|
1611 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1612 } |
|
1613 break; |
|
1614 |
|
1615 case ETcNodeLockCodeRequireCharsAndNumbers: |
|
1616 { |
|
1617 TBool require( EFalse ); |
|
1618 TInt err = |
|
1619 iTCSession.GetPasscodeRequireCharsAndNumbers( require ); |
|
1620 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1621 { |
|
1622 User::Leave( err ); |
|
1623 } |
|
1624 else if ( err == KErrNotFound ) // Param not set |
|
1625 { |
|
1626 require = EFalse; |
|
1627 } |
|
1628 |
|
1629 if ( !require ) |
|
1630 { |
|
1631 numBuf.Copy( KTCValueFalse ); |
|
1632 } |
|
1633 else |
|
1634 { |
|
1635 numBuf.Copy( KTCValueTrue ); |
|
1636 } |
|
1637 aObject->InsertL( 0, numBuf ); |
|
1638 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1639 } |
|
1640 break; |
|
1641 |
|
1642 case ETcNodeLockCodeMaxRepeatedCharacters: |
|
1643 { |
|
1644 TInt err = |
|
1645 iTCSession.GetPasscodeMaxRepeatedCharacters( retVal ); |
|
1646 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1647 { |
|
1648 User::Leave( err ); |
|
1649 } |
|
1650 else if ( err == KErrNotFound ) // Param not set |
|
1651 { |
|
1652 retVal = 0; |
|
1653 } |
|
1654 |
|
1655 numBuf.Num( retVal ); |
|
1656 aObject->InsertL( 0, numBuf ); |
|
1657 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1658 } |
|
1659 break; |
|
1660 |
|
1661 case ETcNodeLockCodeHistoryBuffer: |
|
1662 { |
|
1663 TInt err = iTCSession.GetPasscodeHistoryBuffer( retVal ); |
|
1664 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1665 { |
|
1666 User::Leave( err ); |
|
1667 } |
|
1668 else if ( err == KErrNotFound ) // Param not set |
|
1669 { |
|
1670 retVal = 0; |
|
1671 } |
|
1672 |
|
1673 numBuf.Num( retVal ); |
|
1674 aObject->InsertL( 0, numBuf ); |
|
1675 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1676 } |
|
1677 break; |
|
1678 |
|
1679 case ETcNodeLockCodeExpiration: |
|
1680 { |
|
1681 TInt err = iTCSession.GetPasscodeExpiration( retVal ); |
|
1682 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1683 { |
|
1684 User::Leave( err ); |
|
1685 } |
|
1686 else if ( err == KErrNotFound ) // Param not set |
|
1687 { |
|
1688 retVal = 0; |
|
1689 } |
|
1690 |
|
1691 numBuf.Num( retVal ); |
|
1692 aObject->InsertL( 0, numBuf ); |
|
1693 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1694 } |
|
1695 break; |
|
1696 |
|
1697 case ETcNodeLockCodeMinChangeTolerance: |
|
1698 { |
|
1699 TInt err = iTCSession.GetPasscodeMinChangeTolerance( retVal ); |
|
1700 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1701 { |
|
1702 User::Leave( err ); |
|
1703 } |
|
1704 else if ( err == KErrNotFound ) // Param not set |
|
1705 { |
|
1706 retVal = 0; |
|
1707 } |
|
1708 |
|
1709 numBuf.Num( retVal ); |
|
1710 aObject->InsertL( 0, numBuf ); |
|
1711 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1712 } |
|
1713 break; |
|
1714 |
|
1715 case ETcNodeLockCodeMinChangeInterval: |
|
1716 { |
|
1717 TInt err = iTCSession.GetPasscodeMinChangeInterval( retVal ); |
|
1718 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1719 { |
|
1720 User::Leave( err ); |
|
1721 } |
|
1722 else if ( err == KErrNotFound ) // Param not set |
|
1723 { |
|
1724 retVal = 0; |
|
1725 } |
|
1726 |
|
1727 numBuf.Num( retVal ); |
|
1728 aObject->InsertL( 0, numBuf ); |
|
1729 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1730 } |
|
1731 break; |
|
1732 |
|
1733 case ETcNodeLockCodeCheckSpecificStrings: |
|
1734 { |
|
1735 TBool require( EFalse ); |
|
1736 TInt err = |
|
1737 iTCSession.GetPasscodeCheckSpecificStrings( require ); |
|
1738 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1739 { |
|
1740 User::Leave( err ); |
|
1741 } |
|
1742 else if ( err == KErrNotFound ) // Param not set |
|
1743 { |
|
1744 require = EFalse; |
|
1745 } |
|
1746 |
|
1747 if ( !require ) |
|
1748 { |
|
1749 numBuf.Copy( KTCValueFalse ); |
|
1750 } |
|
1751 else |
|
1752 { |
|
1753 numBuf.Copy( KTCValueTrue ); |
|
1754 } |
|
1755 aObject->InsertL( 0, numBuf ); |
|
1756 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1757 } |
|
1758 break; |
|
1759 |
|
1760 case ETcNodeLockCodeDisallowSpecific: |
|
1761 { |
|
1762 // no implementation needed |
|
1763 } |
|
1764 break; |
|
1765 |
|
1766 case ETcNodeLockCodeAllowSpecific: |
|
1767 { |
|
1768 // no implementation needed |
|
1769 } |
|
1770 break; |
|
1771 |
|
1772 case ETcNodeLockCodeClearSpecificStrings: |
|
1773 { |
|
1774 // no implementation needed |
|
1775 } |
|
1776 break; |
|
1777 |
|
1778 case ETcNodeLockCodeMaxAttempts: |
|
1779 { |
|
1780 TInt err = iTCSession.GetPasscodeMaxAttempts( retVal ); |
|
1781 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1782 { |
|
1783 User::Leave( err ); |
|
1784 } |
|
1785 else if ( err == KErrNotFound ) // Param not set |
|
1786 { |
|
1787 retVal = 0; |
|
1788 } |
|
1789 |
|
1790 numBuf.Num( retVal ); |
|
1791 aObject->InsertL( 0, numBuf ); |
|
1792 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1793 } |
|
1794 break; |
|
1795 |
|
1796 case ETcNodeLockConsecutiveNumbers: |
|
1797 { |
|
1798 TBool require( EFalse ); |
|
1799 TInt err = iTCSession.GetPasscodeConsecutiveNumbers( require ); |
|
1800 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1801 { |
|
1802 User::Leave( err ); |
|
1803 } |
|
1804 else if ( err == KErrNotFound ) // Param not set |
|
1805 { |
|
1806 require = EFalse; |
|
1807 } |
|
1808 |
|
1809 if ( !require ) |
|
1810 { |
|
1811 numBuf.Copy( KTCValueFalse ); |
|
1812 } |
|
1813 else |
|
1814 { |
|
1815 numBuf.Copy( KTCValueTrue ); |
|
1816 } |
|
1817 aObject->InsertL( 0, numBuf ); |
|
1818 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1819 } |
|
1820 break; |
|
1821 |
|
1822 case ETcNodeLockCodeMinSpecialCharacters: |
|
1823 { |
|
1824 TInt err = |
|
1825 iTCSession.GetPasscodeMinSpecialCharacters( retVal ); |
|
1826 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1827 { |
|
1828 User::Leave( err ); |
|
1829 } |
|
1830 else if ( err == KErrNotFound ) // Param not set |
|
1831 { |
|
1832 retVal = 0; |
|
1833 } |
|
1834 |
|
1835 numBuf.Num( retVal ); |
|
1836 aObject->InsertL( 0, numBuf ); |
|
1837 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1838 } |
|
1839 break; |
|
1840 |
|
1841 case ETcNodeLockDisallowSimple: |
|
1842 { |
|
1843 TBool require( EFalse ); |
|
1844 TInt err = iTCSession.GetPasscodeDisallowSimple( require ); |
|
1845 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
1846 { |
|
1847 User::Leave( err ); |
|
1848 } |
|
1849 else if ( err == KErrNotFound ) // Param not set |
|
1850 { |
|
1851 require = EFalse; |
|
1852 } |
|
1853 if ( !require ) |
|
1854 { |
|
1855 numBuf.Copy( KTCValueFalse ); |
|
1856 } |
|
1857 else |
|
1858 { |
|
1859 numBuf.Copy( KTCValueTrue ); |
|
1860 } |
|
1861 aObject->InsertL( 0, numBuf ); |
|
1862 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1863 } |
|
1864 break; |
|
1865 //#endif |
|
1866 // --------- Enhanced features END -------------------- |
|
1867 |
|
1868 case ETcNodeProcesses: |
|
1869 break; |
|
1870 |
|
1871 case ETcNodeProcessesX: |
|
1872 break; |
|
1873 |
|
1874 case ETcNodeMemoryInfo: |
|
1875 { |
|
1876 segment.Set(NSmlDmURI::RemoveLastSeg( aURI )); |
|
1877 iTCSession.GetProcessDataL( aObject, |
|
1878 NSmlDmURI::LastURISeg( segment ), |
|
1879 NSmlDmURI::LastURISeg( aURI ) ); |
|
1880 aRetMime->InsertL( 0, KSmlTCTextXml() ); |
|
1881 } |
|
1882 break; |
|
1883 |
|
1884 case ETcNodeID: |
|
1885 case ETcNodeFromRAM: |
|
1886 case ETcNodeFilename: |
|
1887 { |
|
1888 segment.Set(NSmlDmURI::RemoveLastSeg( aURI )); |
|
1889 iTCSession.GetProcessDataL( aObject, |
|
1890 NSmlDmURI::LastURISeg( segment ), |
|
1891 NSmlDmURI::LastURISeg( aURI ) ); |
|
1892 aRetMime->InsertL( 0, KSmlTCTextPlain() ); |
|
1893 } |
|
1894 break; |
|
1895 |
|
1896 case ETcNodeLocalOperations: |
|
1897 break; |
|
1898 |
|
1899 default: |
|
1900 { |
|
1901 User::Leave( KErrNotSupported ); |
|
1902 } |
|
1903 break; |
|
1904 } |
|
1905 } |
|
1906 else |
|
1907 { |
|
1908 User::Leave( KErrNotSupported ); |
|
1909 } |
|
1910 } |
|
1911 |
|
1912 // ------------------------------------------------------------------------ |
|
1913 // CTcAdapter::_FetchLeafObjectL |
|
1914 // ------------------------------------------------------------------------ |
|
1915 void CTcAdapter::_FetchLeafObjectL( const TDesC8& aURI, |
|
1916 const TDesC8& aLUID, |
|
1917 const TDesC8& aType, |
|
1918 const TInt aResultsRef, |
|
1919 const TInt aStatusRef ) |
|
1920 { |
|
1921 RDEBUG("CTcAdapter::_FetchLeafObjectL()"); |
|
1922 |
|
1923 CBufFlat *object = CBufFlat::NewL( KFlatBufSize ); |
|
1924 CleanupStack::PushL( object ); |
|
1925 |
|
1926 CBufFlat *newMime = CBufFlat::NewL( KFlatMimeBufSize ); |
|
1927 CleanupStack::PushL( newMime ); |
|
1928 |
|
1929 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
1930 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
1931 CSmlDmAdapter::TError status = |
|
1932 FetchLeafObjectL( uriPtrc, aLUID, aType, object, newMime ); |
|
1933 #else |
|
1934 CSmlDmAdapter::TError status = |
|
1935 FetchLeafObjectL( aURI, aLUID, aType, object, newMime ); |
|
1936 #endif |
|
1937 |
|
1938 Callback().SetStatusL( aStatusRef, status ); |
|
1939 |
|
1940 if( status == CSmlDmAdapter::EOk) |
|
1941 { |
|
1942 object->Compress(); |
|
1943 Callback().SetResultsL( aResultsRef,*object, newMime->Ptr( 0 ) ); |
|
1944 } |
|
1945 |
|
1946 CleanupStack::PopAndDestroy( newMime ); |
|
1947 CleanupStack::PopAndDestroy( object ); |
|
1948 } |
|
1949 |
|
1950 // ---------------------------------------------------------------------- |
|
1951 // CTcAdapter::_FetchLeafObjectSizeL |
|
1952 // ---------------------------------------------------------------------- |
|
1953 void CTcAdapter::_FetchLeafObjectSizeL( const TDesC8& aURI, |
|
1954 const TDesC8& aLUID, |
|
1955 const TDesC8& aType, |
|
1956 TInt aResultsRef, |
|
1957 TInt aStatusRef ) |
|
1958 { |
|
1959 RDEBUG("CTcAdapter::_FetchLeafObjectSizeL()"); |
|
1960 |
|
1961 CBufFlat *object = CBufFlat::NewL( KFlatBufSize ); |
|
1962 CleanupStack::PushL( object ); |
|
1963 |
|
1964 CBufFlat *newMime = CBufFlat::NewL( KFlatMimeBufSize ); |
|
1965 CleanupStack::PushL( newMime ); |
|
1966 |
|
1967 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
1968 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
1969 CSmlDmAdapter::TError status = |
|
1970 FetchLeafObjectL( uriPtrc, aLUID, aType, object, newMime ); |
|
1971 #else |
|
1972 CSmlDmAdapter::TError status = |
|
1973 FetchLeafObjectL( aURI, aLUID, aType, object, newMime ); |
|
1974 #endif |
|
1975 |
|
1976 Callback().SetStatusL( aStatusRef, status ); |
|
1977 |
|
1978 if( status == CSmlDmAdapter::EOk) |
|
1979 { |
|
1980 TBuf8<MAX_NUMBER_OF_DIGITS_IN_10BASE_INT64> numBuf; |
|
1981 object->Compress(); |
|
1982 |
|
1983 CBufFlat *object2 = CBufFlat::NewL( KFlatBufSize ); |
|
1984 CleanupStack::PushL( object2 ); |
|
1985 |
|
1986 numBuf.Num(object->Size()); |
|
1987 object2->InsertL(0, numBuf); |
|
1988 object->Compress(); |
|
1989 Callback().SetResultsL( aResultsRef,*object2, KSmlTCTextPlain() ); |
|
1990 |
|
1991 CleanupStack::PopAndDestroy( object2 ); |
|
1992 } |
|
1993 |
|
1994 CleanupStack::PopAndDestroy( newMime ); |
|
1995 CleanupStack::PopAndDestroy( object ); |
|
1996 } |
|
1997 |
|
1998 // ------------------------------------------------------------------- |
|
1999 // CTcAdapter::_ChildURIListL( const TDesC8& aURI, |
|
2000 // const TDesC8& aParentLUID, const CArrayFix<TSmlDmMappingInfo>& |
|
2001 // aPreviousURISegmentList, CArrayFix<TPtrC>& aCurrentURISegmentList ) |
|
2002 // ------------------------------------------------------------------- |
|
2003 void CTcAdapter::_ChildURIListL( const TDesC8& aURI, |
|
2004 const TDesC8& /*aParentLUID*/, |
|
2005 const CArrayFix<TSmlDmMappingInfo>& /*aPreviousURISegmentList*/, |
|
2006 const TInt aResultsRef, const TInt aStatusRef ) |
|
2007 { |
|
2008 RDEBUG("CTcAdapter::_ChildURIListL()"); |
|
2009 |
|
2010 CSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
2011 |
|
2012 CBufFlat *currentList = CBufFlat::NewL( KFlatBufSize ); |
|
2013 CleanupStack::PushL( currentList ); |
|
2014 |
|
2015 User::LeaveIfError( CheckTerminalControlSession() ); |
|
2016 |
|
2017 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
2018 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
2019 CTcAdapter::TTcNodeIdentifier identifier = GetNodeIdentifier(uriPtrc); |
|
2020 #else |
|
2021 CTcAdapter::TTcNodeIdentifier identifier = GetNodeIdentifier(aURI); |
|
2022 #endif |
|
2023 |
|
2024 switch(identifier) |
|
2025 { |
|
2026 case ETcNodeTerminalControl: |
|
2027 currentList->InsertL(currentList->Size(), KTCFileScanNodeName()); |
|
2028 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2029 currentList->InsertL(currentList->Size(), KTCFileDeleteNodeName()); |
|
2030 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2031 currentList->InsertL(currentList->Size(), KTCDeviceLockNodeName()); |
|
2032 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2033 currentList->InsertL(currentList->Size(), KTCDeviceWipeNodeName()); |
|
2034 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2035 currentList->InsertL(currentList->Size(), KTCProcessesNodeName()); |
|
2036 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2037 currentList->InsertL(currentList->Size(), KTCRebootNodeName()); |
|
2038 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2039 currentList->InsertL(currentList->Size(), |
|
2040 KTCLocalOperationsNodeName()); |
|
2041 break; |
|
2042 |
|
2043 case ETcNodeFileScan: |
|
2044 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
2045 currentList->InsertL(currentList->Size(), |
|
2046 KTCFileScanExecuteNodeName()); |
|
2047 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2048 #endif |
|
2049 currentList->InsertL(currentList->Size(), |
|
2050 KTCFileScanResultsNodeName()); |
|
2051 break; |
|
2052 |
|
2053 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
2054 case ETcNodeFileScanExecute: |
|
2055 // nothing |
|
2056 break; |
|
2057 #endif |
|
2058 |
|
2059 case ETcNodeFileScanResults: |
|
2060 // nothing |
|
2061 break; |
|
2062 |
|
2063 case ETcNodeFileDelete: |
|
2064 // nothing |
|
2065 break; |
|
2066 |
|
2067 case ETcNodeDeviceLock: |
|
2068 currentList->InsertL(currentList->Size(), |
|
2069 KTCAutoLockPeriodNodeName()); |
|
2070 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2071 currentList->InsertL(currentList->Size(), KTCLockLevelNodeName()); |
|
2072 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2073 currentList->InsertL(currentList->Size(), KTCLockCodeNodeName()); |
|
2074 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2075 currentList->InsertL(currentList->Size(), |
|
2076 KTCMaxAutoLockPeriodNodeName()); |
|
2077 break; |
|
2078 |
|
2079 case ETcNodeAutoLockPeriod: |
|
2080 case ETcNodeMaxAutoLockPeriod: |
|
2081 case ETcNodeLockLevel: |
|
2082 case ETcNodeLockCode: |
|
2083 // nothing |
|
2084 break; |
|
2085 |
|
2086 case ETcNodeDeviceWipe: |
|
2087 // nothing |
|
2088 break; |
|
2089 |
|
2090 // --------- Enhanced features BEGIN ------------------ |
|
2091 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2092 |
|
2093 case ETcNodeLockCodeMinLength: |
|
2094 case ETcNodeLockCodeMaxLength: |
|
2095 case ETcNodeLockCodeRequireUpperAndLower: |
|
2096 case ETcNodeLockCodeRequireCharsAndNumbers: |
|
2097 case ETcNodeLockCodeMaxRepeatedCharacters: |
|
2098 case ETcNodeLockCodeHistoryBuffer: |
|
2099 case ETcNodeLockCodeExpiration: |
|
2100 case ETcNodeLockCodeMinChangeTolerance: |
|
2101 case ETcNodeLockCodeMinChangeInterval: |
|
2102 case ETcNodeLockCodeCheckSpecificStrings: |
|
2103 case ETcNodeLockCodeDisallowSpecific: |
|
2104 case ETcNodeLockCodeAllowSpecific: |
|
2105 case ETcNodeLockCodeClearSpecificStrings: |
|
2106 case ETcNodeLockCodeMaxAttempts: |
|
2107 case ETcNodeLockConsecutiveNumbers: |
|
2108 case ETcNodeLockCodeMinSpecialCharacters: |
|
2109 case ETcNodeLockDisallowSimple: |
|
2110 // nothing |
|
2111 break; |
|
2112 |
|
2113 //#endif |
|
2114 // --------- Enhanced features END -------------------- |
|
2115 case ETcNodeProcesses: |
|
2116 iTCSession.GetProcessListL( currentList ); |
|
2117 break; |
|
2118 |
|
2119 case ETcNodeProcessesX: |
|
2120 currentList->InsertL(currentList->Size(), KTCIDNodeName()); |
|
2121 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2122 currentList->InsertL(currentList->Size(), KTCFromRAMNodeName()); |
|
2123 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2124 currentList->InsertL(currentList->Size(), KTCMemoryInfoNodeName()); |
|
2125 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2126 currentList->InsertL(currentList->Size(), |
|
2127 KTCProcessFilenameNodeName()); |
|
2128 break; |
|
2129 |
|
2130 case ETcNodeID: |
|
2131 case ETcNodeFromRAM: |
|
2132 case ETcNodeMemoryInfo: |
|
2133 case ETcNodeFilename: |
|
2134 // nothing |
|
2135 break; |
|
2136 |
|
2137 case ETcNodeReboot: |
|
2138 // nothing |
|
2139 break; |
|
2140 |
|
2141 case ETcNodeLocalOperations: |
|
2142 currentList->InsertL(currentList->Size(), KTCStartNodeName()); |
|
2143 currentList->InsertL(currentList->Size(), KTCSeparator8()); |
|
2144 currentList->InsertL(currentList->Size(), KTCStopNodeName()); |
|
2145 break; |
|
2146 |
|
2147 case ETcNodeStart: |
|
2148 case ETcNodeStop: |
|
2149 // nothing |
|
2150 break; |
|
2151 |
|
2152 default: |
|
2153 if( aURI.Length() == 0) |
|
2154 { |
|
2155 currentList->InsertL(currentList->Size(), KTCNodeName()); |
|
2156 } |
|
2157 else |
|
2158 { |
|
2159 status = CSmlDmAdapter::EError; |
|
2160 } |
|
2161 break; |
|
2162 } |
|
2163 |
|
2164 Callback().SetStatusL( aStatusRef, status ); |
|
2165 |
|
2166 if( status == CSmlDmAdapter::EOk ) |
|
2167 { |
|
2168 currentList->Compress(); |
|
2169 Callback().SetResultsL( aResultsRef, *currentList, KNullDesC8 ); |
|
2170 } |
|
2171 |
|
2172 CleanupStack::PopAndDestroy( currentList ); |
|
2173 |
|
2174 } |
|
2175 |
|
2176 // ---------------------------------------------------------------- |
|
2177 // CTcAdapter::_AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID ) |
|
2178 // ---------------------------------------------------------------- |
|
2179 void CTcAdapter::_AddNodeObjectL( const TDesC8& /*aURI*/, |
|
2180 const TDesC8& /*aParentLUID*/, |
|
2181 const TInt aStatusRef ) |
|
2182 { |
|
2183 RDEBUG("CTcAdapter::_AddNodeObjectL()"); |
|
2184 |
|
2185 CSmlDmAdapter::TError ret = CSmlDmAdapter::EError; |
|
2186 Callback().SetStatusL( aStatusRef, ret ); |
|
2187 } |
|
2188 |
|
2189 // --------------------------------------------------------------- |
|
2190 // CTcAdapter::_ExecuteCommandL |
|
2191 // --------------------------------------------------------------- |
|
2192 void CTcAdapter::_ExecuteCommandL( const TDesC8& aURI, |
|
2193 const TDesC8& aLUID, |
|
2194 const TDesC8& aArgument, |
|
2195 const TDesC8& aType, |
|
2196 TInt aStatusRef ) |
|
2197 { |
|
2198 RDEBUG("CTcAdapter::_ExecuteCommandL()"); |
|
2199 |
|
2200 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
2201 TPtrC8 uriPtrc = NSmlDmURI::RemoveDotSlash( aURI ); |
|
2202 TRAPD( err, _ExecuteCommandToBeTrappedL( uriPtrc, aLUID, aArgument, aType, aStatusRef ) ); |
|
2203 #else |
|
2204 TRAPD( err, _ExecuteCommandToBeTrappedL( aURI, aLUID, aArgument, aType, aStatusRef ) ); |
|
2205 #endif |
|
2206 |
|
2207 CSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
2208 |
|
2209 if( err != KErrNone ) |
|
2210 { |
|
2211 status = CSmlDmAdapter::EError; |
|
2212 } |
|
2213 |
|
2214 Callback().SetStatusL( aStatusRef, status ); |
|
2215 } |
|
2216 |
|
2217 void CTcAdapter::_ExecuteCommandToBeTrappedL( const TDesC8& aURI, |
|
2218 const TDesC8& /*aLUID*/, |
|
2219 const TDesC8& aArgument, |
|
2220 const TDesC8& /*aType*/, |
|
2221 TInt /*aStatusRef*/ ) |
|
2222 { |
|
2223 RDEBUG("CTcAdapter::_ExecuteCommandToBeTrappedL()"); |
|
2224 |
|
2225 TFileName8 startPath; |
|
2226 TBool recursiveScan; |
|
2227 |
|
2228 User::LeaveIfError( CheckTerminalControlSession() ); |
|
2229 CTcAdapter::TTcNodeIdentifier identifier = GetNodeIdentifier(aURI); |
|
2230 |
|
2231 if((iAccessTypeList[identifier] & CTcAdapter::EExecute) == |
|
2232 CTcAdapter::EExecute) |
|
2233 { |
|
2234 iAccessHistory[identifier] |= CTcAdapter::EExecute; |
|
2235 |
|
2236 switch(identifier) |
|
2237 { |
|
2238 case ETcNodeFileScan: |
|
2239 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
2240 case ETcNodeFileScanExecute: |
|
2241 #endif |
|
2242 ParseStartPathL(aArgument, startPath, recursiveScan); |
|
2243 User::LeaveIfError( |
|
2244 iTCSession.FileScan(startPath, recursiveScan) ); |
|
2245 break; |
|
2246 |
|
2247 case ETcNodeFileDelete: |
|
2248 User::LeaveIfError( iTCSession.DeleteFile(aArgument) ); |
|
2249 break; |
|
2250 |
|
2251 case ETcNodeDeviceWipe: |
|
2252 User::LeaveIfError( iTCSession.DeviceWipe() ); |
|
2253 break; |
|
2254 |
|
2255 // --------- Enhanced features BEGIN ------------------ |
|
2256 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2257 |
|
2258 case ETcNodeLockCodeClearSpecificStrings: |
|
2259 { |
|
2260 User::LeaveIfError( |
|
2261 iTCSession.ClearSpecificPasscodeStrings() ); |
|
2262 } |
|
2263 break; |
|
2264 |
|
2265 //#endif |
|
2266 // --------- Enhanced features END -------------------- |
|
2267 |
|
2268 case ETcNodeReboot: |
|
2269 User::LeaveIfError( iTCSession.RebootDevice() ); |
|
2270 break; |
|
2271 |
|
2272 case ETcNodeStart: |
|
2273 StartProcessL(aArgument); |
|
2274 break; |
|
2275 |
|
2276 case ETcNodeStop: |
|
2277 StopProcessL(aArgument); |
|
2278 break; |
|
2279 |
|
2280 default: |
|
2281 { |
|
2282 User::Leave( KErrNotSupported ); |
|
2283 } |
|
2284 break; |
|
2285 } |
|
2286 } |
|
2287 else |
|
2288 { |
|
2289 User::Leave( KErrNotSupported ); |
|
2290 } |
|
2291 } |
|
2292 |
|
2293 // ------------------------------------------------------------------ |
|
2294 // CTcAdapter::_ExecuteCommandL |
|
2295 // ------------------------------------------------------------------ |
|
2296 void CTcAdapter::_ExecuteCommandL( const TDesC8& /*aURI*/, |
|
2297 const TDesC8& /*aLUID*/, |
|
2298 RWriteStream*& /*aStream*/, |
|
2299 const TDesC8& /*aType*/, |
|
2300 TInt aStatusRef ) |
|
2301 { |
|
2302 RDEBUG("CTcAdapter::_ExecuteCommandL()"); |
|
2303 |
|
2304 Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
2305 } |
|
2306 |
|
2307 // ---------------------------------------------------------------- |
|
2308 // CTcAdapter::_CopyCommandL |
|
2309 // ---------------------------------------------------------------- |
|
2310 void CTcAdapter::_CopyCommandL( const TDesC8& /*aTargetURI*/, |
|
2311 const TDesC8& /*aTargetLUID*/, |
|
2312 const TDesC8& /*aSourceURI*/, |
|
2313 const TDesC8& /*aSourceLUID*/, |
|
2314 const TDesC8& /*aType*/, |
|
2315 TInt aStatusRef ) |
|
2316 { |
|
2317 RDEBUG("CTcAdapter::_CopyCommandL()"); |
|
2318 |
|
2319 Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
2320 } |
|
2321 |
|
2322 // ---------------------------------------------------------------- |
|
2323 // CTcAdapter::StartAtomicL |
|
2324 // ---------------------------------------------------------------- |
|
2325 void CTcAdapter::StartAtomicL() |
|
2326 { |
|
2327 RDEBUG("CTcAdapter::StartAtomicL()"); |
|
2328 |
|
2329 memset(&iAccessHistory[0], CTcAdapter::ENoAccess, sizeof(iAccessHistory)); |
|
2330 iAutoLockPeriod = -1; |
|
2331 iLockLevel = -1; |
|
2332 iMaxAutoLockPeriod = -1; |
|
2333 // --------- Enhanced features BEGIN ------------------ |
|
2334 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2335 iLockCodeMinLength = -1; |
|
2336 iLockCodeMaxLength = -1; |
|
2337 iLockCodeRequireUpperAndLowerInt = -1; |
|
2338 iLockCodeRequireCharsAndNumbersInt = -1; |
|
2339 iLockCodeMaxRepeatedCharacters = -1; |
|
2340 iLockCodeHistoryBuffer = -1; |
|
2341 iLockCodeExpiration = -1; |
|
2342 iLockCodeMinChangeTolerance = -1; |
|
2343 iLockCodeMinChangeInterval = -1; |
|
2344 iLockCodeCheckSpecificStringsInt = -1; |
|
2345 iLockCodeMaxAttempts = -1; |
|
2346 iLockCodeConsecutiveNumbersInt = -1; |
|
2347 iLockCodeMinSpecialCharacters = -1; |
|
2348 iLockCodeDisallowSimpleInt = -1; |
|
2349 //#endif |
|
2350 // --------- Enhanced features END -------------------- |
|
2351 } |
|
2352 |
|
2353 // --------------------------------------------------------------------- |
|
2354 // CTcAdapter::CommitAtomicL |
|
2355 // --------------------------------------------------------------------- |
|
2356 void CTcAdapter::CommitAtomicL() |
|
2357 { |
|
2358 RDEBUG("CTcAdapter::CommitAtomicL()"); |
|
2359 |
|
2360 memset(&iAccessHistory[0], CTcAdapter::ENoAccess, sizeof(iAccessHistory)); |
|
2361 iAutoLockPeriod = -1; |
|
2362 iLockLevel = -1; |
|
2363 iMaxAutoLockPeriod = -1; |
|
2364 // --------- Enhanced features BEGIN ------------------ |
|
2365 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2366 iLockCodeMinLength = -1; |
|
2367 iLockCodeMaxLength = -1; |
|
2368 iLockCodeRequireUpperAndLowerInt = -1; |
|
2369 iLockCodeRequireCharsAndNumbersInt = -1; |
|
2370 iLockCodeMaxRepeatedCharacters = -1; |
|
2371 iLockCodeHistoryBuffer = -1; |
|
2372 iLockCodeExpiration = -1; |
|
2373 iLockCodeMinChangeTolerance = -1; |
|
2374 iLockCodeMinChangeInterval = -1; |
|
2375 iLockCodeCheckSpecificStringsInt = -1; |
|
2376 iLockCodeMaxAttempts = -1; |
|
2377 iLockCodeConsecutiveNumbersInt = -1; |
|
2378 iLockCodeMinSpecialCharacters = -1; |
|
2379 iLockCodeDisallowSimpleInt = -1; |
|
2380 //#endif |
|
2381 // --------- Enhanced features END -------------------- |
|
2382 |
|
2383 // Note: possible reboot operation remains waiting in |
|
2384 // server until session is closed |
|
2385 // - CommitAtomic() will not directly cause restart of device |
|
2386 // - Restart is actually done when session is closed |
|
2387 // - It is up to DM client to close session by destroying adapter |
|
2388 } |
|
2389 |
|
2390 // ------------------------------------------------------------------- |
|
2391 // CTcAdapter::RollbackAtomicL |
|
2392 // ------------------------------------------------------------------- |
|
2393 void CTcAdapter::RollbackAtomicL() |
|
2394 { |
|
2395 RDEBUG("CTcAdapter::RollbackAtomicL()"); |
|
2396 |
|
2397 TInt i; |
|
2398 |
|
2399 // Not needed User::LeaveIfError( CheckTerminalControlSession() ); |
|
2400 |
|
2401 if( iAccessHistory[ETcNodeReboot] & CTcAdapter::EExecute ) |
|
2402 { |
|
2403 if( KErrNone == iTCSession.RebootDevice( EFalse ) ) |
|
2404 { |
|
2405 iAccessHistory[ETcNodeReboot] &= (~CTcAdapter::EExecute); |
|
2406 } |
|
2407 } |
|
2408 // NOw |
|
2409 // Rollback should be done is certain order to |
|
2410 // prevent momentary illegal values |
|
2411 // It is assumed that setting always succeeds in this order |
|
2412 // iMaxAutoLockPeriod, iAutoLockPeriod, iLockLevel |
|
2413 if( (iAccessHistory[ETcNodeMaxAutoLockPeriod] & CTcAdapter::EReplace) && |
|
2414 (-1 != iMaxAutoLockPeriod) ) |
|
2415 { |
|
2416 if( KErrNone == iTCSession.SetMaxAutolockPeriod( iMaxAutoLockPeriod )) |
|
2417 { |
|
2418 iAccessHistory[ETcNodeMaxAutoLockPeriod] &= (~CTcAdapter::EReplace); |
|
2419 } |
|
2420 } |
|
2421 if( (iAccessHistory[ETcNodeAutoLockPeriod] & CTcAdapter::EReplace) && |
|
2422 (-1 != iAutoLockPeriod) ) |
|
2423 { |
|
2424 if( KErrNone == iTCSession.SetAutolockPeriod( iAutoLockPeriod ) ) |
|
2425 { |
|
2426 iAccessHistory[ETcNodeAutoLockPeriod] &= (~CTcAdapter::EReplace); |
|
2427 } |
|
2428 } |
|
2429 if( (iAccessHistory[ETcNodeLockLevel] & CTcAdapter::EReplace ) && |
|
2430 (-1 != iLockLevel) ) |
|
2431 { |
|
2432 if( KErrNone == iTCSession.SetDeviceLockLevel( iLockLevel ) ) |
|
2433 { |
|
2434 iAccessHistory[ETcNodeLockLevel] &= (~CTcAdapter::EReplace); |
|
2435 } |
|
2436 } |
|
2437 |
|
2438 // --------- Enhanced features BEGIN ------------------ |
|
2439 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2440 |
|
2441 if( ( iAccessHistory[ ETcNodeLockCodeMinLength ] & CTcAdapter::EReplace ) && |
|
2442 ( -1 != iLockCodeMinLength ) ) |
|
2443 { |
|
2444 if( KErrNone == iTCSession.SetPasscodeMinLength( iLockCodeMinLength ) ) |
|
2445 { |
|
2446 iAccessHistory[ ETcNodeLockCodeMinLength ] &= |
|
2447 ( ~CTcAdapter::EReplace ); |
|
2448 } |
|
2449 } |
|
2450 |
|
2451 if( ( iAccessHistory[ ETcNodeLockCodeMaxLength ] & CTcAdapter::EReplace ) && |
|
2452 ( -1 != iLockCodeMaxLength ) ) |
|
2453 { |
|
2454 if( KErrNone == iTCSession.SetPasscodeMaxLength( iLockCodeMaxLength ) ) |
|
2455 { |
|
2456 iAccessHistory[ ETcNodeLockCodeMaxLength ] &= |
|
2457 ( ~CTcAdapter::EReplace ); |
|
2458 } |
|
2459 } |
|
2460 |
|
2461 if( ( iAccessHistory[ ETcNodeLockCodeRequireUpperAndLower ] & |
|
2462 CTcAdapter::EReplace ) && |
|
2463 ( -1 != iLockCodeRequireUpperAndLowerInt ) ) |
|
2464 { |
|
2465 if( KErrNone == iTCSession.SetPasscodeRequireUpperAndLower( |
|
2466 iLockCodeRequireUpperAndLower ) ) |
|
2467 { |
|
2468 iAccessHistory[ ETcNodeLockCodeRequireUpperAndLower ] &= |
|
2469 ( ~CTcAdapter::EReplace ); |
|
2470 } |
|
2471 } |
|
2472 |
|
2473 if( ( iAccessHistory[ ETcNodeLockCodeRequireCharsAndNumbers ] & |
|
2474 CTcAdapter::EReplace ) && |
|
2475 ( -1 != iLockCodeRequireCharsAndNumbersInt ) ) |
|
2476 { |
|
2477 if( KErrNone == iTCSession.SetPasscodeRequireCharsAndNumbers( |
|
2478 iLockCodeRequireCharsAndNumbers ) ) |
|
2479 { |
|
2480 iAccessHistory[ ETcNodeLockCodeRequireCharsAndNumbers ] &= |
|
2481 ( ~CTcAdapter::EReplace ); |
|
2482 } |
|
2483 } |
|
2484 |
|
2485 if( ( iAccessHistory[ ETcNodeLockCodeMaxRepeatedCharacters ] & |
|
2486 CTcAdapter::EReplace ) && |
|
2487 ( -1 != iLockCodeMaxRepeatedCharacters ) ) |
|
2488 { |
|
2489 if( KErrNone == iTCSession.SetPasscodeMaxRepeatedCharacters( |
|
2490 iLockCodeMaxRepeatedCharacters ) ) |
|
2491 { |
|
2492 iAccessHistory[ ETcNodeLockCodeMaxRepeatedCharacters ] &= |
|
2493 ( ~CTcAdapter::EReplace ); |
|
2494 } |
|
2495 } |
|
2496 |
|
2497 if( ( iAccessHistory[ ETcNodeLockCodeHistoryBuffer ] & |
|
2498 CTcAdapter::EReplace ) && |
|
2499 ( -1 != iLockCodeHistoryBuffer ) ) |
|
2500 { |
|
2501 if( KErrNone == iTCSession.SetPasscodeHistoryBuffer( |
|
2502 iLockCodeHistoryBuffer ) ) |
|
2503 { |
|
2504 iAccessHistory[ ETcNodeLockCodeHistoryBuffer ] &= |
|
2505 ( ~CTcAdapter::EReplace ); |
|
2506 } |
|
2507 } |
|
2508 |
|
2509 if( ( iAccessHistory[ ETcNodeLockCodeExpiration ] & |
|
2510 CTcAdapter::EReplace ) && |
|
2511 ( -1 != iLockCodeExpiration ) ) |
|
2512 { |
|
2513 if( KErrNone == iTCSession.SetPasscodeExpiration( |
|
2514 iLockCodeExpiration ) ) |
|
2515 { |
|
2516 iAccessHistory[ ETcNodeLockCodeExpiration ] &= |
|
2517 ( ~CTcAdapter::EReplace ); |
|
2518 } |
|
2519 } |
|
2520 |
|
2521 if( ( iAccessHistory[ ETcNodeLockCodeMinChangeTolerance ] & |
|
2522 CTcAdapter::EReplace ) && |
|
2523 ( -1 != iLockCodeMinChangeTolerance ) ) |
|
2524 { |
|
2525 if( KErrNone == iTCSession.SetPasscodeMinChangeTolerance( |
|
2526 iLockCodeMinChangeTolerance ) ) |
|
2527 { |
|
2528 iAccessHistory[ ETcNodeLockCodeMinChangeTolerance ] &= |
|
2529 ( ~CTcAdapter::EReplace ); |
|
2530 } |
|
2531 } |
|
2532 |
|
2533 if( ( iAccessHistory[ ETcNodeLockCodeMinChangeInterval ] & |
|
2534 CTcAdapter::EReplace ) && |
|
2535 ( -1 != iLockCodeMinChangeInterval ) ) |
|
2536 { |
|
2537 if( KErrNone == iTCSession.SetPasscodeMinChangeInterval( |
|
2538 iLockCodeMinChangeInterval ) ) |
|
2539 { |
|
2540 iAccessHistory[ ETcNodeLockCodeMinChangeInterval ] &= |
|
2541 ( ~CTcAdapter::EReplace ); |
|
2542 } |
|
2543 } |
|
2544 |
|
2545 if( ( iAccessHistory[ ETcNodeLockCodeCheckSpecificStrings ] & |
|
2546 CTcAdapter::EReplace ) && |
|
2547 ( -1 != iLockCodeCheckSpecificStringsInt ) ) |
|
2548 { |
|
2549 if( KErrNone == iTCSession.SetPasscodeCheckSpecificStrings( |
|
2550 iLockCodeCheckSpecificStrings ) ) |
|
2551 { |
|
2552 iAccessHistory[ ETcNodeLockCodeCheckSpecificStrings ] &= |
|
2553 ( ~CTcAdapter::EReplace ); |
|
2554 } |
|
2555 } |
|
2556 |
|
2557 if( ( iAccessHistory[ ETcNodeLockCodeMaxAttempts ] & |
|
2558 CTcAdapter::EReplace ) && |
|
2559 ( -1 != iLockCodeMaxAttempts ) ) |
|
2560 { |
|
2561 if( KErrNone == |
|
2562 iTCSession.SetPasscodeMaxAttempts( iLockCodeMaxAttempts ) ) |
|
2563 { |
|
2564 iAccessHistory[ ETcNodeLockCodeMaxAttempts ] &= |
|
2565 ( ~CTcAdapter::EReplace ); |
|
2566 } |
|
2567 } |
|
2568 |
|
2569 if( ( iAccessHistory[ ETcNodeLockConsecutiveNumbers ] & |
|
2570 CTcAdapter::EReplace ) && |
|
2571 ( -1 != iLockCodeConsecutiveNumbersInt ) ) |
|
2572 { |
|
2573 if( KErrNone == iTCSession.SetPasscodeConsecutiveNumbers( |
|
2574 iLockCodeConsecutiveNumbers ) ) |
|
2575 { |
|
2576 iAccessHistory[ ETcNodeLockConsecutiveNumbers ] &= |
|
2577 ( ~CTcAdapter::EReplace ); |
|
2578 } |
|
2579 } |
|
2580 |
|
2581 if( ( iAccessHistory[ ETcNodeLockCodeMinSpecialCharacters ] & |
|
2582 CTcAdapter::EReplace ) && |
|
2583 ( -1 != iLockCodeMinSpecialCharacters ) ) |
|
2584 { |
|
2585 if( KErrNone == iTCSession.SetPasscodeMinSpecialCharacters( |
|
2586 iLockCodeMinSpecialCharacters ) ) |
|
2587 { |
|
2588 iAccessHistory[ ETcNodeLockCodeMinSpecialCharacters ] &= |
|
2589 ( ~CTcAdapter::EReplace ); |
|
2590 } |
|
2591 } |
|
2592 |
|
2593 if( ( iAccessHistory[ ETcNodeLockDisallowSimple ] & |
|
2594 CTcAdapter::EReplace ) && |
|
2595 ( -1 != iLockCodeDisallowSimpleInt ) ) |
|
2596 { |
|
2597 if( KErrNone == iTCSession.SetPasscodeDisallowSimple( |
|
2598 iLockCodeDisallowSimple ) ) |
|
2599 { |
|
2600 iAccessHistory[ ETcNodeLockDisallowSimple ] &= |
|
2601 ( ~CTcAdapter::EReplace ); |
|
2602 } |
|
2603 } |
|
2604 |
|
2605 //#endif |
|
2606 // --------- Enhanced features END -------------------- |
|
2607 |
|
2608 |
|
2609 for(i=0; i<ETcNodeNotUsedAndAlwaysLast; i++) |
|
2610 { |
|
2611 if(iAccessHistory[i] == CTcAdapter::EExecute) break; |
|
2612 if(iAccessHistory[i] == CTcAdapter::EReplace) break; |
|
2613 } |
|
2614 |
|
2615 |
|
2616 if(i == ETcNodeNotUsedAndAlwaysLast) |
|
2617 { |
|
2618 Callback().SetStatusL( 0, CSmlDmAdapter::EOk ); |
|
2619 } |
|
2620 else |
|
2621 { |
|
2622 Callback().SetStatusL( 0, CSmlDmAdapter::ERollbackFailed ); |
|
2623 } |
|
2624 |
|
2625 // Note: access history can remain dirty |
|
2626 } |
|
2627 |
|
2628 |
|
2629 // ---------------------------------------------------------------------- |
|
2630 // CTcAdapter::StreamingSupport |
|
2631 // ----------------------------------------------------------------------- |
|
2632 TBool CTcAdapter::StreamingSupport( TInt& /*aItemSize*/ ) |
|
2633 { |
|
2634 RDEBUG("CTcAdapter::StreamingSupport()"); |
|
2635 |
|
2636 return EFalse; |
|
2637 } |
|
2638 |
|
2639 // ------------------------------------------------------------------------ |
|
2640 // CTcAdapter::StreamCommittedL |
|
2641 // ------------------------------------------------------------------------ |
|
2642 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
2643 void CTcAdapter::StreamCommittedL( RWriteStream& /*aStream*/ ) |
|
2644 #else |
|
2645 void CTcAdapter::StreamCommittedL() |
|
2646 #endif |
|
2647 { |
|
2648 RDEBUG("CTcAdapter::StreamCommittedL(): begin"); |
|
2649 RDEBUG("CTcAdapter::StreamCommittedL(): end"); |
|
2650 } |
|
2651 |
|
2652 // -------------------------------------------------------------------------- |
|
2653 // CTcAdapter::CompleteOutstandingCmdsL |
|
2654 // -------------------------------------------------------------------------- |
|
2655 void CTcAdapter::CompleteOutstandingCmdsL() |
|
2656 { |
|
2657 RDEBUG("CTcAdapter::CompleteOutstandingCmdsL()"); |
|
2658 } |
|
2659 |
|
2660 // ------------------------------------------------------------------------- |
|
2661 // CTcAdapter::StartProcessL |
|
2662 // ------------------------------------------------------------------------- |
|
2663 TInt CTcAdapter::StartProcessL(const TDesC8& aURI) |
|
2664 { |
|
2665 RDEBUG("CTcAdapter::StartProcessL()"); |
|
2666 |
|
2667 TInt result = KErrNone; |
|
2668 MSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
2669 |
|
2670 _LIT8(KLinkPostfix, "/ID"); |
|
2671 TInt linkLength = aURI.Length() + KLinkPostfix().Length(); |
|
2672 |
|
2673 HBufC8* link = HBufC8::NewLC( linkLength ); |
|
2674 TPtr8 linkPtr( link->Des() ); |
|
2675 linkPtr.Copy( aURI ); |
|
2676 linkPtr.Append( KLinkPostfix() ); |
|
2677 |
|
2678 CBufFlat *object = CBufFlat::NewL( KFlatBufSize ); |
|
2679 CleanupStack::PushL( object ); |
|
2680 |
|
2681 TRAP( result, Callback().FetchLinkL( linkPtr, *object, status ) ); |
|
2682 |
|
2683 if( (KErrNone != result) || ( |
|
2684 CSmlDmAdapter::EOk != status) || (object->Size() <= 0)) |
|
2685 { |
|
2686 // Didn't find UID, argument is filename |
|
2687 // |
|
2688 result = iTCSession.StartNewProcess( EFalse, aURI ); |
|
2689 } |
|
2690 else |
|
2691 { |
|
2692 // Argument is UID |
|
2693 // |
|
2694 TLex8 lex; |
|
2695 TUint uid; |
|
2696 TBuf8<MAX_NUMBER_OF_DIGITS_IN_10BASE_INT64> uidBuf; |
|
2697 |
|
2698 lex.Assign( object->Ptr(0) ); |
|
2699 User::LeaveIfError( lex.Val( uid, EHex ) ); |
|
2700 uidBuf.Num( uid ); |
|
2701 |
|
2702 result = iTCSession.StartNewProcess( ETrue, uidBuf ); |
|
2703 } |
|
2704 |
|
2705 CleanupStack::PopAndDestroy( object ); |
|
2706 CleanupStack::PopAndDestroy( link ); |
|
2707 |
|
2708 return result; |
|
2709 } |
|
2710 |
|
2711 // ----------------------------------------------------------------------- |
|
2712 // CTcAdapter::StopProcessL |
|
2713 // ----------------------------------------------------------------------- |
|
2714 TInt CTcAdapter::StopProcessL(const TDesC8& aURI) |
|
2715 { |
|
2716 RDEBUG("CTcAdapter::StopProcessL()"); |
|
2717 |
|
2718 TInt result = KErrNone; |
|
2719 MSmlDmAdapter::TError status; |
|
2720 |
|
2721 _LIT8(KLinkPostfix, "/ID"); |
|
2722 TInt linkLength = aURI.Length() + KLinkPostfix().Length(); |
|
2723 |
|
2724 HBufC8* link = HBufC8::NewLC( linkLength ); |
|
2725 TPtr8 linkPtr( link->Des() ); |
|
2726 linkPtr.Copy( aURI ); |
|
2727 linkPtr.Append( KLinkPostfix() ); |
|
2728 |
|
2729 CBufFlat *object = CBufFlat::NewL( KFlatBufSize ); |
|
2730 CleanupStack::PushL( object ); |
|
2731 |
|
2732 TRAP( result, Callback().FetchLinkL( linkPtr, *object, status ) ); |
|
2733 |
|
2734 if( (KErrNone != result) || ( |
|
2735 CSmlDmAdapter::EOk != status) || (object->Size() <= 0) ) |
|
2736 { |
|
2737 // Didn't find UID, argument is filename |
|
2738 // |
|
2739 result = iTCSession.StopProcess( EFalse, aURI ); |
|
2740 } |
|
2741 else |
|
2742 { |
|
2743 // Argument is UID |
|
2744 // |
|
2745 TLex8 lex; |
|
2746 TUint uid; |
|
2747 TBuf8<MAX_NUMBER_OF_DIGITS_IN_10BASE_INT64> uidBuf; |
|
2748 |
|
2749 lex.Assign( object->Ptr(0) ); |
|
2750 User::LeaveIfError( lex.Val( uid, EHex ) ); |
|
2751 uidBuf.Num( uid ); |
|
2752 |
|
2753 //result = iTCSession.StopProcess( ETrue, object->Ptr(0) ); |
|
2754 result = iTCSession.StopProcess( ETrue, uidBuf ); |
|
2755 } |
|
2756 |
|
2757 CleanupStack::PopAndDestroy( object ); |
|
2758 CleanupStack::PopAndDestroy( link ); |
|
2759 |
|
2760 return result; |
|
2761 } |
|
2762 |
|
2763 #ifndef __WINS_DEBUG_TESTING__ |
|
2764 |
|
2765 // -------------------------------------------------------------------- |
|
2766 // |
|
2767 // -------------------------------------------------------------------- |
|
2768 const TImplementationProxy ImplementationTable[] = |
|
2769 { |
|
2770 { {KSmlDMTCAdapterImplUid}, (TProxyNewLPtr)CTcAdapter::NewL } |
|
2771 }; |
|
2772 |
|
2773 // ---------------------------------------------------------------------- |
|
2774 // |
|
2775 // ---------------------------------------------------------------------- |
|
2776 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
|
2777 TInt& aTableCount ) |
|
2778 { |
|
2779 aTableCount = sizeof( ImplementationTable ) / |
|
2780 sizeof( TImplementationProxy ); |
|
2781 return ImplementationTable; |
|
2782 } |
|
2783 |
|
2784 #endif |
|
2785 |
|
2786 // ----------------------------------------------------------------------- |
|
2787 // |
|
2788 // ------------------------------------------------------------------------ |
|
2789 void CTcAdapter::ConstructL( MSmlDmCallback* /*aDmCallback*/ ) |
|
2790 { |
|
2791 FeatureManager::InitializeLibL(); |
|
2792 if(FeatureManager::FeatureSupported(KFeatureIdSapPolicyManagement) && |
|
2793 FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw) ) |
|
2794 { |
|
2795 RDEBUG("CTcAdapter::ConstructL()"); |
|
2796 |
|
2797 // Connect to Terminal Control |
|
2798 User::LeaveIfError( iTC.Connect() ); |
|
2799 if( KErrNone != NewTerminalControlSession() ) |
|
2800 { |
|
2801 // Note: connect to tc will fail if dmsession is not open |
|
2802 RDEBUG("CTcAdapter::ConstructL() WARNING: Initial connection \ |
|
2803 to Terminal Control Server failed, I will try again later..." ); |
|
2804 } |
|
2805 } |
|
2806 else |
|
2807 { |
|
2808 FeatureManager::UnInitializeLib(); |
|
2809 User::Leave( KErrNotSupported ); |
|
2810 } |
|
2811 FeatureManager::UnInitializeLib(); |
|
2812 } |
|
2813 |
|
2814 // ------------------------------------------------------------------------- |
|
2815 // CTcAdapter::FillNodeInfoL() |
|
2816 // Fills the node info in ddf structure |
|
2817 // ------------------------------------------------------------------------- |
|
2818 void CTcAdapter::FillNodeInfoL( MSmlDmDDFObject& aNode, |
|
2819 TSmlDmAccessTypes aAccTypes, |
|
2820 MSmlDmDDFObject::TOccurence aOccurrence, |
|
2821 MSmlDmDDFObject::TScope aScope, |
|
2822 MSmlDmDDFObject::TDFFormat aFormat, |
|
2823 const TDesC8& aDescription, |
|
2824 const TDesC8& aMimeType) |
|
2825 { |
|
2826 RDEBUG("CTcAdapter::FillNodeInfoL()"); |
|
2827 |
|
2828 aNode.SetAccessTypesL(aAccTypes); |
|
2829 aNode.SetOccurenceL(aOccurrence); |
|
2830 aNode.SetScopeL(aScope); |
|
2831 aNode.SetDFFormatL(aFormat); |
|
2832 aNode.SetDescriptionL(aDescription); |
|
2833 if(aMimeType.Length() > 0) |
|
2834 { |
|
2835 aNode.AddDFTypeMimeTypeL(aMimeType); |
|
2836 } |
|
2837 } |
|
2838 |
|
2839 // -------------------------------------------------------------------------- |
|
2840 // CTcAdapter::CopyAndTrimMimeType() |
|
2841 // -------------------------------------------------------------------------- |
|
2842 void CTcAdapter::CopyAndTrimMimeType(TDes8& aNewMime, const TDesC8& aType) |
|
2843 { |
|
2844 RDEBUG("CTcAdapter::CopyAndTrimMimeType()"); |
|
2845 |
|
2846 if(aNewMime.MaxLength() < aType.Length()) |
|
2847 { |
|
2848 aNewMime.Copy( aType.Left(aNewMime.MaxLength()) ); |
|
2849 } |
|
2850 else |
|
2851 { |
|
2852 aNewMime.Copy( aType ); |
|
2853 } |
|
2854 aNewMime.TrimAll(); |
|
2855 aNewMime.LowerCase(); |
|
2856 |
|
2857 TInt pos; |
|
2858 while(( pos = aNewMime.Locate(' ') ) != KErrNotFound) |
|
2859 { |
|
2860 aNewMime.Delete(pos, 1); |
|
2861 } |
|
2862 } |
|
2863 |
|
2864 // ----------------------------------------------------------------------- |
|
2865 // CTcAdapter::CopyAndTrimMimeType() |
|
2866 // ----------------------------------------------------------------------- |
|
2867 void CTcAdapter::CopyAndTrimURI(TDes8& aNewURI, const TDesC8& aURI) |
|
2868 { |
|
2869 RDEBUG("CTcAdapter::CopyAndTrimURI()"); |
|
2870 |
|
2871 if(aNewURI.MaxLength() < aURI.Length()) |
|
2872 { |
|
2873 aNewURI.Copy( aURI.Left(aNewURI.MaxLength()) ); |
|
2874 } |
|
2875 else |
|
2876 { |
|
2877 aNewURI.Copy( aURI ); |
|
2878 } |
|
2879 aNewURI.LowerCase(); |
|
2880 |
|
2881 /* |
|
2882 |
|
2883 aNewURI.TrimAll(); |
|
2884 |
|
2885 |
|
2886 |
|
2887 TInt pos; |
|
2888 while(( pos = aNewURI.Locate(' ') ) != KErrNotFound) |
|
2889 { |
|
2890 aNewURI.Delete(pos, 1); |
|
2891 } |
|
2892 */ |
|
2893 |
|
2894 while(aNewURI.Left(1) == _L8("/")) |
|
2895 { |
|
2896 aNewURI = aNewURI.Right(aNewURI.Length()-1); |
|
2897 } |
|
2898 } |
|
2899 |
|
2900 // --------------------------------------------------------------------------- |
|
2901 // CTcAdapter::GetNodeIdentifier |
|
2902 // --------------------------------------------------------------------------- |
|
2903 CTcAdapter::TTcNodeIdentifier CTcAdapter::GetNodeIdentifier(const TDesC8& aURI) |
|
2904 { |
|
2905 RDEBUG("CTcAdapter::GetNodeIdentifier()"); |
|
2906 |
|
2907 TInt numOfSegs = NSmlDmURI::NumOfURISegs( aURI ) ; |
|
2908 TPtrC8I seg1 = NSmlDmURI::URISeg(aURI, 0); |
|
2909 |
|
2910 if(seg1 == KTCNodeName) |
|
2911 { |
|
2912 if(numOfSegs == 1) return CTcAdapter::ETcNodeTerminalControl; |
|
2913 |
|
2914 TPtrC8I seg2 = NSmlDmURI::URISeg(aURI, 1); |
|
2915 |
|
2916 if(seg2 == KTCFileScanNodeName) |
|
2917 { |
|
2918 TPtrC8I seg3 = NSmlDmURI::URISeg(aURI, 2); |
|
2919 |
|
2920 if(numOfSegs == 2) |
|
2921 { |
|
2922 return CTcAdapter::ETcNodeFileScan; |
|
2923 } |
|
2924 else |
|
2925 if((numOfSegs == 3) && (seg3 == KTCFileScanResultsNodeName)) |
|
2926 { |
|
2927 return CTcAdapter::ETcNodeFileScanResults; |
|
2928 } |
|
2929 #ifdef TCADAPTER_FILESCAN_EXECUTE_LEAF |
|
2930 else if((numOfSegs == 3) && (seg3 == KTCFileScanExecuteNodeName)) |
|
2931 { |
|
2932 return CTcAdapter::ETcNodeFileScanExecute; |
|
2933 } |
|
2934 #endif |
|
2935 else |
|
2936 { |
|
2937 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
2938 } |
|
2939 } |
|
2940 else |
|
2941 if(seg2 == KTCFileDeleteNodeName) |
|
2942 { |
|
2943 return CTcAdapter::ETcNodeFileDelete; |
|
2944 } |
|
2945 else |
|
2946 if(seg2 == KTCDeviceLockNodeName) |
|
2947 { |
|
2948 if(numOfSegs == 2) |
|
2949 { |
|
2950 // get TerminalControl/DeviceLock |
|
2951 return CTcAdapter::ETcNodeDeviceLock; |
|
2952 } |
|
2953 else |
|
2954 if(numOfSegs == 3) |
|
2955 { |
|
2956 TPtrC8I seg3 = NSmlDmURI::URISeg(aURI, 2); |
|
2957 |
|
2958 if(seg3 == KTCAutoLockPeriodNodeName) |
|
2959 { |
|
2960 return CTcAdapter::ETcNodeAutoLockPeriod; |
|
2961 } |
|
2962 if(seg3 == KTCMaxAutoLockPeriodNodeName) |
|
2963 { |
|
2964 return CTcAdapter::ETcNodeMaxAutoLockPeriod; |
|
2965 } |
|
2966 else |
|
2967 if(seg3 == KTCLockLevelNodeName) |
|
2968 { |
|
2969 return CTcAdapter::ETcNodeLockLevel; |
|
2970 } |
|
2971 else |
|
2972 if(seg3 == KTCLockCodeNodeName) |
|
2973 { |
|
2974 return CTcAdapter::ETcNodeLockCode; |
|
2975 } |
|
2976 // --------- Enhanced features BEGIN ------------------ |
|
2977 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
2978 |
|
2979 if( seg3 == KTCLockCodeMinLengthNodeName ) |
|
2980 { |
|
2981 return CTcAdapter::ETcNodeLockCodeMinLength; |
|
2982 } |
|
2983 if( seg3 == KTCLockCodeMaxLengthNodeName ) |
|
2984 { |
|
2985 return CTcAdapter::ETcNodeLockCodeMaxLength; |
|
2986 } |
|
2987 if( seg3 == KTCLockCodeRequireUpperAndLowerNodeName ) |
|
2988 { |
|
2989 return CTcAdapter::ETcNodeLockCodeRequireUpperAndLower; |
|
2990 } |
|
2991 if( seg3 == KTCLockCodeRequireCharsAndNumbersNodeName ) |
|
2992 { |
|
2993 return |
|
2994 CTcAdapter::ETcNodeLockCodeRequireCharsAndNumbers; |
|
2995 } |
|
2996 if( seg3 == KTCLockCodeMaxRepeatedCharactersNodeName ) |
|
2997 { |
|
2998 return |
|
2999 CTcAdapter::ETcNodeLockCodeMaxRepeatedCharacters; |
|
3000 } |
|
3001 if( seg3 == KTCLockCodeHistoryBufferNodeName ) |
|
3002 { |
|
3003 return CTcAdapter::ETcNodeLockCodeHistoryBuffer; |
|
3004 } |
|
3005 if( seg3 == KTCLockCodeExpirationNodeName ) |
|
3006 { |
|
3007 return CTcAdapter::ETcNodeLockCodeExpiration; |
|
3008 } |
|
3009 if( seg3 == KTCLockCodeMinChangeToleranceNodeName ) |
|
3010 { |
|
3011 return CTcAdapter::ETcNodeLockCodeMinChangeTolerance; |
|
3012 } |
|
3013 if( seg3 == KTCLockCodeMinChangeIntervalNodeName ) |
|
3014 { |
|
3015 return CTcAdapter::ETcNodeLockCodeMinChangeInterval; |
|
3016 } |
|
3017 if( seg3 == KTCLockCodeCheckSpecificStringsNodeName ) |
|
3018 { |
|
3019 return CTcAdapter::ETcNodeLockCodeCheckSpecificStrings; |
|
3020 } |
|
3021 if( seg3 == KTCLockCodeDisallowSpecificNodeName ) |
|
3022 { |
|
3023 return CTcAdapter::ETcNodeLockCodeDisallowSpecific; |
|
3024 } |
|
3025 if( seg3 == KTCLockCodeAllowSpecificNodeName ) |
|
3026 { |
|
3027 return CTcAdapter::ETcNodeLockCodeAllowSpecific; |
|
3028 } |
|
3029 if( seg3 == KTCLockCodeClearSpecificStringsNodeName ) |
|
3030 { |
|
3031 return CTcAdapter::ETcNodeLockCodeClearSpecificStrings; |
|
3032 } |
|
3033 if( seg3 == KTCLockCodeMaxAttemptsNodeName ) |
|
3034 { |
|
3035 return CTcAdapter::ETcNodeLockCodeMaxAttempts; |
|
3036 } |
|
3037 if( seg3 == KTCLockCodeConsecutiveNumbersNodeName ) |
|
3038 { |
|
3039 return CTcAdapter::ETcNodeLockConsecutiveNumbers; |
|
3040 } |
|
3041 if( seg3 == KTCLockCodeMinSpecialCharactersNodeName ) |
|
3042 { |
|
3043 return CTcAdapter::ETcNodeLockCodeMinSpecialCharacters; |
|
3044 } |
|
3045 if( seg3 == KTCLockCodeDisallowSimpleNodeName ) |
|
3046 { |
|
3047 return CTcAdapter::ETcNodeLockDisallowSimple; |
|
3048 } |
|
3049 |
|
3050 //#endif |
|
3051 // --------- Enhanced features END -------------------- |
|
3052 else |
|
3053 { |
|
3054 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3055 } |
|
3056 } |
|
3057 else |
|
3058 { |
|
3059 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3060 } |
|
3061 } |
|
3062 else |
|
3063 if(seg2 == KTCDeviceWipeNodeName) |
|
3064 { |
|
3065 return CTcAdapter::ETcNodeDeviceWipe; |
|
3066 } |
|
3067 else |
|
3068 if(seg2 == KTCLocalOperationsNodeName) |
|
3069 { |
|
3070 if(numOfSegs == 2) |
|
3071 { |
|
3072 return CTcAdapter::ETcNodeLocalOperations; |
|
3073 } |
|
3074 if(numOfSegs == 3) |
|
3075 { |
|
3076 TPtrC8I seg3 = NSmlDmURI::URISeg(aURI, 2); |
|
3077 |
|
3078 if(seg3 == KTCStartNodeName) |
|
3079 { |
|
3080 return CTcAdapter::ETcNodeStart; |
|
3081 } |
|
3082 else |
|
3083 if(seg3 == KTCStopNodeName) |
|
3084 { |
|
3085 return CTcAdapter::ETcNodeStop; |
|
3086 } |
|
3087 else |
|
3088 { |
|
3089 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3090 } |
|
3091 } |
|
3092 else |
|
3093 { |
|
3094 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3095 } |
|
3096 } |
|
3097 else |
|
3098 if(seg2 == KTCProcessesNodeName) |
|
3099 { |
|
3100 if(numOfSegs == 2) |
|
3101 { |
|
3102 return CTcAdapter::ETcNodeProcesses; |
|
3103 } |
|
3104 else |
|
3105 if(numOfSegs == 3) |
|
3106 { |
|
3107 return CTcAdapter::ETcNodeProcessesX; |
|
3108 } |
|
3109 else |
|
3110 if(numOfSegs == 4) |
|
3111 { |
|
3112 TPtrC8I seg4 = NSmlDmURI::URISeg(aURI, 3); |
|
3113 if(seg4 == KTCIDNodeName) |
|
3114 { |
|
3115 return CTcAdapter::ETcNodeID; |
|
3116 } |
|
3117 else |
|
3118 if(seg4 == KTCFromRAMNodeName) |
|
3119 { |
|
3120 return CTcAdapter::ETcNodeFromRAM; |
|
3121 } |
|
3122 else |
|
3123 if(seg4 == KTCMemoryInfoNodeName) |
|
3124 { |
|
3125 return CTcAdapter::ETcNodeMemoryInfo; |
|
3126 } |
|
3127 else |
|
3128 if(seg4 == KTCProcessFilenameNodeName) |
|
3129 { |
|
3130 return CTcAdapter::ETcNodeFilename; |
|
3131 } |
|
3132 else |
|
3133 { |
|
3134 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3135 } |
|
3136 } |
|
3137 else |
|
3138 { |
|
3139 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3140 } |
|
3141 |
|
3142 } |
|
3143 else |
|
3144 if(seg2 == KTCRebootNodeName) |
|
3145 { |
|
3146 if(numOfSegs == 2) |
|
3147 { |
|
3148 return CTcAdapter::ETcNodeReboot; |
|
3149 } |
|
3150 else |
|
3151 { |
|
3152 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3153 } |
|
3154 } |
|
3155 else |
|
3156 { |
|
3157 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3158 } |
|
3159 } |
|
3160 else |
|
3161 { |
|
3162 return CTcAdapter::ETcNodeNotUsedAndAlwaysLast; |
|
3163 } |
|
3164 |
|
3165 // Note: do not return anything here |
|
3166 } |
|
3167 |
|
3168 // -------------------------------------------------------------------------- |
|
3169 // CTcAdapter::NewTerminalControlSession |
|
3170 // --------------------------------------------------------------------------- |
|
3171 TInt CTcAdapter::NewTerminalControlSession() |
|
3172 { |
|
3173 RDEBUG("CTcAdapter::NewTerminalControlSession()"); |
|
3174 |
|
3175 TInt ret = KErrNone; |
|
3176 |
|
3177 if( iConnected ) |
|
3178 { |
|
3179 iTCSession.Close(); |
|
3180 iConnected = EFalse; |
|
3181 } |
|
3182 |
|
3183 TCertInfo ci; |
|
3184 |
|
3185 /*#ifdef __WINS__ |
|
3186 |
|
3187 // Use magic word to get through terminal control certificate checking... |
|
3188 // Only works in WINS... |
|
3189 ci.iFingerprint = _L8("WINS-TESTING-ADAPTER"); |
|
3190 |
|
3191 #else*/ |
|
3192 |
|
3193 RDMCert dmcert; |
|
3194 ret = dmcert.Get( ci ); |
|
3195 |
|
3196 //#endif |
|
3197 |
|
3198 if( KErrNone == ret ) |
|
3199 { |
|
3200 ret = iTCSession.Open(iTC, ci); |
|
3201 if( KErrNone == ret ) |
|
3202 { |
|
3203 iConnected = ETrue; |
|
3204 } |
|
3205 } |
|
3206 |
|
3207 return ret; |
|
3208 } |
|
3209 |
|
3210 // ------------------------------------------------------------------------- |
|
3211 // CTcAdapter::CheckTerminalControlSession |
|
3212 // -------------------------------------------------------------------------- |
|
3213 TInt CTcAdapter::CheckTerminalControlSession() |
|
3214 { |
|
3215 RDEBUG("CTcAdapter::CheckTerminalControlSession()"); |
|
3216 |
|
3217 TInt ret = KErrNone; |
|
3218 |
|
3219 if( ! iConnected ) |
|
3220 { |
|
3221 ret = NewTerminalControlSession(); |
|
3222 } |
|
3223 |
|
3224 return ret; |
|
3225 } |
|
3226 |
|
3227 // ------------------------------------------------------------------------ |
|
3228 // CTcAdapter::PolicyRequestResourceL |
|
3229 // ------------------------------------------------------------------------- |
|
3230 TPtrC8 CTcAdapter::PolicyRequestResourceL( const TDesC8& /*aURI*/ ) |
|
3231 { |
|
3232 RDEBUG("CTcAdapter::PolicyRequestResourceL()"); |
|
3233 |
|
3234 return PolicyEngineXACML::KTerminalSecurityManagement(); |
|
3235 } |
|
3236 |
|
3237 // -------------------------------------------------------------------------- |
|
3238 // CTcAdapter::ParseStartPathL |
|
3239 // ---------------------------------------------------------------------------- |
|
3240 void CTcAdapter::ParseStartPathL( const TDesC8 &aArguments, TDes8 &aStartPath, |
|
3241 TBool &aRecursive) |
|
3242 { |
|
3243 RDEBUG("CTcAdapter::ParseStartPathL()"); |
|
3244 |
|
3245 // |
|
3246 // Check for '-r' at the end of arguments |
|
3247 // |
|
3248 TPtrC8 right( aArguments.Right(2) ); |
|
3249 if( right == _L8("-r") ) |
|
3250 { |
|
3251 if(aArguments.Length()-2 <= aStartPath.MaxSize()) |
|
3252 { |
|
3253 aStartPath.Copy(aArguments.Left(aArguments.Length()-2)); |
|
3254 } |
|
3255 else |
|
3256 { |
|
3257 aStartPath.Copy(aArguments.Left(aStartPath.MaxSize())); |
|
3258 } |
|
3259 aRecursive = ETrue; |
|
3260 return; |
|
3261 } |
|
3262 |
|
3263 // |
|
3264 // -r not found, argument is startpath |
|
3265 // |
|
3266 if(aArguments.Length() <= aStartPath.MaxSize()) |
|
3267 { |
|
3268 aStartPath.Copy(aArguments); |
|
3269 } |
|
3270 else |
|
3271 { |
|
3272 aStartPath.Copy(aArguments.Left(aStartPath.MaxSize())); |
|
3273 } |
|
3274 aRecursive = EFalse; |
|
3275 |
|
3276 } |
|
3277 |
|
3278 |
|
3279 |