browserutilities/feedsengine/FeedsServer/UrlHandler/src/ServerHttpConnection.cpp
branchRCL_3
changeset 37 ac77f89b1d9e
parent 36 c711bdda59f4
child 48 79859ed3eea9
equal deleted inserted replaced
36:c711bdda59f4 37:ac77f89b1d9e
    20 #include <aputils.h> 
    20 #include <aputils.h> 
    21 #include <internetconnectionmanager.h>
    21 #include <internetconnectionmanager.h>
    22 
    22 
    23 #include "ServerHttpConnection.h"
    23 #include "ServerHttpConnection.h"
    24 #include "Logger.h"
    24 #include "Logger.h"
    25 
    25 #ifdef BRDO_OCC_ENABLED_FF
       
    26 #include <FeatMgr.h>
       
    27 #include <CentralRepository.h>
       
    28 #include <CoreApplicationUIsSDKCRKeys.h>
       
    29 #endif
    26 
    30 
    27 // -----------------------------------------------------------------------------
    31 // -----------------------------------------------------------------------------
    28 // CServerHttpConnection::NewL
    32 // CServerHttpConnection::NewL
    29 //
    33 //
    30 // Two-phased constructor.
    34 // Two-phased constructor.
   101         {
   105         {
   102 #ifdef BRDO_OCC_ENABLED_FF
   106 #ifdef BRDO_OCC_ENABLED_FF
   103         TUint32 snapId = 0; //Defaults connects to Internet snap
   107         TUint32 snapId = 0; //Defaults connects to Internet snap
   104         iConMgr->SetConnectionType(CMManager::EDestination);
   108         iConMgr->SetConnectionType(CMManager::EDestination);
   105         iConMgr->SetRequestedSnap(snapId);
   109         iConMgr->SetRequestedSnap(snapId);
       
   110        if ( !IsPhoneOfflineL() )
       
   111            {
       
   112            // For only feeds, this silent is required
       
   113            iConMgr->SetOccPreferences(ESilient);
       
   114            }
   106 #else
   115 #else
   107         // Set the default access point.
   116         // Set the default access point.
   108         iConMgr->SetRequestedAP( iDefaultAccessPoint );
   117         iConMgr->SetRequestedAP( iDefaultAccessPoint );
   109 #endif
   118 #endif
   110         // Open a connection.
   119         // Open a connection.
   189 //
   198 //
   190 void CServerHttpConnection::SetAccessPointL( TUint32 aAccessPoint )
   199 void CServerHttpConnection::SetAccessPointL( TUint32 aAccessPoint )
   191     {
   200     {
   192     iDefaultAccessPoint = aAccessPoint;
   201     iDefaultAccessPoint = aAccessPoint;
   193     }
   202     }
       
   203 
       
   204 #ifdef BRDO_OCC_ENABLED_FF
       
   205 // ---------------------------------------------------------
       
   206 // CServerHttpConnection::IsPhoneOfflineL
       
   207 //
       
   208 // Checks if phone is in offline mode or not.
       
   209 // Return ETrue if phone is in offline mode.
       
   210 // Return EFalse if phone is not in offline mode.
       
   211 // ---------------------------------------------------------
       
   212 //
       
   213 TBool CServerHttpConnection::IsPhoneOfflineL() 
       
   214      {
       
   215      FeatureManager::InitializeLibL();
       
   216      TBool onLineMode = FeatureManager::FeatureSupported( KFeatureIdOfflineMode );
       
   217      FeatureManager::UnInitializeLib();
       
   218      if ( onLineMode )
       
   219          {
       
   220          CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs );
       
   221          TInt connAllowed = 1;
       
   222          repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
       
   223          CleanupStack::PopAndDestroy(); //repository  
       
   224          if ( !connAllowed )
       
   225              {
       
   226              //Yes, Phone is in Offline mode
       
   227              return ETrue;
       
   228              }
       
   229          }
       
   230      //Phone is in Online mode
       
   231      return EFalse;
       
   232      }
       
   233 #endif