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