alwayson_net_plugin/pdpcontextmanager2/src/caosettings.cpp
changeset 3 f7816ffc66ed
parent 0 5a93021fdf25
child 4 77415202bfc8
--- a/alwayson_net_plugin/pdpcontextmanager2/src/caosettings.cpp	Mon Jan 18 20:33:49 2010 +0200
+++ b/alwayson_net_plugin/pdpcontextmanager2/src/caosettings.cpp	Tue Jan 26 12:12:48 2010 +0200
@@ -18,6 +18,9 @@
 
 // INCLUDE FILES
 #include <centralrepository.h>
+#include <cmmanagerkeys.h>
+#include <cmgenconnsettings.h>
+
 
 #include "caosettings.h"
 #include "logger.h"
@@ -568,4 +571,31 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// CAOSettings::IsCellularAllowedByUser
+// ---------------------------------------------------------------------------
+//
+TBool CAOSettings::IsCellularAllowedByUser() const
+    {
+    TBool allowed( ETrue );
+    CRepository* repository = NULL;
+    
+    TRAP_IGNORE( repository = CRepository::NewL( KCRUidCmManager ) )
+
+    if ( repository )
+        {
+        TInt value( 0 );
+        TInt err = repository->Get( KCurrentCellularDataUsage, value );
+
+        if ( err == KErrNone && value == ECmCellularDataUsageDisabled )
+            {
+            // Cellular connection is not allowed by user
+            allowed = EFalse;
+            }    
+        }
+
+    delete repository;
+    return allowed;
+    }
+
 // End of file