22 #include <eikenv.h> |
22 #include <eikenv.h> |
23 #include <bautils.h> |
23 #include <bautils.h> |
24 #include <collate.h> |
24 #include <collate.h> |
25 #include <StringLoader.h> |
25 #include <StringLoader.h> |
26 #include <avkon.rsg> |
26 #include <avkon.rsg> |
27 |
27 #include <DevManInternalCRKeys.h> |
|
28 #include <centralrepository.h> |
28 #include <SettingEnforcementInfo.h> // VSettingEnforcementInfo |
29 #include <SettingEnforcementInfo.h> // VSettingEnforcementInfo |
|
30 #include <ecom/ecom.h> |
29 |
31 |
30 #include "NSmlDMdef.h" |
32 #include "NSmlDMdef.h" |
31 #include "NSmlDMSyncUtil.h" |
33 #include "NSmlDMSyncUtil.h" |
32 #include "NSmlDMSyncDebug.h" |
34 #include "NSmlDMSyncDebug.h" |
33 #include <featmgr.h> |
35 #include <featmgr.h> |
319 TRAP_IGNORE(ret = SettingEnforcementStateL()); |
321 TRAP_IGNORE(ret = SettingEnforcementStateL()); |
320 |
322 |
321 return ret; |
323 return ret; |
322 } |
324 } |
323 |
325 |
324 |
326 // --------------------------------------------------------- |
|
327 // TUtil::iDMNotifier |
|
328 // --------------------------------------------------------- |
|
329 CDMNativeNotifier* TUtil::iDMNotifier=NULL; |
|
330 |
|
331 // --------------------------------------------------------- |
|
332 // TUtil::ShowDialogBox |
|
333 // |
|
334 // Shows the requested dialog |
|
335 // --------------------------------------------------------- |
|
336 TInt TUtil::ShowNativeDialogL(TInt aOperation) |
|
337 { |
|
338 CRepository* centrep = NULL; |
|
339 TInt disclaimerAccepted(0); |
|
340 RImplInfoPtrArray dmImplArray; |
|
341 CleanupClosePushL(dmImplArray); |
|
342 |
|
343 CDMNativeNotifier::ListImplementationsL(dmImplArray); |
|
344 |
|
345 TInt rval = -1; |
|
346 switch(aOperation) |
|
347 { |
|
348 case EPrivacyPolicy: |
|
349 { |
|
350 //Check for implementations and set cenrep if count = 0 |
|
351 if( dmImplArray.Count() == 0 ) //No implementations found |
|
352 { |
|
353 centrep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
|
354 if(centrep) |
|
355 { |
|
356 centrep->Get( KDMDisclaimerAccepted , disclaimerAccepted ); |
|
357 if(disclaimerAccepted != EDMDialogNotAccepted) |
|
358 { |
|
359 disclaimerAccepted=1; |
|
360 centrep->Set( KDMDisclaimerAccepted , disclaimerAccepted ); //for Disclaimer |
|
361 } |
|
362 CleanupStack::PopAndDestroy(centrep); |
|
363 dmImplArray.ResetAndDestroy(); |
|
364 CleanupStack :: PopAndDestroy(&dmImplArray); |
|
365 return KErrNone ; |
|
366 } |
|
367 } |
|
368 TUid id( dmImplArray[0]->ImplementationUid()); |
|
369 dmImplArray.ResetAndDestroy(); |
|
370 CleanupStack :: PopAndDestroy(&dmImplArray); |
|
371 |
|
372 centrep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
|
373 if (centrep ) |
|
374 { |
|
375 centrep->Get( KDMDisclaimerAccepted , disclaimerAccepted ); //for Disclaimer |
|
376 CleanupStack::PopAndDestroy(centrep); |
|
377 } |
|
378 if(disclaimerAccepted==EDMDialogAccepted) |
|
379 { |
|
380 return KErrNone; |
|
381 } |
|
382 else |
|
383 { |
|
384 if(iDMNotifier == NULL) |
|
385 { |
|
386 iDMNotifier = CDMNativeNotifier::NewL(id); |
|
387 } |
|
388 if(disclaimerAccepted==EDMDialogActive) |
|
389 { |
|
390 rval = iDMNotifier->ShowDialogL(EPrivacyPolicy); |
|
391 } |
|
392 else if(disclaimerAccepted==EDMDialogNotAccepted) |
|
393 { |
|
394 rval = iDMNotifier->ShowDialogL(EPrivacyPolicy); |
|
395 delete iDMNotifier; |
|
396 iDMNotifier=NULL; |
|
397 REComSession::FinalClose(); |
|
398 } |
|
399 } |
|
400 break; |
|
401 } |
|
402 } |
|
403 |
|
404 return rval; |
|
405 } |
325 /***************************************************************************** |
406 /***************************************************************************** |
326 * class TURIParser |
407 * class TURIParser |
327 *****************************************************************************/ |
408 *****************************************************************************/ |
328 |
409 |
329 // ---------------------------------------------------------------------------- |
410 // ---------------------------------------------------------------------------- |