ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 10 f5907b1a1053
equal deleted inserted replaced
3:a4d6f1ea0416 4:e7aa27f58ae1
    20 //<cmail> internal dependency removed
    20 //<cmail> internal dependency removed
    21 /*#ifdef _DEBUG
    21 /*#ifdef _DEBUG
    22 #include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
    22 #include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
    23 #endif // _DEBUG*/
    23 #endif // _DEBUG*/
    24 //</cmail>
    24 //</cmail>
       
    25 
       
    26 #include <cmmanager.h>
    25 
    27 
    26 #include "emailtrace.h"
    28 #include "emailtrace.h"
    27 #include "IpsSosAOMboxLogic.h"
    29 #include "IpsSosAOMboxLogic.h"
    28 #include "ipssetdataapi.h"
    30 #include "ipssetdataapi.h"
    29 #include "IpsSosAOSchedulerUtils.h"
    31 #include "IpsSosAOSchedulerUtils.h"
   751 // ----------------------------------------------------------------------------
   753 // ----------------------------------------------------------------------------
   752 TBool CIpsSosAOMBoxLogic::CanConnectIfRoamingL()
   754 TBool CIpsSosAOMBoxLogic::CanConnectIfRoamingL()
   753     {
   755     {
   754     FUNC_LOG;
   756     FUNC_LOG;
   755     TBool ret = ETrue;
   757     TBool ret = ETrue;
   756     LoadSettingsL();
   758 
   757     if ( ( iExtendedSettings->EmailNotificationState() == EMailEmnHomeOnly 
   759     RCmManager cmManager;
   758           || iExtendedSettings->AlwaysOnlineState() == EMailAoHomeOnly
   760     cmManager.OpenLC();
   759           || iExtendedSettings->RoamHomeOnlyFlag() ) && iIsRoaming )
   761     TCmGenConnSettings OccSettings;
       
   762     
       
   763     //ask roaming settings from occ
       
   764     cmManager.ReadGenConnSettingsL(OccSettings);
       
   765     if(OccSettings.iSeamlessnessVisitor == ECmCellularDataUsageDisabled && iIsRoaming)
   760         {
   766         {
   761         ret = EFalse;
   767         ret = EFalse;
   762         }
   768         }
       
   769     
       
   770     CleanupStack::PopAndDestroy(&cmManager); // cmManager
       
   771     
   763     return ret;          
   772     return ret;          
   764     }
   773     }
   765 
   774 
   766 // ----------------------------------------------------------------------------
   775 // ----------------------------------------------------------------------------
   767 // ----------------------------------------------------------------------------
   776 // ----------------------------------------------------------------------------
   776     {
   785     {
   777     TRAP_IGNORE( LoadSettingsL() );
   786     TRAP_IGNORE( LoadSettingsL() );
   778     iExtendedSettings->SetFirstEmnReceived( ETrue );
   787     iExtendedSettings->SetFirstEmnReceived( ETrue );
   779     
   788     
   780     //if alwaysonline was allowed to roam, so will EMN be.
   789     //if alwaysonline was allowed to roam, so will EMN be.
   781     iExtendedSettings->SetEmailNotificationState(
   790     iExtendedSettings->SetEmailNotificationState( EMailEmnAutomatic );
   782             iExtendedSettings->AlwaysOnlineState() == 
       
   783             EMailAoAlways ? EMailEmnAutomatic : EMailEmnHomeOnly );
       
   784     
   791     
   785     
   792     
   786     // set always online state off when emn is on
   793     // set always online state off when emn is on
   787     iExtendedSettings->SetAlwaysOnlineState( EMailAoOff );    
   794     iExtendedSettings->SetAlwaysOnlineState( EMailAoOff );    
   788     iExtendedSettings->SetInboxRefreshTime( KErrNotFound );
   795     iExtendedSettings->SetInboxRefreshTime( KErrNotFound );