phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp
branchRCL_3
changeset 4 24062c24fe38
parent 0 5f000ab63145
child 23 40a3f856b14d
equal deleted inserted replaced
3:8871b09be73b 4:24062c24fe38
     1 /*
     1 /*
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    38 #include "cphonetwosinglesandwaiting.h"
    38 #include "cphonetwosinglesandwaiting.h"
    39 #include "cphoneconferenceandsingleandwaiting.h"
    39 #include "cphoneconferenceandsingleandwaiting.h"
    40 #include "cphoneemergency.h"
    40 #include "cphoneemergency.h"
    41 #include "cphoneconferenceandwaitingandcallsetup.h"
    41 #include "cphoneconferenceandwaitingandcallsetup.h"
    42 #include "cphoneidle.h"
    42 #include "cphoneidle.h"
       
    43 #include "cphonestartup.h"
    43 #include "cphoneincoming.h"
    44 #include "cphoneincoming.h"
    44 #include "cphonestartup.h"
    45 #include "cphonestartupsimlockui.h"
       
    46 #include "cphonepubsubproxy.h"
       
    47 #include <startupdomainpskeys.h>
       
    48 #include "phoneconstants.h"
       
    49 #include <featmgr.h>
    45 
    50 
    46 // ================= MEMBER FUNCTIONS =======================
    51 // ================= MEMBER FUNCTIONS =======================
    47 
    52 
    48 // -----------------------------------------------------------------------------
    53 // -----------------------------------------------------------------------------
    49 // CPhoneStateMachineGSM::CPhoneStateMachineGSM
    54 // CPhoneStateMachineGSM::CPhoneStateMachineGSM
   260                 __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
   265                 __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
   261                 madeStateTransition = ETrue;
   266                 madeStateTransition = ETrue;
   262                 break;
   267                 break;
   263 
   268 
   264             case EPhoneStateStartup:
   269             case EPhoneStateStartup:
   265                 TRAP( err, iState = 
   270             	
   266           			CPhoneStartup::NewL( this, iViewCommandHandle, 
   271                 if( IsSimlockStartupStateCreated() )
   267           			iOldStateId == EPhoneStateEmergency ) );
   272                     {
       
   273                     TRAP( err, iState =
       
   274                         CPhoneStartupSimlockUi::NewL( this, iViewCommandHandle,
       
   275                             iOldStateId == EPhoneStateEmergency ) );
       
   276                     }
       
   277                 else
       
   278                     {
       
   279                     TRAP( err, iState =
       
   280                         CPhoneStartup::NewL( this, iViewCommandHandle,
       
   281                             iOldStateId == EPhoneStateEmergency ) );
       
   282                     }
       
   283 
   268                 __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
   284                 __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
   269                 madeStateTransition = ETrue;
   285                 madeStateTransition = ETrue;
   270                 break;
   286                 break;
   271 
   287 
   272             default:
   288             default:
   282         }
   298         }
   283 
   299 
   284     return iState;
   300     return iState;
   285     }
   301     }
   286 
   302 
       
   303 
       
   304 // -----------------------------------------------------------
       
   305 // CPhoneStateMachineGSM::IsSimlockStartupStateCreated
       
   306 // -----------------------------------------------------------
       
   307 //
       
   308 TBool CPhoneStateMachineGSM::IsSimlockStartupStateCreated() const
       
   309     {
       
   310     if ( FeatureManager::FeatureSupported( KFeatureIdFfSimlockUi ) )
       
   311         {
       
   312         TInt securityStatus =
       
   313                 CPhonePubSubProxy::Instance()->Value(
       
   314                         KPSUidStartup, KStartupSimSecurityStatus );
       
   315         if ( securityStatus == ESimUnaccepted )
       
   316             {
       
   317             return ETrue;
       
   318             }
       
   319         }
       
   320 
       
   321     return EFalse;
       
   322     }
       
   323 
       
   324 
   287 // -----------------------------------------------------------
   325 // -----------------------------------------------------------
   288 // CPhoneStateMachineGSM::NewL()
   326 // CPhoneStateMachineGSM::NewL()
   289 // Constructor
   327 // Constructor
   290 // (other items were commented in a header).
   328 // (other items were commented in a header).
   291 // -----------------------------------------------------------
   329 // -----------------------------------------------------------