internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp
branchGCC_SURGE
changeset 13 c9471d26c7f2
parent 11 f683e24efca3
--- a/internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp	Mon Jun 21 22:33:45 2010 +0100
+++ b/internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp	Thu Jul 22 16:31:41 2010 +0100
@@ -23,7 +23,6 @@
 #include <featdiscovery.h>
 #include <features.hrh>
 #include <ProfileEngineSDKCRKeys.h>
-#include <WebUtilsInternalCRKeys.h>
 #include <httpstringconstants.h>
 #include <StringLoader.h>
 #include <data_caging_path_literals.hrh>
@@ -37,19 +36,39 @@
 
 #include "iractivenetworkobserver.h"
 
-//for ALR/SNAP
-#include <cmmanager.h>
-#include <cmdestination.h>
-
 
 const TInt KMaxIRUAProfLength = 250; // Max length of the UAProf string
 const TInt KIRDefaultUAProfBufferSize = 0x80;
 const TUint KIRESockMessageSlots = 16;
-const TUint32 KIRUniqueWlanId = 0x2000883F; // Just to make it unique
 const TInt KArraySize = 5;
 const TInt KWlanStringMaxLength = 9;
 const TInt KTwo = 2;
 
+// ---------------------------------------------------------------------------
+//  define in WebUtilsSDKCRKeys.h
+// ---------------------------------------------------------------------------
+//
+const TUid KCRUidWebUtils = {0x101F8731};//Web APIs removal and Internet Radio build break
+
+// ---------------------------------------------------------------------------
+// define in WebUtilsInternalCRKeys.h
+// ---------------------------------------------------------------------------
+//
+// Compatability fragment of useragent string
+const TUint32 KWebUtilsUsrAg2 =	0x00000001;
+
+// PlatformVersion fragment of useragent string
+const TUint32 KWebUtilsUsrAg3 =	0x00000002;
+
+// MidPVersion fragment of useragent string
+const TUint32 KWebUtilsUsrAg4 =	0x00000003;
+
+// CLDConfiguration fragment of useragent string
+const TUint32 KWebUtilsUsrAg5 =	0x00000004;
+
+// Url to useragent profile
+const TUint32 KWebUtilsUaProf =	0x00000008;
+
 
 // To Format the UAProf string
 _LIT(KIRUAProfSpace," ");
@@ -77,6 +96,13 @@
         CleanupStack::Pop(networkController);
 	}
     networkController->iSingletonInstances++;
+    
+    if (NULL != aObserver)
+    {
+        networkController->iObserver = aObserver;
+        networkController->iIRNetworkObserver->SetObserver(aObserver);
+    }
+    
     IRLOG_DEBUG( "CIRNetworkController::OpenL - Exiting." );
     return networkController;
 }
@@ -237,49 +263,6 @@
 }
 
 // ---------------------------------------------------------------------------
-// CIRNetworkController::GetAccessPointList
-// Reset the connection status to Disconnected statet
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const CDesCArray* CIRNetworkController::GetAccessPointList() const
-{
-    IRLOG_DEBUG( "CIRNetworkController::GetAccessPointList" );
-    return iIapList;
-}
-
-// ---------------------------------------------------------------------------
-// CIRNetworkController::GetBearerList
-// Reset the connection status to Disconnected statet
-//
-EXPORT_C const RArray<TUint32> CIRNetworkController::GetBearerList() const
-{
-    IRLOG_DEBUG( "CIRNetworkController::GetBearerList" );
-    return iBearerList;
-}
-
-// ---------------------------------------------------------------------------
-// CIRNetworkController::GetNetworkList
-// Reset the connection status to Disconnected statet
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const RArray<TUint32> CIRNetworkController::GetNetworkList() const
-{
-    IRLOG_DEBUG( "CIRNetworkController::GetNetworkList" );
-    return iNetworkList;
-}
-
-// ---------------------------------------------------------------------------
-// CIRNetworkController::GetApList
-// Reset the connection status to Disconnected statet
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const RArray<TUint32> CIRNetworkController::GetApList() const
-{
-    IRLOG_DEBUG( "CIRNetworkController::GetApList" );
-    return iIapIdList;
-}
-
-// ---------------------------------------------------------------------------
 //  CIRNetworkController::ChooseAccessPointL
 //  Configures the Access Point which is used by all the components for network
 //  connectivity
