sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp
changeset 16 ef634fd8dac3
parent 12 e978f818f9bd
child 35 f7565e9c9ce8
equal deleted inserted replaced
13:cef4ff1e6c4f 16:ef634fd8dac3
    27 #include "ssmdebug.h"
    27 #include "ssmdebug.h"
    28 #include "ssmuiproviderdll.h"
    28 #include "ssmuiproviderdll.h"
    29 #include <ssm/ssmstateawaresession.h>
    29 #include <ssm/ssmstateawaresession.h>
    30 #include <e32def.h>
    30 #include <e32def.h>
    31 #include <startupdomaindefs.h>
    31 #include <startupdomaindefs.h>
    32 #include <etelmm.h> 
    32 #include <etelmm.h>
       
    33 #include <ctsydomainpskeys.h>
    33 
    34 
    34 static TBool NoteTypeToEvent(
    35 static TBool NoteTypeToEvent(
    35     TInt& aEventCode, const TStrtSecurityNoteType aNoteType )
    36     TInt& aEventCode, const TStrtSecurityNoteType aNoteType )
    36     {
    37     {
    37     TBool result( ETrue );
    38     TBool result( ETrue );
   200 	TSsmState currentState = ssmStateAwareSession.State();
   201 	TSsmState currentState = ssmStateAwareSession.State();
   201 
   202 
   202 	TBool isDlgCancellable;
   203 	TBool isDlgCancellable;
   203 
   204 
   204 	//Is system in start up state
   205 	//Is system in start up state
   205 	
   206 	if ( currentState.MainState() == ESsmStartup )
   206 	iAfterStartup = (currentState.MainState() == ESsmStartup) ? EFalse : ETrue;
   207 		{
       
   208 		//TSsmStartupSubStateExt::ESsmStateNonCritical
       
   209 		iAfterStartup = ( 0x34 == currentState.SubState() ) ? ETrue : EFalse;
       
   210 		}
       
   211 	else
       
   212 		{
       
   213 		iAfterStartup = ETrue;
       
   214 		}
   207 	
   215 	
   208 	//Close the state aware session
   216 	//Close the state aware session
   209 	ssmStateAwareSession.Close();
   217 	ssmStateAwareSession.Close();
   210 
   218 
   211 	//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
   233 		DEBUGPRINT1A("Pin cancelled and ECall Started");
   241 		DEBUGPRINT1A("Pin cancelled and ECall Started");
   234 		SetActive();
   242 		SetActive();
   235         }
   243         }
   236     else if (iCmdState == EEmergencyCallIsActive && iStatus.Int() != KErrCancel)
   244     else if (iCmdState == EEmergencyCallIsActive && iStatus.Int() != KErrCancel)
   237         {
   245         {
   238         // Emergency call activated from the security note dialog has
   246         TInt value = -1; 
   239         // finished. Show the note again.
   247 		const TInt errorcode = iSsmEmergencyCallProperty.Get( value );
   240         DEBUGPRINT1A("ECall Ended and restarting pin notifier");
   248 		DEBUGPRINT3A("iSsmEmergencyCallProperty.Get() has returned value %d and errorcode %d", value , errorcode);
   241         StartNotifier();
   249 		if (KErrNone == errorcode)
       
   250 			{
       
   251 			// Compare the property value with EPSCTsyCallStateNone. This indicates the call has finished.
       
   252 			if (EPSCTsyCallStateNone == value)
       
   253 				{
       
   254 				// Emergency call activated from the security note dialog has
       
   255 				// finished. Show the note again.
       
   256 				DEBUGPRINT1A("ECall Ended and restarting pin notifier");
       
   257 				StartNotifier();
       
   258 				}
       
   259 			else
       
   260 				{
       
   261 				//Subscribe to the property again if the property key value is not yet set to EPSCTsyCallStateNone.
       
   262 				iSsmEmergencyCallProperty.Subscribe(iStatus);
       
   263 				SetActive();
       
   264 				}
       
   265 			}
   242         }
   266         }
   243     else
   267     else
   244         {
   268         {
   245         //Reset the state to initial start
   269         //Reset the state to initial start
   246         iCmdState = EIdle;
   270         iCmdState = EIdle;