remotelock/RemoteLockEngine/Src/RemoteLock.cpp
branchRCL_3
changeset 22 03674e5abf46
parent 21 09b1ac925e3f
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
    31 #include <driveinfo.h>
    31 #include <driveinfo.h>
    32 #else
    32 #else
    33 #include <pathinfo.h> 
    33 #include <pathinfo.h> 
    34 #endif //RD_MULTIPLE_DRIVE 
    34 #endif //RD_MULTIPLE_DRIVE 
    35 #include <coreapplicationuisdomainpskeys.h>
    35 #include <coreapplicationuisdomainpskeys.h>
    36 #include <CoreApplicationUIsSDKCRKeys.h>
       
    37 #include <charconv.h>
    36 #include <charconv.h>
    38 #include <ProfileEngineSDKCRKeys.h>
    37 #include <ProfileEngineSDKCRKeys.h>
    39 #include <Profile.hrh>
    38 #include <Profile.hrh>
    40 #include <stringresourcereader.h> //CStringResourceReader
    39 #include <stringresourcereader.h> //CStringResourceReader
    41 #include "RemoteLockTrace.h"
    40 #include "RemoteLockTrace.h"
   624             }
   623             }
   625 
   624 
   626        if ( !iProfileSession )
   625        if ( !iProfileSession )
   627            {
   626            {
   628            RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
   627            RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
   629            iProfileSession = CRepository::NewL( KCRUidCoreApplicationUIs );	// previously it was	KCRUidProfileEngine
   628            iProfileSession = CRepository::NewL( KCRUidProfileEngine ); 
   630            }
   629            }
   631        if ( !iObserver )
   630        if ( !iObserver )
   632            {
   631            {
   633            iObserver =  CRLLockObserver::NewL( this );      
   632            iObserver =  CRLLockObserver::NewL( this );      
   634            } 
   633            } 
   654         if ( iSubscribeProfile )
   653         if ( iSubscribeProfile )
   655             {
   654             {
   656             if ( !iProfileSession )
   655             if ( !iProfileSession )
   657                 {
   656                 {
   658                 RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
   657                 RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
   659                 iProfileSession = CRepository::NewL( KCRUidCoreApplicationUIs );	// previously it was	KCRUidProfileEngine
   658                 iProfileSession = CRepository::NewL( KCRUidProfileEngine ); 
   660                 }
   659                 }
   661             ProfileNotifyL( EFalse );
   660             ProfileNotifyL( EFalse );
   662             delete iProfileSession;
   661             delete iProfileSession;
   663             iProfileSession = NULL;
   662             iProfileSession = NULL;
   664             delete iObserver;
   663             delete iObserver;
  1457         }
  1456         }
  1458     
  1457     
  1459     if ( aNotifyEnable )
  1458     if ( aNotifyEnable )
  1460         {
  1459         {
  1461         
  1460         
  1462         TInt err = iProfileSession->Get( KCoreAppUIsNetworkConnectionAllowed , iCurrentProfile );	// previously was KProEngActiveProfile
  1461         TInt err = iProfileSession->Get( KProEngActiveProfile, iCurrentProfile );
  1463         RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() err = %d", err );
       
  1464     		RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() iCurrentProfile = %d", iCurrentProfile );
       
  1465 
       
  1466         User::LeaveIfError( err );
  1462         User::LeaveIfError( err );
  1467         RL_TRACE_PRINT(" [ rl.exe ] ProfileNotifyL() startlisten");
  1463         RL_TRACE_PRINT(" [ rl.exe ] ProfileNotifyL() startlisten");
  1468         iProfileNotifyHandler->StartListeningL();  
  1464         iProfileNotifyHandler->StartListeningL();  
  1469         }
  1465         }
  1470     else
  1466     else
  1488 //
  1484 //
  1489 TBool CRemoteLock::GetProfile( TInt& aProfile )
  1485 TBool CRemoteLock::GetProfile( TInt& aProfile )
  1490     {
  1486     {
  1491     RL_TRACE_PRINT(" [ rl.exe ] GetProfile() ");
  1487     RL_TRACE_PRINT(" [ rl.exe ] GetProfile() ");
  1492     TInt err;
  1488     TInt err;
  1493     err = iProfileSession->Get( KCoreAppUIsNetworkConnectionAllowed , aProfile );	// previously was KProEngActiveProfile
  1489     err = iProfileSession->Get( KProEngActiveProfile, aProfile );
  1494 		RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() err = %d", err );
       
  1495 
       
  1496     RL_TRACE_PRINT(" [ rl.exe ] exit GetProfile() ");
  1490     RL_TRACE_PRINT(" [ rl.exe ] exit GetProfile() ");
  1497     return ( err == KErrNone );
  1491     return ( err == KErrNone );
  1498     }    
  1492     }    
  1499 
  1493 
  1500 
  1494 
  1509     {
  1503     {
  1510     RL_TRACE_PRINT(" [ rl.exe ] HandleNotifyGeneric() "); 
  1504     RL_TRACE_PRINT(" [ rl.exe ] HandleNotifyGeneric() "); 
  1511     
  1505     
  1512     TInt profile = 0; 
  1506     TInt profile = 0; 
  1513     GetProfile( profile ); 
  1507     GetProfile( profile ); 
  1514     RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() profile = %d", profile );
  1508     
  1515     RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() iCurrentProfile = %d", iCurrentProfile );
  1509     if ( ( profile == EProfileOffLineId ) && ( iIsEnabled  ) && ( iCurrentProfile != EProfileOffLineId )) 
  1516     if ( ( profile == ECoreAppUIsNetworkConnectionNotAllowed ) && ( iIsEnabled  ) && ( iCurrentProfile != ECoreAppUIsNetworkConnectionNotAllowed )) 
       
  1517         {
  1510         {
  1518         ActivateDeviceLock();  
  1511         ActivateDeviceLock();  
  1519         }
  1512         }
  1520         
  1513         
  1521     iCurrentProfile = profile;
  1514     iCurrentProfile = profile;