@@ -306,6 +289,13 @@
     // Always validate the Access Points status
     if ( ValidateAccessPointsL() )
     { 
+        if(NULL != iMobility)
+        {
+         iMobility->Cancel();
+         delete iMobility;
+         iMobility = NULL;
+        }
+
         // Connect to the Symbian Socket Server
         iIRNetworkConnection->Close();
         iIRSocketServer.Close();
@@ -507,7 +497,13 @@
     _LIT(KErrorMsg,"Method Close not called");
     __ASSERT_ALWAYS(iSingletonInstances == 0, User::Panic(KErrorMsg, KErrCorrupt));
 
-    delete iMobility;
+    if(NULL != iMobility)
+    {
+     iMobility->Cancel();
+     delete iMobility;
+     iMobility = NULL;
+    }
+
     if (IsActive())
     {
         Cancel();
@@ -528,9 +524,7 @@
     }
     delete iIRNetworkObserver;
     iIRSocketServer.Close();
-    iBearerList.Close();
-    iNetworkList.Close();
-    iIapIdList.Close();
+
     if (iIapList)
     {
         iIapList->Reset();
@@ -598,9 +592,6 @@
 
     // Reset all the comms info
     iIapList->Reset();
-    iBearerList.Reset();
-    iNetworkList.Reset();
-    iIapIdList.Reset();
     
 #ifndef __WINS__
     CIRFilteredApReader* filteredReader = CIRFilteredApReader::
@@ -615,9 +606,6 @@
         CleanupStack::PushL( iapRecord );
 
         iIapList->AppendL( iapRecord->iRecordName.GetL() );
-        iBearerList.AppendL( static_cast<TUint32>(iapRecord->iBearer) );
-        iNetworkList.AppendL( static_cast<TUint32>(iapRecord->iNetwork) );
-        iIapIdList.AppendL( iapRecord->RecordId() );
 
         CleanupStack::PopAndDestroy( iapRecord );
         iapRecord = filteredReader->NextRecordL();
@@ -638,9 +626,6 @@
         CCDIAPRecord* iapRecord =
                 static_cast<CCDIAPRecord*> (iapSet->iRecords[i]);
         iIapList->AppendL(iapRecord->iRecordName.GetL());
-        iBearerList.AppendL(static_cast<TUint32> (iapRecord->iBearer));
-        iNetworkList.AppendL(static_cast<TUint32> (iapRecord->iNetwork));
-        iIapIdList.AppendL(iapRecord->RecordId());
     }
     CleanupStack::PopAndDestroy(2, dbSession);
 
@@ -655,10 +640,6 @@
         TBuf<KWlanStringMaxLength> wlanString;
         wlanString.Copy(KIRWLanName);
         iIapList->AppendL(wlanString);
-        TUint32 WlanIdentifier(KIRUniqueWlanId);
-        iBearerList.AppendL(WlanIdentifier);
-        iNetworkList.AppendL((TUint32)KErrNotFound);
-        iIapIdList.AppendL((TUint32)KErrNotFound);
     }
 #endif
 
@@ -847,6 +828,14 @@
 void CIRNetworkController::DoCancel()
 {
     IRLOG_DEBUG( "CIRNetworkController::DoCancel - Entering" );
+
+    if(NULL != iMobility)
+    {
+     iMobility->Cancel();
+     delete iMobility;
+     iMobility = NULL;
+    }
+
     iIRNetworkConnection->Stop();
     iIRNetworkConnection->Close();
     iIRSocketServer.Close();