sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp
branchRCL_3
changeset 12 4a5c47a50617
parent 9 21e939dd208a
child 15 b2f9f823b5fb
equal deleted inserted replaced
10:66ecddbca914 12:4a5c47a50617
    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"
       
    30 #include <ssm/ssmstateawaresession.h>
    29 #include <ssm/ssmstateawaresession.h>
    31 #include <e32def.h>
    30 #include <e32def.h>
    32 #include <startupdomaindefs.h>
    31 #include <startupdomaindefs.h>
    33 #include <etelmm.h>
    32 #include <etelmm.h>
    34 #include <ctsydomainpskeys.h>
    33 #include <ctsydomainpskeys.h>
   199 	User::LeaveIfError(ssmStateAwareSession.Connect(dmId));
   198 	User::LeaveIfError(ssmStateAwareSession.Connect(dmId));
   200 
   199 
   201 	//Get the current state of the system
   200 	//Get the current state of the system
   202 	TSsmState currentState = ssmStateAwareSession.State();
   201 	TSsmState currentState = ssmStateAwareSession.State();
   203 
   202 
       
   203 	TBool isDlgCancellable;
       
   204 
       
   205 	//Is system in start up state
       
   206 	if ( currentState.MainState() == ESsmStartup )
       
   207 		{
       
   208 		//TSsmStartupSubStateExt::ESsmStateNonCritical
       
   209 		iAfterStartup = ( 0x34 == currentState.SubState() ) ? ETrue : EFalse;
       
   210 		}
       
   211 	else
       
   212 		{
       
   213 		iAfterStartup = ETrue;
       
   214 		}
       
   215 	
   204 	//Close the state aware session
   216 	//Close the state aware session
   205 	ssmStateAwareSession.Close();
   217 	ssmStateAwareSession.Close();
   206 
       
   207 	TBool isDlgCancellable;
       
   208 
       
   209 	//Is system in start up state
       
   210 	if ( currentState.MainState() == ESsmStartup )
       
   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 
       
   217 		//TSsmStartupSubStateExt::ESsmStateNonCritical
       
   218 		iAfterStartup = ( 0x34 == currentState.SubState() && securityPhaseVal > EStarterSecurityPhaseSimNok ) ? ETrue : EFalse;
       
   219 		}
       
   220 	else
       
   221 		{
       
   222 		iAfterStartup = ETrue;
       
   223 		}
       
   224 	DEBUGPRINT2A("iAfterStartup is %d", iAfterStartup);
       
   225 
   218 
   226 	//Notifier dialogue is not cancellable if system is in startup state and
   219 	//Notifier dialogue is not cancellable if system is in startup state and
   227 	//requested for PUK1 or PUK2 or UPUK code
   220 	//requested for PUK1 or PUK2 or UPUK code
   228     isDlgCancellable = (iAfterStartup &&
   221     isDlgCancellable = (iAfterStartup &&
   229 						iNoteType != ESecCodePUK1 &&
   222 						iNoteType != ESecCodePUK1 &&