cellular/telephonysettings/src/PsetNetwork.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
--- a/cellular/telephonysettings/src/PsetNetwork.cpp	Tue Aug 31 15:45:17 2010 +0300
+++ b/cellular/telephonysettings/src/PsetNetwork.cpp	Wed Sep 01 12:15:03 2010 +0100
@@ -18,18 +18,20 @@
 
 
 //  INCLUDE FILES
-#include "mpsetnetworkinfoobs.h" 
-#include "psetnetwork.h" 
-#include "psetsaobserver.h" 
-#include "psetpanic.h" 
-#include "psetconstants.h" 
-#include "mpsetnetworkselect.h" 
+#include "CNetworkResetHandler.h"
+#include "MPsetNetworkInfoObs.h"
+#include "MPsetNetworkSelect.h"
+#include "PsetNetwork.h"
+#include "PsetSAObserver.h"     
+#include "PSetPanic.h"          
+#include "PsetConstants.h"
+#include "PhoneSettingsLogger.h"
+
 #include <etelmm.h>
 #include <mmretrieve.h>
 #include <rmmcustomapi.h>
 
 #include <e32svr.h>
-#include "phonesettingslogger.h" 
 
 //  LOCAL CONSTANTS AND MACROS  
 _LIT( KPSNameOfClass, "CPsetNetwork" );
@@ -89,7 +91,9 @@
     delete iNetworkRetrieve;
     iNetworkRetrieve = NULL;
     delete iSAObserver;
-    iSAObserver = NULL;    
+    iSAObserver = NULL;
+    delete iResetNetworkSearch;
+    iResetNetworkSearch = NULL;    
     } 
 
 // ---------------------------------------------------------------------------
@@ -145,10 +149,6 @@
 //
 EXPORT_C TInt CPsetNetwork::GetNetworkSelectMode( TSelectMode& aMode )
     {
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
     RMobilePhone::TMobilePhoneNetworkSelectionV1 setMode;
     RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg setModePckg( setMode );
     
@@ -194,10 +194,6 @@
         }
     iTempNetInfo = aInfo;
 
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
     if ( aInfo.iMode == ENetSelectModeManual )
         {        
         //Copy data to member variables and make a request.
@@ -273,12 +269,12 @@
     // resulting in a possible dead lock when CActive::Cancel()'s User::WaitForRequest( iStatus ) never gets signaled.
     ClearParams();
     
-    if ( iActiveObserver == ENetSelectObserver && iObserver )
+    if ( iActiveObserver == ENetSelectObserver )
         {
         __ASSERT_ALWAYS( iObserver, Panic( KPSNameOfClass, ENetNoObserver ) );
         HideRequestNoteL();
         }
-    else if ( iActiveObserver == ENetModeObserver && iNetworkModeObserver )
+    else if ( iActiveObserver == ENetModeObserver )
         {        
         __ASSERT_ALWAYS( iNetworkModeObserver, 
                      Panic( KPSNameOfClass, ENetNoNetworkObserver  ) );
@@ -319,10 +315,7 @@
                 TInt amount = results->Enumerate();
                 __PHSLOGSTRING1("[PHS]   CPsetNetwork::RunL: amount: %d", amount);
                 TInt i = 0;
-                /*****************************************************
-                *    Series 60 Customer / ETel
-                *    Series 60  ETel API
-                *****************************************************/
+ 
                 RMobilePhone::TMobilePhoneNetworkInfoV2 nwNames;
                 while ( amount > i ) 
                     {
@@ -332,9 +325,6 @@
 
                     iTempNetInfo.iId.iNetworkCode.Copy( nwNames.iNetworkId );
                     __PHSLOGSTRING1("[PHS]   CPsetNetwork::RunL: NetworkCode: %S", &iTempNetInfo.iId.iNetworkCode);
-                    
-                    iTempNetInfo.iStatus = (MPsetNetworkSelect::TNetworkStatus)nwNames.iStatus;
-                    __PHSLOGSTRING1("[PHS]   CPsetNetwork::RunL: Status: %d", &iTempNetInfo.iStatus);
 
                     iTempNetInfo.iLongName.Copy( nwNames.iLongName );
                     __PHSLOGSTRING1("[PHS]   CPsetNetwork::RunL: LongName: %S", &iTempNetInfo.iLongName);
@@ -346,14 +336,16 @@
                         {
                         iTempNetInfo.iAccess = ENetNetworkWCDMA;
                         }
-                    else if ( nwNames.iAccess == RMobilePhone::ENetworkAccessGsmAndUtran )
-                        {
-                        iTempNetInfo.iAccess = ENetNetworkGSMandWCDMA;
-                        }
                     else
                         {
                         iTempNetInfo.iAccess = ENetNetworkGSM;
                         }
+
+                    /** Implementation of forbidden operator icon begins */
+                    // Set network status for displaying forbidden operator icon
+                    iTempNetInfo.iStatus = static_cast<MPsetNetworkSelect::TNetworkStatus>( nwNames.iStatus );
+                    /** Implementation of forbidden operator icon ends */
+                        
                     array->AppendL( iTempNetInfo );
                     i++;       
                     }
@@ -481,15 +473,13 @@
     {
     iObserver = &aObserver;
     iActiveObserver = ENetSelectObserver;
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
+
     iRegStatus = RMobilePhone::ERegistrationUnknown;
     User::LeaveIfError( iCustomPhone.Open( iPhone ) );
     
     iSAObserver = CPsetSAObserver::NewL();
     CActiveScheduler::Add( this );
+    iResetNetworkSearch = CNetworkResetHandler::NewL( iPhone );
     }
 
 // ---------------------------------------------------------------------------
@@ -502,13 +492,11 @@
     {
     iNetworkModeObserver = &aModeObserver;
     iActiveObserver = ENetModeObserver;
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
+
     User::LeaveIfError( iCustomPhone.Open( iPhone ) );
     
     CActiveScheduler::Add( this );
+    iResetNetworkSearch = CNetworkResetHandler::NewL( iPhone );
     }
 
 // ---------------------------------------------------------------------------
@@ -569,15 +557,11 @@
 EXPORT_C TInt CPsetNetwork::ResetNetworkSearch()
     {
     __PHSLOGSTRING("[PHS]--> CPsetNetwork::ResetNetworkSearch");
-    RMmCustomAPI customApi;
-    TInt error = customApi.Open( iPhone );
-    if  (error == KErrNone)
-        {
-        customApi.ResetNetServer();
-        }
-    customApi.Close();
-
-    __PHSLOGSTRING("[PHS] <--CPsetNetwork::ResetNetworkSearch");
+	
+    TInt error = iResetNetworkSearch->ResetNetworkSearch();
+	
+    __PHSLOGSTRING1("[PHS] <--CPsetNetwork::ResetNetworkSearch: error: %d", error);
+	
     //for compatibility reasons returns a value
     return error;
     }