sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp
branchRCL_3
changeset 15 b2f9f823b5fb
parent 12 4a5c47a50617
equal deleted inserted replaced
12:4a5c47a50617 15:b2f9f823b5fb
    24 */
    24 */
    25 
    25 
    26 #include "ssmsecuritychecknotifier.h"
    26 #include "ssmsecuritychecknotifier.h"
    27 #include "ssmdebug.h"
    27 #include "ssmdebug.h"
    28 #include "ssmuiproviderdll.h"
    28 #include "ssmuiproviderdll.h"
       
    29 #include "ssmrefcustomcmdcommon.h"
    29 #include <ssm/ssmstateawaresession.h>
    30 #include <ssm/ssmstateawaresession.h>
    30 #include <e32def.h>
    31 #include <e32def.h>
    31 #include <startupdomaindefs.h>
    32 #include <startupdomaindefs.h>
    32 #include <etelmm.h>
    33 #include <etelmm.h>
    33 #include <ctsydomainpskeys.h>
    34 #include <ctsydomainpskeys.h>
   198 	User::LeaveIfError(ssmStateAwareSession.Connect(dmId));
   199 	User::LeaveIfError(ssmStateAwareSession.Connect(dmId));
   199 
   200 
   200 	//Get the current state of the system
   201 	//Get the current state of the system
   201 	TSsmState currentState = ssmStateAwareSession.State();
   202 	TSsmState currentState = ssmStateAwareSession.State();
   202 
   203 
       
   204 	//Close the state aware session
       
   205 	ssmStateAwareSession.Close();
       
   206 
   203 	TBool isDlgCancellable;
   207 	TBool isDlgCancellable;
   204 
   208 
   205 	//Is system in start up state
   209 	//Is system in start up state
   206 	if ( currentState.MainState() == ESsmStartup )
   210 	if ( currentState.MainState() == ESsmStartup )
   207 		{
   211 		{
       
   212 		TInt securityPhaseVal = EStarterSecurityPhaseUninitialized;
       
   213 		TInt errorCode = RProperty::Get(CSsmUiSpecific::StarterPSUid(), KStarterSecurityPhase, securityPhaseVal);
       
   214 		DEBUGPRINT3A("Getting the KStarterSecurityPhase completed with errorcode %d and its value is %d", errorCode, securityPhaseVal);
       
   215 		User::LeaveIfError(errorCode);
       
   216 
   208 		//TSsmStartupSubStateExt::ESsmStateNonCritical
   217 		//TSsmStartupSubStateExt::ESsmStateNonCritical
   209 		iAfterStartup = ( 0x34 == currentState.SubState() ) ? ETrue : EFalse;
   218 		iAfterStartup = ( 0x34 == currentState.SubState() && securityPhaseVal > EStarterSecurityPhaseSimNok ) ? ETrue : EFalse;
   210 		}
   219 		}
   211 	else
   220 	else
   212 		{
   221 		{
   213 		iAfterStartup = ETrue;
   222 		iAfterStartup = ETrue;
   214 		}
   223 		}
   215 	
   224 	DEBUGPRINT2A("iAfterStartup is %d", iAfterStartup);
   216 	//Close the state aware session
       
   217 	ssmStateAwareSession.Close();
       
   218 
   225 
   219 	//Notifier dialogue is not cancellable if system is in startup state and
   226 	//Notifier dialogue is not cancellable if system is in startup state and
   220 	//requested for PUK1 or PUK2 or UPUK code
   227 	//requested for PUK1 or PUK2 or UPUK code
   221     isDlgCancellable = (iAfterStartup &&
   228     isDlgCancellable = (iAfterStartup &&
   222 						iNoteType != ESecCodePUK1 &&
   229 						iNoteType != ESecCodePUK1 &&