sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecuritynotecontroller.cpp
branchRCL_3
changeset 3 a811597961f0
parent 0 4e1aa6a622a0
child 5 1a73e8f1b64d
--- a/sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecuritynotecontroller.cpp	Tue Feb 02 00:53:00 2010 +0200
+++ b/sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecuritynotecontroller.cpp	Sat Feb 20 00:05:00 2010 +0200
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -14,7 +14,7 @@
 // Name        : strtsecuritynotecontroller.cpp
 // Part of     : System Startup / StrtSecObs
 // Implementation of CStrtSecurityNoteController class
-// Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
+// Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
 // This material, including documentation and any related computer
 // programs, is protected by copyright controlled by Nokia.  All
 // rights are reserved.  Copying, including reproducing, storing,
@@ -33,6 +33,9 @@
 #include "ssmsecuritynotecontroller.h"
 #include "ssmsecuritychecknotifier.h"
 #include "ssmdebug.h"
+#include "ssmpanic.h"
+#include <ssm/ssmstatemanager.h>
+#include <ssm/startupreason.h>
 
 CStrtSecurityNoteController* CStrtSecurityNoteController::NewL()
     {
@@ -89,6 +92,36 @@
         SetActive();
         }
     }
+#ifdef _DEBUG
+TInt CStrtSecurityNoteController::RunError(TInt aError)
+#else
+TInt CStrtSecurityNoteController::RunError(TInt)
+#endif // _DEBUG
+    {
+    DEBUGPRINT2A("CStrtSecurityNoteController RunL completed with error %d", aError);
+#ifdef _DEBUG
+	PanicNow(KPanicSecurityNoteController, aError);
+#else
+    RSsmStateManager session;
+    TInt errorCode = session.Connect();
+    if ( KErrNone == errorCode )
+        {
+        TSsmStateTransition stateinfo( ESsmShutdown, KSsmAnySubState, EUnknownReset );
+        errorCode = session.RequestStateTransition( stateinfo );
+        if( KErrNone != errorCode )
+            {
+            PanicNow(KPanicSecurityNoteController, errorCode);
+            }
+        session.Close();
+        }
+	else
+		{
+        PanicNow(KPanicSecurityNoteController, errorCode);	
+		}
+#endif //_DEBUG
+
+    return KErrNone;
+    }
 
 CStrtSecurityNoteController::CStrtSecurityNoteController()
   : CActive( EPriorityStandard ),