browserutilities/feedsengine/FeedsServer/UrlHandler/src/ServerHttpConnection.cpp
branchRCL_3
changeset 64 ac77f89b1d9e
parent 62 c711bdda59f4
child 93 79859ed3eea9
--- a/browserutilities/feedsengine/FeedsServer/UrlHandler/src/ServerHttpConnection.cpp	Wed Mar 31 23:16:40 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/UrlHandler/src/ServerHttpConnection.cpp	Wed Apr 14 17:06:56 2010 +0300
@@ -22,7 +22,11 @@
 
 #include "ServerHttpConnection.h"
 #include "Logger.h"
-
+#ifdef BRDO_OCC_ENABLED_FF
+#include <FeatMgr.h>
+#include <CentralRepository.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#endif
 
 // -----------------------------------------------------------------------------
 // CServerHttpConnection::NewL
@@ -103,6 +107,11 @@
         TUint32 snapId = 0; //Defaults connects to Internet snap
         iConMgr->SetConnectionType(CMManager::EDestination);
         iConMgr->SetRequestedSnap(snapId);
+       if ( !IsPhoneOfflineL() )
+           {
+           // For only feeds, this silent is required
+           iConMgr->SetOccPreferences(ESilient);
+           }
 #else
         // Set the default access point.
         iConMgr->SetRequestedAP( iDefaultAccessPoint );
@@ -191,3 +200,34 @@
     {
     iDefaultAccessPoint = aAccessPoint;
     }
+
+#ifdef BRDO_OCC_ENABLED_FF
+// ---------------------------------------------------------
+// CServerHttpConnection::IsPhoneOfflineL
+//
+// Checks if phone is in offline mode or not.
+// Return ETrue if phone is in offline mode.
+// Return EFalse if phone is not in offline mode.
+// ---------------------------------------------------------
+//
+TBool CServerHttpConnection::IsPhoneOfflineL() 
+     {
+     FeatureManager::InitializeLibL();
+     TBool onLineMode = FeatureManager::FeatureSupported( KFeatureIdOfflineMode );
+     FeatureManager::UnInitializeLib();
+     if ( onLineMode )
+         {
+         CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs );
+         TInt connAllowed = 1;
+         repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
+         CleanupStack::PopAndDestroy(); //repository  
+         if ( !connAllowed )
+             {
+             //Yes, Phone is in Offline mode
+             return ETrue;
+             }
+         }
+     //Phone is in Online mode
+     return EFalse;
+     }
+#endif