phoneapp/phoneuicontrol/src/cphonestatestartup.cpp
branchRCL_3
changeset 15 2a26698d78ba
parent 14 24062c24fe38
child 17 38529f706030
--- a/phoneapp/phoneuicontrol/src/cphonestatestartup.cpp	Fri Mar 12 15:42:40 2010 +0200
+++ b/phoneapp/phoneuicontrol/src/cphonestatestartup.cpp	Mon Mar 15 12:40:24 2010 +0200
@@ -143,25 +143,7 @@
     // Only go to the idle state if phone is also ready
     if ( iPhoneReady )
         {
-        // Security mode check. 
-	    TPhoneCmdParamBoolean isSecurityMode;      
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );        
-        if ( !isSecurityMode.Boolean() && !IsSimOk() )
-            {
-            TPhoneCmdParamBoolean securityMode;
-            securityMode.SetBoolean( ETrue );
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
-            iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
-            
-            CreateAndShowNoteAfterIdle(); 
-            }
-        // Go to idle state
-        SetDefaultFlagsL();
-        iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
-        
-        iViewCommandHandle->ExecuteCommand( EPhoneViewPrepareIcons );
-        
-        iStateMachine->ChangeState( EPhoneStateIdle );
+        InitializationReadyL();
         }
     }
 
@@ -232,26 +214,7 @@
     // Only go to idle state when Phone engine is also ready
     if ( iPEReady )
         {
-        // Security mode check.
-	    TPhoneCmdParamBoolean isSecurityMode;      
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
-        if ( !isSecurityMode.Boolean() && !IsSimOk() )
-            {
-            TPhoneCmdParamBoolean securityMode;
-            securityMode.SetBoolean( ETrue );
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
-            iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
-            
-            CreateAndShowNoteAfterIdle(); 
-            }
-        // Go to idle state
-        SetDefaultFlagsL();
-        iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
-        
-        iViewCommandHandle->ExecuteCommand( EPhoneViewPrepareIcons );
-        iViewCommandHandle->ExecuteCommand( EPhoneViewLoadPlugins );
-        
-        iStateMachine->ChangeState( EPhoneStateIdle );
+        InitializationReadyL();
         }
     }
 
@@ -310,4 +273,36 @@
     return KErrNone;
     }
 
+// -----------------------------------------------------------------------------
+// CPhoneStateStartup::InitializationReadyL
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneStateStartup::InitializationReadyL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::InitializationReady() ");
+
+     // Security mode check.
+    TPhoneCmdParamBoolean isSecurityMode;      
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+    if ( !isSecurityMode.Boolean() && !IsSimOk() )
+        {
+        TPhoneCmdParamBoolean securityMode;
+        securityMode.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
+        iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
+        
+        CreateAndShowNoteAfterIdle(); 
+        }
+    // Go to idle state
+    SetDefaultFlagsL();
+    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+    
+    iViewCommandHandle->ExecuteCommand( EPhoneViewPrepareIcons );
+    iViewCommandHandle->ExecuteCommand( EPhoneViewLoadPlugins );
+    
+    iStateMachine->ChangeState( EPhoneStateIdle );   
+    }
+
+
 // End of File