phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp
branchRCL_3
changeset 14 24062c24fe38
parent 0 5f000ab63145
child 58 40a3f856b14d
--- a/phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp	Fri Feb 19 22:50:26 2010 +0200
+++ b/phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp	Fri Mar 12 15:42:40 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -40,8 +40,13 @@
 #include "cphoneemergency.h"
 #include "cphoneconferenceandwaitingandcallsetup.h"
 #include "cphoneidle.h"
+#include "cphonestartup.h"
 #include "cphoneincoming.h"
-#include "cphonestartup.h"
+#include "cphonestartupsimlockui.h"
+#include "cphonepubsubproxy.h"
+#include <startupdomainpskeys.h>
+#include "phoneconstants.h"
+#include <featmgr.h>
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -262,9 +267,20 @@
                 break;
 
             case EPhoneStateStartup:
-                TRAP( err, iState = 
-          			CPhoneStartup::NewL( this, iViewCommandHandle, 
-          			iOldStateId == EPhoneStateEmergency ) );
+            	
+                if( IsSimlockStartupStateCreated() )
+                    {
+                    TRAP( err, iState =
+                        CPhoneStartupSimlockUi::NewL( this, iViewCommandHandle,
+                            iOldStateId == EPhoneStateEmergency ) );
+                    }
+                else
+                    {
+                    TRAP( err, iState =
+                        CPhoneStartup::NewL( this, iViewCommandHandle,
+                            iOldStateId == EPhoneStateEmergency ) );
+                    }
+
                 __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
                 madeStateTransition = ETrue;
                 break;
@@ -284,6 +300,28 @@
     return iState;
     }
 
+
+// -----------------------------------------------------------
+// CPhoneStateMachineGSM::IsSimlockStartupStateCreated
+// -----------------------------------------------------------
+//
+TBool CPhoneStateMachineGSM::IsSimlockStartupStateCreated() const
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdFfSimlockUi ) )
+        {
+        TInt securityStatus =
+                CPhonePubSubProxy::Instance()->Value(
+                        KPSUidStartup, KStartupSimSecurityStatus );
+        if ( securityStatus == ESimUnaccepted )
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+
 // -----------------------------------------------------------
 // CPhoneStateMachineGSM::NewL()
 // Constructor