Revision: 201021
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 14:11:20 +0300
changeset 29 e5a0aab53f3f
parent 22 effbe8362efc
child 30 d11478a8d5cf
child 35 f7565e9c9ce8
Revision: 201021 Kit: 2010121
accessoryservices/accessoryserver/group/AccServer.mmp
accessoryservices/accessoryserver/group/bld.inf
accessoryservices/accessoryserver/inc/Server/AccSrvConnectionController.h
accessoryservices/accessoryserver/rom/AccServer.iby
accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp
accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp
psmservices/psmserver/src/server/psmsrvsession.cpp
sensorservices/orientationssy/inc/SsyConfiguration.h
sensorservices/orientationssy/src/SsyChannel.cpp
sensorservices/orientationssy/src/SsyProperty.cpp
sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss
sysstatemgmt/ssmcmdlists/data/noncriticalswpcmdlists.rss
sysstatemgmt/ssmcmdlists/data/shutdowncmdlists.rss
sysstatemgmt/ssmcmdlists/group/ssmcmdlists.mmp
sysstatemgmt/ssmcmdlists/rom/ssmcmdlists.iby
sysstatemgmt/ssmpolicyplugins/group/bld.inf
sysstatemgmt/ssmpolicyplugins/inc/ssmswp.hrh
sysstatemgmt/ssmpolicyplugins/rom/ssmpolicyplugins.iby
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/bwins/ssmnoncriticalswppolicyu.def
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/eabi/ssmnoncriticalswppolicyu.def
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/group/bld.inf
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/group/ssmnoncriticalswppolicy.mmp
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/inc/ssmnoncriticalswppolicy.h
sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/src/ssmnoncriticalswppolicy.cpp
sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil.cpp
sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil.h
sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil_DllMain.cpp
sysstatemgmt/tsrc/public/basic/bwins/mt_rstartersessionU.DEF
sysstatemgmt/tsrc/public/basic/eabi/mt_rstartersessionU.DEF
sysstatemgmt/tsrc/public/basic/group/bld.inf
sysstatemgmt/tsrc/public/basic/group/mt_rstartersession.mmp
sysstatemgmt/tsrc/public/basic/group/mt_rstartersession.pkg
sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.cpp
sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h
sysstatemgmt/tsrc/public/basic/rom/mt_rstartersession.iby
--- a/accessoryservices/accessoryserver/group/AccServer.mmp	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/accessoryserver/group/AccServer.mmp	Thu May 27 14:11:20 2010 +0300
@@ -59,7 +59,6 @@
 
 USERINCLUDE         ../inc/Common
 USERINCLUDE         ../inc/Server
-USERINCLUDE         ../inc/ChargerContext
 
 // System include macro Starter P&S keys
 OS_LAYER_SYSTEMINCLUDE
@@ -77,7 +76,6 @@
 LIBRARY	            hwrmlightclient.lib // Used by accessory settings.
 LIBRARY	            efsrv.lib	// Used by accessory settings 
 LIBRARY             accpolicydb.lib
-LIBRARY             accchargercontext.lib
 #ifdef RD_TSP_CLIENT_MAPPER
 LIBRARY             tspclientmapper.lib
 #endif // RD_TSP_CLIENT_MAPPER
--- a/accessoryservices/accessoryserver/group/bld.inf	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/accessoryserver/group/bld.inf	Thu May 27 14:11:20 2010 +0300
@@ -54,7 +54,6 @@
 AccAudioControl.mmp
 ASYComms.mmp
 ASYProxy.mmp
-AccChargerContext.mmp
 accpolaudiodevicetopology.mmp
 
 // End of File
--- a/accessoryservices/accessoryserver/inc/Server/AccSrvConnectionController.h	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/accessoryserver/inc/Server/AccSrvConnectionController.h	Thu May 27 14:11:20 2010 +0300
@@ -43,7 +43,6 @@
 class CAccSrvASYProxyHandler;
 class CAccSrvSettingsHandler;
 class CAccSrvWiredConnectionPublisher;
-class CAccSrvChargingContextController;
 
 // CLASS DECLARATION
 
@@ -387,7 +386,6 @@
         CAccSrvModeHandler*                     iModeHandler;            //Owned
         CAccSrvASYProxyHandler*                 iASYProxyHandler;        //Owned
         CAccSrvSettingsHandler*                 iSettingsHandler;        //Owned
-        CAccSrvChargingContextController*       iChargingContextController; //Owned
         RPointerArray<CAccSrvConnectionHandler> iConnectionHandler;      //Owned
 
 	    TUint32                                 iInformationNoteUID;	  
--- a/accessoryservices/accessoryserver/rom/AccServer.iby	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/accessoryserver/rom/AccServer.iby	Thu May 27 14:11:20 2010 +0300
@@ -32,7 +32,6 @@
 file=ABI_DIR\BUILD_DIR\AsyComms.dll                     SHARED_LIB_DIR\AsyComms.dll
 file=ABI_DIR\BUILD_DIR\AsyProxy.dll                     SHARED_LIB_DIR\AsyProxy.dll
 file=ABI_DIR\BUILD_DIR\accsrvutil.dll                   SHARED_LIB_DIR\accsrvutil.dll
-file=ABI_DIR\BUILD_DIR\AccChargerContext.dll            SHARED_LIB_DIR\AccChargerContext.dll
 file=ABI_DIR\BUILD_DIR\accpolaudiodevicetopology.dll	SHARED_LIB_DIR\accpolaudiodevicetopology.dll
 
 data=ZPRIVATE\100012A5\policy\10205030.spd              \private\100012A5\policy\10205030.spd
--- a/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Thu May 27 14:11:20 2010 +0300
@@ -30,7 +30,6 @@
 #include "AccPolGenericIDAccessor.h"
 #include "AccSrvSettingsHandler.h"
 #include "AccPolSubblockNameArrayAccessor.h"
-#include "AccSrvChargingContextController.h"
 #include <AccConfigFileParser.h>
 #include <s32mem.h>
 #include "AccSrvWiredConnectionPublisher.h"
@@ -101,12 +100,6 @@
     iASYProxyHandler         = CAccSrvASYProxyHandler::NewL( this );
     iSettingsHandler         = CAccSrvSettingsHandler::NewL( this, *aServerModel, iPolicy );
     iWiredConnPublisher      = CAccSrvWiredConnectionPublisher::NewL();
-    TRAPD( err, iChargingContextController = CAccSrvChargingContextController::NewL() );
-    if ( err != KErrNone ) // Server does not need to die on charging context fail.
-        {
-        COM_TRACE_1( "[AccFW:AccServer] CAccSrvConnectionController::ConstructL - CAccSrvChargingContextController err %d", err );
-        iChargingContextController = NULL;
-        }
 
     COM_TRACE_( "[AccFW:AccServer] CAccSrvConnectionController::ConstructL - return void" );
     }
@@ -167,11 +160,6 @@
         delete iSettingsHandler;
         }
     
-    if( NULL != iChargingContextController )
-        {
-        delete iChargingContextController;
-        }
-
     delete iWiredConnPublisher;
 
     // Handlers must be deleted after iPolicy and iASYProxyHandler
@@ -850,22 +838,37 @@
     TAccPolAccessoryMode accMode;
 
     iServerModel->CurrentConnectionStatusL( genericIDArray );
-
-    if( (EFalse == aAudioOutputStatus) && (KErrUnknown != aDbId) ) 
-        { 
-        TInt index( TAccPolGenericIDArrayAccessor::FindWithUniqueIDL( 
-                genericIDArray, aDbId) ); 
-				if(KErrNotFound != index)
-					{
-        	TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray(genericIDArray, index); 
-        	}
+    
+    TUint count;
+    TBool isHDMIConnected = EFalse;
+    
+    count = genericIDArray.Count();
+    if((1 < count) && (EFalse == aAudioOutputStatus) && (KErrUnknown != aDbId))
+        {
+        for(TInt i( 0 ); i < count; ++i)
+            {
+            if(genericIDArray.GetGenericIDL(i).PhysicalConnectionCaps() & KPCHDMI)
+                {
+                isHDMIConnected = ETrue;
+                break;
+                }        
+            }
+        }
+    
+    if(isHDMIConnected)
+        {
+        accMode = iServerModel->AccessoryMode();
+        }    
+    else
+        {
+        accMode = iPolicy->ResolveAccessoryModeL( genericIDArray, 
+                                                  aDbId, 
+                                                  aAudioOutputStatus, 
+                                                  iServerModel->AccessoryMode(), 
+                                                  iServerModel->UniqueID() );
         }
 
-    accMode = iPolicy->ResolveAccessoryModeL( genericIDArray, 
-                                              aDbId, 
-                                              aAudioOutputStatus, 
-                                              iServerModel->AccessoryMode(), 
-                                              iServerModel->UniqueID() );
+    
 
     if( iServerModel->SetAccessoryMode( accMode, aDbId ) ) //Store accessory mode
         {
--- a/accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp	Thu May 27 14:11:20 2010 +0300
@@ -1479,6 +1479,7 @@
         {
         case 0:
             //reserved
+            ReadUnknownTagCode( aData, aIndex, L1 );
             break;
         case 1:
             ReadCea861ShortAudioDataBlockL( aData, aIndex, L1 );
@@ -1535,6 +1536,7 @@
     const TInt8 aLen )
     {
     FUNC_LOG;
+    TBool first = EFalse;
 
     iAudioDataBlockSupported = ETrue;
 
@@ -1542,6 +1544,8 @@
         {
         iParsedInfo->iShortAudioDescriptors
             = new ( ELeave ) TCEA861AudioDataBlock();
+		first = ETrue;
+		iParsedInfo->iShortAudioDescriptors->iNext = 0;
         }
     TCEA861AudioDataBlock* cur = iParsedInfo->iShortAudioDescriptors;
 
@@ -1550,8 +1554,8 @@
         cur = cur->iNext; // jump to the end
         }
 
-    TBool first = ETrue;
-    for( int i = 0; i < aLen; i++ )
+	TInt i = 0;
+	while (i < aLen)
         {
         // read aLen-amount of short video descriptors
 
@@ -1594,20 +1598,20 @@
     {
     FUNC_LOG;
 
-    TBool first = ETrue;
+    TBool first = EFalse;
     iVideoDataBlockSupported = ETrue;
     if( !iParsedInfo->iShortVideoDescriptors ) // linked list
         {
         iParsedInfo->iShortVideoDescriptors
             = new ( ELeave ) TCEA861VideoDataBlock();
         iParsedInfo->iShortVideoDescriptors->iNext = 0; // make sure there are no stray pointers
+        first = ETrue;
         }
 
     TCEA861VideoDataBlock* cur = iParsedInfo->iShortVideoDescriptors;
     while( cur->iNext != 0 )
         {
         cur = cur->iNext; // jump to the end
-        first = EFalse; // there is already some links, so set first to false
         }
 
     for( int i = 0; i < aLen; i++ )
@@ -1673,11 +1677,13 @@
 
     aLen -= 3; // this is needed: Vendor specific payload length = L4-3bytes
 
-    TBool first = ETrue;
+    TBool first = EFalse;
     if( iParsedInfo->iVendorSpecificData->iVendorSpecificPayloadStart == 0 )
         {
         iParsedInfo->iVendorSpecificData->iVendorSpecificPayloadStart
             = new ( ELeave ) TCEA861VendorSpecificDataBlockPayload();
+		iParsedInfo->iVendorSpecificData->iVendorSpecificPayloadStart->iNext = 0;
+		first = ETrue;
         }
     TCEA861VendorSpecificDataBlockPayload* cur =
         iParsedInfo->iVendorSpecificData->iVendorSpecificPayloadStart;
@@ -1756,6 +1762,7 @@
     const TInt8 aLen )
     {
     FUNC_LOG;
+	TBool first = EFalse;
 
     aIndex++; // jump to the extended tag code (aLen is the length from extended tag to the end)
 
@@ -1763,13 +1770,12 @@
         {
         iParsedInfo->iVideoCapabilityDataBlock
             = new ( ELeave ) TCEA861VideoCapabilityDataBlock();
+		first = ETrue;
         }
     TCEA861VideoCapabilityDataBlock* cur =
         iParsedInfo->iVideoCapabilityDataBlock;
-    TBool first = ETrue;
     while( cur->iNext != 0 )
         {
-        first = EFalse;
         cur = cur->iNext;
         }
 
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Thu May 27 14:11:20 2010 +0300
@@ -40,6 +40,7 @@
 
 const TInt KDefaultCEAMode = E640x480p59_94d60Hz4d3;
 const TInt KDefaultCEAModeIndex = 0;
+const TInt KDefaultDMTModeIndex = 3;
 
 // Retry Delay for EDID access
 const TInt KRetryDelay = 50 * 1000; // 50 milliseconds
@@ -551,9 +552,10 @@
                     }
                 else
                     {
+                    // No EDID data available from the sink
                     iRetryCounter = KErrNone;
-                    iFSM.Input( EPDEIfEDIDHandler,
-                        EPDEIfEDIDHandlerEventEdidDataFetchFailed );
+					ResetData();
+					iFSM.Input( EPDEIfEDIDHandler, EPDEIfEDIDHandlerEventEdidDataFetched );
                     }
                 }
             break;
@@ -643,8 +645,6 @@
     {
     FUNC_LOG;
     
-    aTimings.iTvPhysicalImageWidthMm = iEdidParserPtr->GetHorizontalScreenSize() * 10;
-    aTimings.iTvPhysicalImageHeightMm = iEdidParserPtr->GetVerticalScreenSize() * 10;
     aTimings.iTvPhysicalImageAspectRatioNumerator = 0;
     aTimings.iTvPhysicalImageAspectRatioDenominator = 0;
     aTimings.iHorizontalBorderPixels = 0;
@@ -652,15 +652,25 @@
     aTimings.iVerticalBorderLinesField2 = 0;
     aTimings.iLeftBorderPixels = 0;
     aTimings.iRightBorderPixels = 0;
-    aTimings.iUnderscanEnabled = EFalse;
     
     if( iExtensionParserPtr )
         {
+        INFO("==CEA Extension Exists");
         aTimings.iUnderscanEnabled = iExtensionParserPtr->Underscan();
         }
+	else
+		{
+        INFO("==No CEA Extension");
+		// No CEA Extension so it should be DVI
+		// Underscan supported always		
+		aTimings.iTvPhysicalImageAspectRatioNumerator = 4;
+		aTimings.iTvPhysicalImageAspectRatioDenominator = 3;
+		aTimings.iUnderscanEnabled = ETrue;
+		}
     
     if( aTimings.iUnderscanEnabled )
         {
+        INFO("==Underscan Enabled");
         // Underscan
         aTimings.iLeftTopCorner.iX = 0;
         aTimings.iLeftTopCorner.iY = 0;
@@ -669,23 +679,30 @@
         }
     else
         {
+        INFO("==Underscan Disabled");
         // Calculate overscan
         CalculateOverscan( aTimings.iLeftTopCorner,
             aTimings.iRightBottomCorner );                
         }
-    aTimings.iTvPhysicalImageAspectRatioNumerator = iEdidParserPtr->GetAspectRatioLandscape();
-    aTimings.iTvPhysicalImageAspectRatioDenominator = iEdidParserPtr->GetAspectRatioPortrait();
     aTimings.iConnector = TTvSettings::EHDMI;
-    aTimings.iTvColorCoordinates.iRed.iX = iEdidParserPtr->GetColorCoordinatesRedX();
-    aTimings.iTvColorCoordinates.iRed.iY = iEdidParserPtr->GetColorCoordinatesRedY();
-    aTimings.iTvColorCoordinates.iGreen.iX = iEdidParserPtr->GetColorCoordinatesGreenX();
-    aTimings.iTvColorCoordinates.iGreen.iY = iEdidParserPtr->GetColorCoordinatesGreenY();
-    aTimings.iTvColorCoordinates.iBlue.iX = iEdidParserPtr->GetColorCoordinatesBlueX();
-    aTimings.iTvColorCoordinates.iBlue.iY = iEdidParserPtr->GetColorCoordinatesBlueY();
-    aTimings.iTvColorCoordinates.iWhite.iX = iEdidParserPtr->GetColorCoordinatesWhiteX();
-    aTimings.iTvColorCoordinates.iWhite.iY = iEdidParserPtr->GetColorCoordinatesWhiteY();
-    aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion();
-    aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision();
+
+	if( iEdidParserPtr )
+		{
+		aTimings.iTvPhysicalImageWidthMm = iEdidParserPtr->GetHorizontalScreenSize() * 10;
+		aTimings.iTvPhysicalImageHeightMm = iEdidParserPtr->GetVerticalScreenSize() * 10;
+	    aTimings.iTvPhysicalImageAspectRatioNumerator = iEdidParserPtr->GetAspectRatioLandscape();
+	    aTimings.iTvPhysicalImageAspectRatioDenominator = iEdidParserPtr->GetAspectRatioPortrait();
+	    aTimings.iTvColorCoordinates.iRed.iX = iEdidParserPtr->GetColorCoordinatesRedX();
+	    aTimings.iTvColorCoordinates.iRed.iY = iEdidParserPtr->GetColorCoordinatesRedY();
+	    aTimings.iTvColorCoordinates.iGreen.iX = iEdidParserPtr->GetColorCoordinatesGreenX();
+	    aTimings.iTvColorCoordinates.iGreen.iY = iEdidParserPtr->GetColorCoordinatesGreenY();
+	    aTimings.iTvColorCoordinates.iBlue.iX = iEdidParserPtr->GetColorCoordinatesBlueX();
+	    aTimings.iTvColorCoordinates.iBlue.iY = iEdidParserPtr->GetColorCoordinatesBlueY();
+	    aTimings.iTvColorCoordinates.iWhite.iX = iEdidParserPtr->GetColorCoordinatesWhiteX();
+	    aTimings.iTvColorCoordinates.iWhite.iY = iEdidParserPtr->GetColorCoordinatesWhiteY();
+	    aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion();
+	    aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision();
+		}
     Mem::FillZ( ( TAny* )&aTimings.iProductName, ( sizeof( TChar ) * KProductNameChars ) );
     Mem::FillZ( ( TAny* )&aTimings.iProductDescription, ( sizeof( TChar ) * KProductDescriptorsChars ) );
     aTimings.iSourceType = THdmiDviTimings::ESourceTypeUnknown;
@@ -861,21 +878,44 @@
     FUNC_LOG;
     
     TInt retVal(KErrNone);
-    
-    // Check established timings 1 and 2
-    retVal = SetDmtModesFromEstablishedTimings( aTimings );
-    
-    if( KErrNone == retVal )
-        {
-        // Check standard timings
-        retVal = SetDmtModesFromStandardTimings( aTimings );
-        
-        if( KErrNone == retVal )
-            {
-            // Check timing descriptors
-            retVal = SetDmtModesFromTimingDescriptors( aTimings );        
-            }
-        }
+
+	if( iDataBlockPtr )
+		{
+	    // Check established timings 1 and 2
+	    retVal = SetDmtModesFromEstablishedTimings( aTimings );
+	    
+	    if( KErrNone == retVal )
+	        {
+	        // Check standard timings
+	        retVal = SetDmtModesFromStandardTimings( aTimings );
+	        
+	        if( KErrNone == retVal )
+	            {
+	            // Check timing descriptors
+	            retVal = SetDmtModesFromTimingDescriptors( aTimings );        
+	            }
+	        }
+		}
+	else
+		{
+		INFO( "==No EDID available from the Sink. Setting DMT 4" );
+		// No EDID data available from the sink
+		// Default VGA resolution should be selected
+		THdmiDviTimings timings;
+		const TTimingItem* item = TimingByIndex( KDefaultDMTModeIndex, ETimingModeDMT );
+		if( item )
+			{
+			Mem::FillZ( ( TAny* )&timings, sizeof( timings ) );
+			FillHdmiDviTimings( *item, timings );
+			retVal = aTimings.Append( timings );
+			ERROR_1( retVal, "Failed to append DMT timing: %S in array", item->iTimingName );
+			}
+		else
+			{
+			ERROR_1( KErrArgument, "DMT timing item not found for VIC mode: %d", KDefaultDMTModeIndex );
+			retVal = KErrNotFound;
+			}
+		}
     
     return retVal;
     }
--- a/psmservices/psmserver/src/server/psmsrvsession.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/psmservices/psmserver/src/server/psmsrvsession.cpp	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-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"
@@ -15,7 +15,8 @@
 *
 */
 
-
+#include <e32property.h>
+#include <connect/sbdefs.h>
 #include <psmsettingsprovider.h>
 #include "psmmanager.h"
 #include "psmsrvserver.h"
@@ -167,7 +168,18 @@
                 {
                 User::Leave( KErrArgument );
                 }
-
+			
+            TInt keyVal = -1;
+            User::LeaveIfError( RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal ) );
+			//if backup or restore is in progress, change in power save mode
+			//is not allowed as it will not be possible to do write
+			//operation in cenrep and it would leave the device in unstable power saving mode state
+            if( (( keyVal & conn::KBURPartTypeMask ) != conn::EBURNormal ) 
+				&& (( keyVal & conn::KBURPartTypeMask ) != conn::EBURUnset ))
+				{
+				User::Leave( KErrNotSupported );
+				}
+			
             iNotifyModeMessage->Initialize( aMessage );
             iPsmManager.NotifyPowerSaveModeChangeL( mode );
             break;
--- a/sensorservices/orientationssy/inc/SsyConfiguration.h	Fri May 14 17:08:00 2010 +0300
+++ b/sensorservices/orientationssy/inc/SsyConfiguration.h	Thu May 27 14:11:20 2010 +0300
@@ -156,8 +156,7 @@
             KNoRealValue,
             0,                                  // iMinValue
             KNoRealValue,
-            ETrue,                             // iReadOnly. Default value is not readonly, it is set
-                                                // to read only when updated.
+            ETrue,                             // iReadOnly. 
             ESensrvIntProperty                  // iPropertyType
         }
     };
--- a/sensorservices/orientationssy/src/SsyChannel.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyChannel.cpp	Thu May 27 14:11:20 2010 +0300
@@ -303,17 +303,6 @@
             break;
         case EChannelOpening:
             {
-            // Before completing channel opening, get max data rate from actual SSY
-            if ( !iSensorProperties->DataRateUpdated() )
-                {
-                TSensrvProperty maxdatarate;
-                RSensrvChannelList affectedChannels;
-                // Get max data rate
-                iOrientationHandler->GetMaxDataRateL( maxdatarate );
-                // Set property
-                iSensorProperties->SetProperty( maxdatarate, affectedChannels );
-                }
-
             SetChannelState( EChannelOpen );
             iCallback->ChannelOpened( iChannelInfo.iChannelId, iStatus.Int(), this, this );
             break;
--- a/sensorservices/orientationssy/src/SsyProperty.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyProperty.cpp	Thu May 27 14:11:20 2010 +0300
@@ -297,14 +297,13 @@
 
     else if ( aProperty.GetPropertyId() == KSensrvPropIdDataRate )
         {
-        SSY_TRACE( EExtended, "ORIENTATIONSSY: Updating data rate property" );
-        // Data rate property is replaced in a different way than others.
-        // Note that this can be done only once as this property is set to read only.
-        aProperty.GetValue( intValue );
-        // Leave value to 0, update only max value because that is the only value we can provide
+        // Since Orientation is an event, the data rate property is made readonly.
+        // In ssyconfiguration.h file, the datarate property is defined as writable,
+        // it is not modified due to backward compatibility. 
+        // Now it is changed and the orientation channel property is made readonly always.
+        
         if( iChannelProperties.Count() >= index )
             {
-            iChannelProperties[index].iIntMaxValue = intValue;
             iChannelProperties[index].iReadOnly = ETrue;
             }
         
--- a/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Thu May 27 14:11:20 2010 +0300
@@ -99,58 +99,10 @@
         r_cmd_amastart,
         // prio 0x7F96
         r_cmd_multiple_wait,
-        // prio 0x7EFF
-        r_cmd_activitymonitor1,
-        // prio 0x7EFD
-        r_cmd_activitymonitor2,
-        // prio 0x7EFB
-        r_cmd_activitymonitor3,
-        // prio 0x7EF9
-        r_cmd_activitymonitor4,
-        // prio 0x7EF7
-        r_cmd_activitymonitor5,
-        // prio 0x7EF6
-        r_cmd_videocenter,
-        // prio 0x7EF5
-        r_cmd_activitymonitor6,
-        // prio 0x7EF4
-        r_cmd_iaupdatebg,
-        // prio 0x7EF3
-        r_cmd_activitymonitor7,
-        // prio 0x7EF2
-        r_cmd_activitymonitor8,
-        // prio 0x7EEE
-        r_cmd_autosync,
-        // prio 0x7EED
-        r_cmd_activitymonitor9,
-        // prio 0x7EEC
-        r_cmd_mylocationsengine,
-        //prio 0x7EEA
-        r_cmd_activitymonitor10,
-        //prio 0x7EE9
-        r_cmd_conversationserver,	//SBSA-7YZGCQ
-        //prio 0x7EE8
-        r_cmd_activitymonitor11,
-        //prio 0x7EE7
-        r_cmd_msgnotifier		//SBSA-82ZBMC
-#ifdef FF_ATT_ADDRESS_BK
-        //prio 0x7EE6
-        ,r_cmd_activitymonitor12,
-        //prio 0x7EE5
-        r_cmd_aab
-#endif
-#ifdef FF_SEARCH_SW
-       //prio 0x7EE4
-       ,r_cmd_activitymonitor13,
-       //prio 0x7EE3
-       r_cmd_searchsw 		//SLAR-832C9T
-#endif //FF_SEARCH_SW
-#ifdef FF_EMAIL_FRAMEWORK
-		//prio 0x7EE2
-       ,r_cmd_activitymonitor14,
-       //prio 0x7EE1
-       r_cmd_nmailagent 	//MBEN-83CFQE
-#endif //FF_EMAIL_FRAMEWORK
+        // prio 0x7F55
+        r_cmd_createswp_noncriticalphase,
+				// prio 0x7F54
+        r_cmd_setswp_noncriticalstart
         };
     }
 
@@ -159,236 +111,6 @@
 // ===========================================================================
 //
 
-// -----------------------------------------------------------------------------
-// r_cmd_aab
-// -----------------------------------------------------------------------------
-//
-#ifdef FF_ATT_ADDRESS_BK 
-RESOURCE SSM_START_APP_INFO r_cmd_aab
-    {
-    priority = 0x7EE5;
-    name = "z:\\sys\\bin\\AABPhonebookapp.exe";
-    retries = 2;
-    background = 1; // To background
-    monitor_info = r_mon_3_restarts_ignore;
-    }
-#endif
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor1
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor1
-    {
-    priority = 0x7EFF;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor2
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor2
-    {
-    priority = 0x7EFD;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor3
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor3
-    {
-    priority = 0x7EFB;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor4
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor4
-    {
-    priority = 0x7EF9;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor5
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor5
-    {
-    priority = 0x7EF7;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor6
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor6
-    {
-    priority = 0x7EF5;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor7
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor7
-    {
-    priority = 0x7EF3;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor8
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor8
-    {
-    priority = 0x7EEF;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor9
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor9
-    {
-    priority = 0x7EED;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor10
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor10
-    {
-    priority = 0x7EEA;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-	
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor11
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor11
-    {
-    priority = 0x7EE8;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-	
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor12
-// ---------------------------------------------------------------------------
-//
-#ifdef FF_ATT_ADDRESS_BK
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor12
-    {
-    priority = 0x7EE6;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-#endif
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor13
-// ---------------------------------------------------------------------------
-//
-#ifdef FF_SEARCH_SW
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor13
-    {
-    priority = 0x7EE4;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-#endif //FF_SEARCH_SW
-
-// ---------------------------------------------------------------------------
-// r_cmd_activitymonitor14
-// ---------------------------------------------------------------------------
-//
-#ifdef FF_EMAIL_FRAMEWORK
-RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor14
-    {
-    priority = 0x7EE2;
-    severity = ECmdCriticalSeverity;
-    execution_behaviour = ESsmWaitForSignal;
-    dllname = "ssmactivitycmd.dll";
-    ordinal = 1; // SsmActivityCmdNewL
-    retries = 2;
-    dll_data = r_dlldata_activitymonitor_timeout;
-    }
-#endif //FF_EMAIL_FRAMEWORK
 // ---------------------------------------------------------------------------
 // r_cmd_amastart
 // ---------------------------------------------------------------------------
@@ -398,18 +120,6 @@
     priority = 0x7F97;
     conditional_information = r_cond_ps_normalboot;
     }
-
-// ---------------------------------------------------------------------------
-// r_cmd_autosync
-// ---------------------------------------------------------------------------
-//	
-RESOURCE SSM_START_PROCESS_INFO r_cmd_autosync
-    {
-    priority = 0x7EEE;
-    execution_behaviour = ESsmFireAndForget;
-    retries = 3;
-    name = "cctautosync.exe";
-    }
 	
 // ---------------------------------------------------------------------------
 // r_cmd_aosrv
@@ -451,16 +161,30 @@
     monitor_info = r_mon_3_restarts_ignore;
     }
 
+
 // ---------------------------------------------------------------------------
-// r_cmd_conversationserver
+// r_cmd_createswp_noncriticalphase
 // ---------------------------------------------------------------------------
 //
-RESOURCE SSM_START_PROCESS_INFO r_cmd_conversationserver
+RESOURCE SSM_CREATE_SYSTEM_WIDE_PROPERTY r_cmd_createswp_noncriticalphase
     {
-    priority = 0x7EE9;
-    name = "csserver.exe";
-    execution_behaviour = ESsmWaitForSignal;
+    priority = 0x7F55;
+    severity = ECmdCriticalSeverity;
+    key = SWP_UID_SSM_NONCRITICAL_PHASE;
+    filename = "ssmnoncriticalswppolicy.dll";
     }
+
+// ---------------------------------------------------------------------------
+// r_cmd_setswp_noncriticalstart
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_REQUEST_SYSTEM_WIDE_PROPERTY r_cmd_setswp_noncriticalstart
+    {
+    priority = 0x7F54;
+    key = SWP_UID_SSM_NONCRITICAL_PHASE;
+    value = ESsmNonCriticalPhaseStarted;
+    }
+
 // ---------------------------------------------------------------------------
 // r_cmd_dcmo
 // ---------------------------------------------------------------------------
@@ -542,19 +266,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// r_cmd_iaupdatebg
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_PROCESS_INFO r_cmd_iaupdatebg
-    {
-    priority = 0x7EF4;
-    name = "iaupdatebg.exe";
-    execution_behaviour = ESsmWaitForSignal;
-    timeout = 10000;
-    conditional_information = r_cond_feat_iadv2;
-    }
-
-// ---------------------------------------------------------------------------
 // r_cmd_ippushman
 // ---------------------------------------------------------------------------
 //
@@ -592,17 +303,6 @@
     monitor_info = r_mon_3_restarts_ignore;
     }
 
-// ---------------------------------------------------------------------------
-// r_cmd_msgnotifier
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_APP_INFO r_cmd_msgnotifier
-    {
-    priority = 0x7EE7;
-    name = "msgnotifier.exe";
-    execution_behaviour = ESsmFireAndForget;
-    retries = 3;
-    }	
 
 // ---------------------------------------------------------------------------
 // r_cmd_psstate
@@ -655,52 +355,6 @@
     execution_behaviour = ESsmWaitForSignal;
     timeout = 10000;
     }
-	
-//---------------------------------------------------------------------------
-// r_cmd_searchsw
-// ---------------------------------------------------------------------------
-//
-#ifdef	FF_SEARCH_SW
-RESOURCE SSM_START_PROCESS_INFO r_cmd_searchsw
-	{
-	priority = 0x7EE3;
-	name = "z:\\sys\\bin\\cpixwatchdog.exe";
-	execution_behaviour = ESsmFireAndForget;
-	conditional_information = r_cond_feat_searchsw;
-	}
-
-// ---------------------------------------------------------------------------
-// r_cond_feat_searchsw
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_searchsw
-    {
-    feature_id = KFeatureIdFfSearchSw;
-    }
-#endif //FF_SEARCH_SW
-
-// ---------------------------------------------------------------------------
-// r_cmd_nmailagent
-// ---------------------------------------------------------------------------
-//
-#ifdef FF_EMAIL_FRAMEWORK
-RESOURCE SSM_START_PROCESS_INFO r_cmd_nmailagent
-    {
-    priority = 0x7EE1;
-    name = "z:\\sys\\bin\\nmailagent.exe";
-    execution_behaviour = ESsmFireAndForget;
-    conditional_information = r_cond_feat_emailfw;
-    }
-    
-// ---------------------------------------------------------------------------
-// r_cond_feat_emailfw
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_emailfw
-    {
-    feature_id = KFeatureIdFfEmailFramework;
-    }
-#endif //FF_EMAIL_FRAMEWORK
 
 // ---------------------------------------------------------------------------
 // r_cmd_supllistener
@@ -726,18 +380,6 @@
      }
 
 // ---------------------------------------------------------------------------
-// r_cmd_videocenter
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_PROCESS_INFO r_cmd_videocenter
-    {
-    priority = 0x7EF6;
-    name = "cseschedulerserver.exe";
-    execution_behaviour = ESsmWaitForSignal;
-    timeout = 10000;
-    }
-
-// ---------------------------------------------------------------------------
 // r_cmd_waitcleanbootinfo
 // ---------------------------------------------------------------------------
 //
@@ -783,15 +425,6 @@
 //
 
 // ---------------------------------------------------------------------------
-// r_dlldata_activitymonitor_timeout
-// ---------------------------------------------------------------------------
-//
-RESOURCE CMD_PARAM_TIMEOUT r_dlldata_activitymonitor_timeout
-    {
-    timeout = 2;
-    }
-
-// ---------------------------------------------------------------------------
 // r_dlldata_waitcleanbootinfo
 // ---------------------------------------------------------------------------
 //
@@ -803,17 +436,6 @@
     target2 = 102;          // EStartupCleanBoot
     }
 
-// ---------------------------------------------------------------------------
-// r_cmd_mylocationsengine
-// ---------------------------------------------------------------------------
-//	
-RESOURCE SSM_START_PROCESS_INFO r_cmd_mylocationsengine
-    {
-    priority = 0x7EEC;
-    name = "z:\\sys\\bin\\mylocationsengine.exe";
-    execution_behaviour = ESsmFireAndForget;
-    }
-
 // ===========================================================================
 // Conditional blocks in alphabetical order
 // ===========================================================================
@@ -849,15 +471,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// r_cond_feat_iadv2
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_iadv2
-    {
-    feature_id = KFeatureIdFfIaupdatePhase2;
-    }
-
-// ---------------------------------------------------------------------------
 // r_cond_feat_ippush
 // ---------------------------------------------------------------------------
 //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmcmdlists/data/noncriticalswpcmdlists.rss	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,431 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Command lists for the noncritical phase SWP:
+*   - non-critical phase Started
+*
+*/
+
+#include <ssm/conditionresourcetypes.rh>
+#include <ssm/ssmcmd.rh>
+
+#include "ssmswp.hrh"
+#include "ssmdlldatadefs.rh"
+
+// Identify command list type
+UID2 KUidSsmCommandListResourceFile
+
+// ---------------------------------------------------------------------------
+// r_entry_point
+// This must be the first resource
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_COMMAND_LIST_ROOT r_entry_point
+    {
+    command_list_mapping = r_map;
+    }
+
+// ---------------------------------------------------------------------------
+// r_map
+// Mapping of command list ids to resource ids.
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_COMMAND_LIST_MAPPING r_map
+    {
+    mappings =
+        {
+        SSM_COMMANDLISTID_TO_RESOURCEID
+            {
+            command_list_id = ESsmNonCriticalPhaseStarted;
+            resource_id = r_noncriticalphase_commands;
+            }
+        };
+    }
+
+// ===========================================================================
+// Command lists in alphabetical order
+// ===========================================================================
+//
+
+// ---------------------------------------------------------------------------
+// r_started_commands
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_COMMAND_LIST r_noncriticalphase_commands
+    {
+    commands =
+        {
+        // prio 0xFFF1
+        r_cmd_publishswp,
+       // prio 0x7EF7
+        r_cmd_activitymonitor1,
+        // prio 0x7EF6
+        r_cmd_videocenter,
+        // prio 0x7EF5
+        r_cmd_activitymonitor2,
+        // prio 0x7EF4
+        r_cmd_iaupdatebg,
+        // prio 0x7EF2
+        r_cmd_activitymonitor3,
+        // prio 0x7EEE
+        r_cmd_autosync,
+        // prio 0x7EED
+        r_cmd_activitymonitor4,
+        // prio 0x7EEC
+        r_cmd_mylocationsengine,
+        //prio 0x7EEA
+        r_cmd_activitymonitor5,
+        //prio 0x7EE9
+        r_cmd_conversationserver,	//SBSA-7YZGCQ
+        //prio 0x7EE8
+        r_cmd_activitymonitor6,
+        //prio 0x7EE7
+        r_cmd_msgnotifier		//SBSA-82ZBMC
+#ifdef FF_ATT_ADDRESS_BK
+        //prio 0x7EE6
+        ,r_cmd_activitymonitor7,
+        //prio 0x7EE5
+        r_cmd_aab
+#endif
+#ifdef FF_SEARCH_SW
+       //prio 0x7EE4
+       ,r_cmd_activitymonitor8,
+       //prio 0x7EE3
+       r_cmd_searchsw 		//SLAR-832C9T
+#endif //FF_SEARCH_SW
+#ifdef FF_EMAIL_FRAMEWORK
+		//prio 0x7EE2
+       ,r_cmd_activitymonitor9,
+       //prio 0x7EE1
+       r_cmd_nmailagent 	//MBEN-83CFQE
+#endif //FF_EMAIL_FRAMEWORK
+    	 };
+    }
+
+// ===========================================================================
+// Command items in alphabetical order
+// ===========================================================================
+//
+
+// -----------------------------------------------------------------------------
+// r_cmd_aab
+// -----------------------------------------------------------------------------
+//
+#ifdef FF_ATT_ADDRESS_BK 
+RESOURCE SSM_START_APP_INFO r_cmd_aab
+    {
+    priority = 0x7EE5;
+    name = "z:\\sys\\bin\\AABPhonebookapp.exe";
+    retries = 2;
+    background = 1; // To background
+    monitor_info = r_mon_3_restarts_ignore;
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor1
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor1
+    {
+    priority = 0x7EF7;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor2
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor2
+    {
+    priority = 0x7EF5;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor3
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor3
+    {
+    priority = 0x7EF2;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor4
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor4
+    {
+    priority = 0x7EED;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor5
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor5
+    {
+    priority = 0x7EEA;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+	
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor6
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor6
+    {
+    priority = 0x7EE8;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+	
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor7
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_ATT_ADDRESS_BK
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor7
+    {
+    priority = 0x7EE6;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor8
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_SEARCH_SW
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor8
+    {
+    priority = 0x7EE4;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+#endif //FF_SEARCH_SW
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor9
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_EMAIL_FRAMEWORK
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor9
+    {
+    priority = 0x7EE2;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+#endif //FF_EMAIL_FRAMEWORK
+
+
+// ---------------------------------------------------------------------------
+// r_cmd_autosync
+// ---------------------------------------------------------------------------
+//	
+RESOURCE SSM_START_PROCESS_INFO r_cmd_autosync
+    {
+    priority = 0x7EEE;
+    execution_behaviour = ESsmFireAndForget;
+    retries = 3;
+    name = "cctautosync.exe";
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_conversationserver
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_conversationserver
+    {
+    priority = 0x7EE9;
+    name = "csserver.exe";
+    execution_behaviour = ESsmWaitForSignal;
+    }
+
+
+// ---------------------------------------------------------------------------
+// r_cmd_msgnotifier
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_APP_INFO r_cmd_msgnotifier
+    {
+    priority = 0x7EE7;
+    name = "msgnotifier.exe";
+    execution_behaviour = ESsmFireAndForget;
+    retries = 3;
+    }	
+
+// ---------------------------------------------------------------------------
+// r_cmd_mylocationsengine
+// ---------------------------------------------------------------------------
+//	
+RESOURCE SSM_START_PROCESS_INFO r_cmd_mylocationsengine
+    {
+    priority = 0x7EEC;
+    name = "z:\\sys\\bin\\mylocationsengine.exe";
+    execution_behaviour = ESsmFireAndForget;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_publishswp
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_PUBLISH_SYSTEM_WIDE_PROPERTY r_cmd_publishswp
+    {
+    priority = 0xFFF1;
+    severity = ECmdCriticalSeverity;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cmd_nmailagent
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_EMAIL_FRAMEWORK
+RESOURCE SSM_START_PROCESS_INFO r_cmd_nmailagent
+    {
+    priority = 0x7EE1;
+    name = "z:\\sys\\bin\\nmailagent.exe";
+    execution_behaviour = ESsmFireAndForget;
+    conditional_information = r_cond_feat_emailfw;
+    }
+    
+// ---------------------------------------------------------------------------
+// r_cond_feat_emailfw
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_emailfw
+    {
+    feature_id = KFeatureIdFfEmailFramework;
+    }
+#endif //FF_EMAIL_FRAMEWORK
+
+// ---------------------------------------------------------------------------
+// r_cmd_iaupdatebg
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_iaupdatebg
+    {
+    priority = 0x7EF4;
+    name = "iaupdatebg.exe";
+    execution_behaviour = ESsmWaitForSignal;
+    timeout = 10000;
+    conditional_information = r_cond_feat_iadv2;
+    }
+	
+//---------------------------------------------------------------------------
+// r_cmd_searchsw
+// ---------------------------------------------------------------------------
+//
+#ifdef	FF_SEARCH_SW
+RESOURCE SSM_START_PROCESS_INFO r_cmd_searchsw
+	{
+	priority = 0x7EE3;
+	name = "z:\\sys\\bin\\cpixwatchdog.exe";
+	execution_behaviour = ESsmFireAndForget;
+	conditional_information = r_cond_feat_searchsw;
+	}
+
+// ---------------------------------------------------------------------------
+// r_cond_feat_searchsw
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_searchsw
+    {
+    feature_id = KFeatureIdFfSearchSw;
+    }
+#endif //FF_SEARCH_SW
+
+// ---------------------------------------------------------------------------
+// r_cmd_videocenter
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_videocenter
+    {
+    priority = 0x7EF6;
+    name = "cseschedulerserver.exe";
+    execution_behaviour = ESsmWaitForSignal;
+    timeout = 10000;
+    }
+
+// ===========================================================================
+// DLL data items in alphabetical order
+// ===========================================================================
+//
+
+// ---------------------------------------------------------------------------
+// r_dlldata_activitymonitor_timeout
+// ---------------------------------------------------------------------------
+//
+RESOURCE CMD_PARAM_TIMEOUT r_dlldata_activitymonitor_timeout
+    {
+    timeout = 2;
+    }
+
+// ---------------------------------------------------------------------------
+// r_cond_feat_iadv2
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_iadv2
+    {
+    feature_id = KFeatureIdFfIaupdatePhase2;
+    }    
+
+// monitoring.rss contains resource definitions, so it may not be included
+// before entry point.
+#include "monitoring.rss"
--- a/sysstatemgmt/ssmcmdlists/data/shutdowncmdlists.rss	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/shutdowncmdlists.rss	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -214,6 +214,7 @@
     {
     priority = 0xFFF1;
     severity = ECmdCriticalSeverity;
+    direction = 1;  // ETraverseChildrenFirst, Transition children first for graceful shutdown.
     retries = 2;
     }
 
--- a/sysstatemgmt/ssmcmdlists/group/ssmcmdlists.mmp	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/group/ssmcmdlists.mmp	Thu May 27 14:11:20 2010 +0300
@@ -107,6 +107,10 @@
 TARGETPATH      /private/2000d75b/swpui              // Private directory of sysstatemgr.exe
 END
 
+START RESOURCE  noncriticalswpcmdlists.rss            // noncritical phase SWP
+TARGETPATH      /private/2000d75b/swpnoncritical      // Private directory of sysstatemgr.exe
+END
+
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
 
--- a/sysstatemgmt/ssmcmdlists/rom/ssmcmdlists.iby	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/rom/ssmcmdlists.iby	Thu May 27 14:11:20 2010 +0300
@@ -36,5 +36,6 @@
 data=DATAZ_\private\2000D75B\shutdown\shutdowncmdlists.rsc              \private\2000D75B\shutdown\shutdowncmdlists.rsc
 data=DATAZ_\private\2000D75B\rfstatusswpcmdlist\rfswpcmdlists.rsc       \private\2000D75B\rfstatusswpcmdlist\rfswpcmdlists.rsc
 data=DATAZ_\private\2000D75B\swpui\uiswpcmdlists.rsc                    \private\2000D75B\swpui\uiswpcmdlists.rsc
+data=DATAZ_\private\2000D75B\swpnoncritical\noncriticalswpcmdlists.rsc  \private\2000D75B\swpnoncritical\noncriticalswpcmdlists.rsc
 
 #endif // SSMCMDLISTS_IBY
--- a/sysstatemgmt/ssmpolicyplugins/group/bld.inf	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmpolicyplugins/group/bld.inf	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -37,3 +37,5 @@
 #include "../ssmfailpolicy/group/bld.inf"
 #include "../ssmshutdownpolicy/group/bld.inf"
 #include "../ssmuiswppolicy/group/bld.inf"
+#include "../ssmnoncriticalswppolicy/group/bld.inf"
+
--- a/sysstatemgmt/ssmpolicyplugins/inc/ssmswp.hrh	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmpolicyplugins/inc/ssmswp.hrh	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -32,6 +32,19 @@
     };
 
 /**
+* Startup NonCritical phase SWP.
+*
+* These identifiers are also used as command list ids to find the correct
+* command list among all command lists in the system.
+*/
+#define SWP_UID_SSM_NONCRITICAL_PHASE 0x2002EA5B
+
+enum TSwpStartupNonCriticalPhase
+    {
+    ESsmNonCriticalPhaseStarted = 0xb1
+    };
+    
+/**
 * System-wide property for RF status.
 *
 * These identifiers are also used as command list ids to find the correct
--- a/sysstatemgmt/ssmpolicyplugins/rom/ssmpolicyplugins.iby	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/ssmpolicyplugins/rom/ssmpolicyplugins.iby	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -26,5 +26,6 @@
 file=ABI_DIR\BUILD_DIR\ssm.state.policy.0002.dll SHARED_LIB_DIR\ssm.state.policy.0002.dll
 file=ABI_DIR\BUILD_DIR\ssm.state.policy.0003.dll SHARED_LIB_DIR\ssm.state.policy.0003.dll
 file=ABI_DIR\BUILD_DIR\ssmuiswppolicy.dll        SHARED_LIB_DIR\ssmuiswppolicy.dll
+file=ABI_DIR\BUILD_DIR\ssmnoncriticalswppolicy.dll      SHARED_LIB_DIR\ssmnoncriticalswppolicy.dll
 
 #endif // SSMPOLICYPLUGINS_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/bwins/ssmnoncriticalswppolicyu.def	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewL@CSsmNonCriticalSwpPolicy@@SAPAVMSsmSwpPolicy@@XZ @ 1 NONAME ; class MSsmSwpPolicy * CSsmNonCriticalSwpPolicy::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/eabi/ssmnoncriticalswppolicyu.def	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_ZN24CSsmNonCriticalSwpPolicy4NewLEv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/group/bld.inf	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Build information file for the ssmnoncriticalswppolicy project.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+ssmnoncriticalswppolicy.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/group/ssmnoncriticalswppolicy.mmp	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Project definition file for the ssmnoncriticalswppolicy project.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          ssmnoncriticalswppolicy.dll
+TARGETTYPE      dll
+UID             0x2000D765 0x2002EA59
+
+CAPABILITY      PowerMgmt ReadDeviceData WriteDeviceData ProtServ DiskAdmin SwEvent
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          ssmnoncriticalswppolicy.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+USERINCLUDE     ../../ssmpolicybase/inc
+USERINCLUDE     ../../ssmswppolicybase/inc
+USERINCLUDE     ../../../inc
+
+OS_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         ssmcmd.lib
+LIBRARY         ssmcmn.lib
+LIBRARY         ssmpolicybase.lib
+LIBRARY         ssmswppolicybase.lib
+
+// >>> uncomment to enable function-level tracing
+// MACRO        __SSM_FUNC_TRACE__
+// <<< uncomment to enable function-level tracing
+
+// >>> uncomment to direct trace output to file
+// MACRO        __SSM_TRACE_INTO_FILE__
+// LIBRARY      flogger.lib
+// <<< uncomment to direct trace output to file
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/inc/ssmnoncriticalswppolicy.h	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Declaration of CSsmNonCriticalSwpPolicy class.
+*
+*/
+
+#ifndef SSMNONCRITICALSWPPOLICY_H
+#define SSMNONCRITICALSWPPOLICY_H
+
+#include "ssmswppolicybase.h"
+
+/**
+ *  Policy plugin for noncritical phase SWP.
+ */
+NONSHARABLE_CLASS( CSsmNonCriticalSwpPolicy ) : public CSsmSwpPolicyBase
+    {
+
+public:
+
+    /**
+     * Constructs a CSsmNonCriticalSwpPolicy object.
+     *
+     * @return The new object
+     */
+    IMPORT_C static MSsmSwpPolicy* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CSsmNonCriticalSwpPolicy();
+
+private: // From CSsmPolicyBase
+
+    void GetCommandListPathL( TDes& aCmdListPath );
+
+private: // From MSsmSwpPolicy
+
+	/**
+	 * @see MSsmSwpPolicy.
+     */
+    TResponse TransitionAllowed(
+	    const TSsmSwp& aSwp,
+	    const RMessagePtr2& aMessage );
+
+private:
+
+    /**
+    * First phase constructor.
+    */
+    CSsmNonCriticalSwpPolicy();
+
+    };
+
+#endif // SSMNONCRITICALSWPPOLICY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/ssmpolicyplugins/ssmnoncriticalswppolicy/src/ssmnoncriticalswppolicy.cpp	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CSsmNonCriticalSwpPolicy class.
+*
+*/
+
+#include <ssm/ssmswp.h>
+#include <ssm/ssmstate.h>
+
+#include "ssmnoncriticalswppolicy.h"
+#include "ssmswp.hrh"
+#include "ssmmapperutility.h"
+#include "trace.h"
+#include "ssmsubstateext.hrh"
+
+/**
+* SWP noncritical phase policy resource file path format : "\private\<SID of SSM>\swpnoncritical\"
+*/
+_LIT( KCommandListPath, "Z:\\private\\2000D75B\\swpnoncritical\\" );
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSsmNonCriticalSwpPolicy::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MSsmSwpPolicy* CSsmNonCriticalSwpPolicy::NewL()
+    {
+	FUNC_LOG;
+
+    CSsmNonCriticalSwpPolicy* self = new( ELeave ) CSsmNonCriticalSwpPolicy;
+    CleanupStack::PushL( self );
+    self->BaseConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CSsmNonCriticalSwpPolicy::~CSsmNonCriticalSwpPolicy
+// ---------------------------------------------------------------------------
+//
+CSsmNonCriticalSwpPolicy::~CSsmNonCriticalSwpPolicy()
+    {
+    FUNC_LOG;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CSsmNonCriticalSwpPolicy::GetCommandListPathL
+// ---------------------------------------------------------------------------
+//
+void CSsmNonCriticalSwpPolicy::GetCommandListPathL( TDes& aCmdListPath )
+    {
+    FUNC_LOG;
+
+    aCmdListPath = KCommandListPath;
+    iUtil->GetCommandListPath( aCmdListPath );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CSsmNonCriticalSwpPolicy::TransitionAllowed
+// ---------------------------------------------------------------------------
+//
+MSsmSwpPolicy::TResponse CSsmNonCriticalSwpPolicy::TransitionAllowed(
+    const TSsmSwp& aSwp,
+    const RMessagePtr2& aMessage )
+    {
+    FUNC_LOG;
+    INFO_2( "Requested SWP transition: 0x%08x::0x%08x", aSwp.Key(), aSwp.Value() );
+
+    TResponse response = ENotAllowed;
+    if ( iUtil->CheckCaps( aMessage ) )
+        {
+	    TSsmState currentState;
+		const TInt errorCode = GetCurrentState(currentState);
+		ERROR( errorCode, "Failed to get current state" );
+
+		// this SwP transition would be allowed only once per boot(during the system startup).
+        if ((KErrNone == errorCode) && (ESsmStartup == currentState.MainState()) && (aSwp.Value() == ESsmNonCriticalPhaseStarted))
+            {
+            response = EAllowed;
+            }
+        else
+            {
+            INFO( "Requested SWP transition not allowed" );
+            }
+        }
+    else
+        {
+        INFO( "Capability Check Failed" );
+        }
+
+    return response;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CSsmNonCriticalSwpPolicy::CSsmNonCriticalSwpPolicy
+// ---------------------------------------------------------------------------
+//
+CSsmNonCriticalSwpPolicy::CSsmNonCriticalSwpPolicy()
+    {
+    FUNC_LOG;
+    }
--- a/sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil.cpp	Fri May 14 17:08:00 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  ?Description
-*
-*/
-
-
-//  CLASS HEADER
-#include "MT_SysLangUtil.h"
-
-//  EXTERNAL INCLUDES
-#include <EUnitMacros.h>
-#include <EUnitDecorators.h>
-#include <syslangutil.h>
-
-// CONSTRUCTION
-MT_SysLangUtil* MT_SysLangUtil::NewL()
-    {
-    MT_SysLangUtil* self = MT_SysLangUtil::NewLC();
-    CleanupStack::Pop();
-    return self;
-    }
-
-MT_SysLangUtil* MT_SysLangUtil::NewLC()
-    {
-    MT_SysLangUtil* self = new( ELeave ) MT_SysLangUtil();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// Destructor (virtual by CBase)
-MT_SysLangUtil::~MT_SysLangUtil()
-    {
-    Teardown();
-    }
-
-// Default constructor
-MT_SysLangUtil::MT_SysLangUtil()
-    {
-    }
-
-// Second phase construct
-void MT_SysLangUtil::ConstructL()
-    {
-    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
-    // It generates the test case table.
-    CEUnitTestSuiteClass::ConstructL();
-    }
-
-//  METHODS
-void MT_SysLangUtil::SetupL()
-    {
-    User::LeaveIfError( iFs.Connect() );    
-    }
-
-void MT_SysLangUtil::Teardown()
-    {
-    iFs.Close();
-    }
-    
-void MT_SysLangUtil::T_SysLangUtil_IsValidLanguageL()
-    {
-    // Get default language 
-    TInt language = 0;
-    TInt result = SysLangUtil::GetDefaultLanguage( language );
-    EUNIT_ASSERT_EQUALS( result, KErrNone );
-    
-    // Default language should be valid language
-    TBool valid = SysLangUtil::IsValidLanguage( language );
-    EUNIT_ASSERT( valid );
-    
-    // Default language should be valid language
-    valid = SysLangUtil::IsValidLanguage( language, &iFs );
-    EUNIT_ASSERT( valid );        
-    }
-    
-void MT_SysLangUtil::T_SysLangUtil_GetDefaultLanguageL()
-    {
-    // Get default language 
-    TInt language = 0;
-    TInt result = SysLangUtil::GetDefaultLanguage( language );
-    EUNIT_ASSERT_EQUALS( result, KErrNone );
-    
-    result = SysLangUtil::GetDefaultLanguage( language, &iFs );
-    EUNIT_ASSERT_EQUALS( result, KErrNone );    
-    }
-    
-void MT_SysLangUtil::T_SysLangUtil_GetInstalledLanguagesL()
-    {
-    // Create array for languages
-    CArrayFixFlat<TInt>* array = new( ELeave ) CArrayFixFlat<TInt>( 3 );
-    CleanupStack::PushL( array );
-
-    // Get installed languages
-    TInt res = SysLangUtil::GetInstalledLanguages( array );
-    EUNIT_ASSERT_EQUALS( res, KErrNone );
-    
-    array->Reset();
-    res = SysLangUtil::GetInstalledLanguages( array, &iFs );
-    EUNIT_ASSERT_EQUALS( res, KErrNone );    
-    
-    TInt count = array->Count();
-    EUNIT_ASSERT(  count > 0 );
-        
-    // Assert that each received language is a valid language
-    for( TInt i = 0; i < count; ++i )
-    	{
-    	EUNIT_ASSERT( SysLangUtil::IsValidLanguage( array->At( i ) ) );
-    	}
-    
-    CleanupStack::PopAndDestroy( array );
-    }
-
-void MT_SysLangUtil::T_SysLangUtil_RestoreSIMLanguageL()
-    {
-    // Get default language 
-    TInt language = 0;
-    TInt result = SysLangUtil::GetDefaultLanguage( language );
-    EUNIT_ASSERT_EQUALS( result, KErrNone );
-    
-    // Default language should be valid language
-    TInt res = SysLangUtil::RestoreSIMLanguage( language );    
-    EUNIT_ASSERT_EQUALS( res, KErrNone );
-
-    // Default language should be valid language
-    res = SysLangUtil::RestoreSIMLanguage( language, &iFs );    
-    EUNIT_ASSERT_EQUALS( res, KErrNone );    
-    }
-    
-//  TEST TABLE
-EUNIT_BEGIN_TEST_TABLE(
-    MT_SysLangUtil,
-    "SysLangUtil API Test",
-    "MODULE" )
-
-EUNIT_TEST(
-    "#1 Test IsValidLanguage()",
-    "SysLangUtil",
-    "IsValidLanguage",
-    "FUNCTIONALITY",
-    SetupL, T_SysLangUtil_IsValidLanguageL, Teardown)
-    
-EUNIT_TEST(
-    "#2 Test GetDefaultLanguage()",
-    "SysLangUtil",
-    "GetDefaultLanguage",
-    "FUNCTIONALITY",
-    SetupL, T_SysLangUtil_GetDefaultLanguageL, Teardown)
-    
-EUNIT_TEST(
-    "#3 Test GetInstalledLanguages()",
-    "SysLangUtil",
-    "GetInstalledLanguages",
-    "FUNCTIONALITY",
-    SetupL, T_SysLangUtil_GetInstalledLanguagesL, Teardown)
-    
-EUNIT_TEST(
-    "#4 Test RestoreSIMLanguage()",
-    "SysLangUtil",
-    "RestoreSIMLanguage",
-    "FUNCTIONALITY",
-    SetupL, T_SysLangUtil_RestoreSIMLanguageL, Teardown)    
-EUNIT_END_TEST_TABLE
--- a/sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil.h	Fri May 14 17:08:00 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  ?Description
-*
-*/
-
-
-#ifndef __MT_SYSLANGUTIL_H__
-#define __MT_SYSLANGUTIL_H__
-
-//  EXTERNAL INCLUDES
-#include <CEUnitTestSuiteClass.h>
-#include <EUnitDecorators.h>
-#include <f32file.h>
-
-//  CLASS DEFINITION
-/**
- * SysLangUtil API test
- */
-NONSHARABLE_CLASS( MT_SysLangUtil )
-	: public CEUnitTestSuiteClass
-    {
-    public:     // Constructors and destructors
-        /**
-         * Two phase construction
-         */
-        static MT_SysLangUtil* NewL();
-        static MT_SysLangUtil* NewLC();
-        /**
-         * Destructor
-         */
-        ~MT_SysLangUtil();
-
-    private:    // Constructors and destructors
-        MT_SysLangUtil();
-        void ConstructL();
-
-    private:    // New methods
-         void SetupL();        
-         void Teardown();        
-         void T_SysLangUtil_IsValidLanguageL();        
-         void T_SysLangUtil_GetDefaultLanguageL();        
-         void T_SysLangUtil_GetInstalledLanguagesL();        
-         void T_SysLangUtil_RestoreSIMLanguageL();
-        
-    private:    // Data		
-        EUNIT_DECLARE_TEST_TABLE;
-        
-        // Own: file server session
-        RFs iFs;
-    };
-
-#endif      //  __MT_SYSLANGUTIL_H__
--- a/sysstatemgmt/tsrc/public/basic/MT_SysLangUtil/MT_SysLangUtil_DllMain.cpp	Fri May 14 17:08:00 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  ?Description
-*
-*/
-
-
-//  CLASS HEADER
-#include "MT_SysLangUtil.h"
-
-//  EXTERNAL INCLUDES
-#include <CEUnitTestSuite.h>
-
-EXPORT_C MEUnitTest* CreateTestSuiteL()
-    {
-    return MT_SysLangUtil::NewL();
-    }
--- a/sysstatemgmt/tsrc/public/basic/bwins/mt_rstartersessionU.DEF	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/bwins/mt_rstartersessionU.DEF	Thu May 27 14:11:20 2010 +0300
@@ -1,2 +1,3 @@
 EXPORTS
-	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void)
+	?LibEntryL@@YAPAVMT_RStarterSession@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class MT_RStarterSession * LibEntryL(class CTestModuleIf &)
+
--- a/sysstatemgmt/tsrc/public/basic/eabi/mt_rstartersessionU.DEF	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/eabi/mt_rstartersessionU.DEF	Thu May 27 14:11:20 2010 +0300
@@ -1,3 +1,3 @@
 EXPORTS
-	_Z16CreateTestSuiteLv @ 1 NONAME
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
 
--- a/sysstatemgmt/tsrc/public/basic/group/bld.inf	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/group/bld.inf	Thu May 27 14:11:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2004-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"
@@ -11,19 +11,20 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Unit test code for RStarterSession class
 *
 */
-
-
 PRJ_PLATFORMS
     ARMV5 GCCE WINSCW
 
 PRJ_EXPORTS
 
+PRJ_TESTEXPORTS
+../init/mt_rstartersession.ini  /epoc32/winscw/c/testframework/mt_rstartersession.ini
+../rom/mt_rstartersession.iby     CORE_OS_LAYER_IBY_EXPORT_PATH( mt_rstartersession.iby )
+
 PRJ_MMPFILES
 
-
 PRJ_TESTMMPFILES
 mt_rstartersession.mmp
 
--- a/sysstatemgmt/tsrc/public/basic/group/mt_rstartersession.mmp	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/group/mt_rstartersession.mmp	Thu May 27 14:11:20 2010 +0300
@@ -11,33 +11,30 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Unit test code for RStarterSession class
 *
 */
 
-
 #include <platform_paths.hrh>
 
 TARGET          MT_RStarterSession.dll
 TARGETTYPE      dll
-UID             0x1000af5a 0x01700000
 
+UID             0x1000008D 0x101FB3E7
+VENDORID        VID_DEFAULT
 CAPABILITY      ALL -TCB
-VENDORID        VID_DEFAULT
 
 SOURCEPATH      ../mt_rstartersession
 SOURCE          MT_RStarterSession.cpp
-SOURCE          MT_RStarterSession_DllMain.cpp
 
 USERINCLUDE     ../mt_rstartersession
 
-SYSTEMINCLUDE    /epoc32/include/platform/digia/eunit
+OS_LAYER_SYSTEMINCLUDE
 
 OS_LAYER_SYSTEMINCLUDE
 
-LIBRARY         EUnit.lib
-LIBRARY         EUnitUtil.lib
 LIBRARY         euser.lib
+LIBRARY     	stiftestinterface.lib
 LIBRARY         StarterClient.lib
 
 SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/tsrc/public/basic/group/mt_rstartersession.pkg	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 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"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Unit test code for RStarterSession class
+;
+;Languages
+&EN
+
+#{"mt_rstartersession"},(0x101FB3A7),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"mt_rstartersession EN"}
+
+; Vendor name
+: "mt_rstartersession"
+
+"\epoc32\release\armv5\urel\MT_RStarterSession.dll" - "c:\sys\bin\MT_RStarterSession.dll"
+"..\init\MT_RStarterSession.ini"-"c:\testframework\MT_RStarterSession.ini"
+
--- a/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.cpp	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.cpp	Thu May 27 14:11:20 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:
+* Description:	Unit test code for RStarterSession class
 *
 */
 
@@ -20,30 +20,30 @@
 #include "MT_RStarterSession.h"
 
 //  EXTERNAL INCLUDES
-#include <EUnitMacros.h>
-#include <EUnitDecorators.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
 
 
 //  INTERNAL INCLUDES
 #include <starterclient.h>
 #include <starter.hrh>
 
-// CONSTRUCTION
-MT_RStarterSession* MT_RStarterSession::NewL()
+// ---------------------------------------------------------
+// MT_RStarterSession::LibEntryL
+// Returns: Poiter to MT_RStarterSession class
+// ---------------------------------------------------------
+EXPORT_C MT_RStarterSession* LibEntryL( CTestModuleIf& aTestModuleIf )
     {
-    MT_RStarterSession* self = MT_RStarterSession::NewLC();
-    CleanupStack::Pop();
-
-    return self;
+	RDebug::Printf("MT_RStarterSession* LibEntryL");
+    MT_RStarterSession* libEntry( MT_RStarterSession::NewL( aTestModuleIf ) );
+    return libEntry;
     }
 
-MT_RStarterSession* MT_RStarterSession::NewLC()
+// CONSTRUCTION
+MT_RStarterSession* MT_RStarterSession::NewL(CTestModuleIf& aTestModuleIf)
     {
-    MT_RStarterSession* self = new( ELeave ) MT_RStarterSession();
-    CleanupStack::PushL( self );
-
-    self->ConstructL();
-
+	  RDebug::Printf("MT_RStarterSession* NewL");
+    MT_RStarterSession* self = new ( ELeave ) MT_RStarterSession( aTestModuleIf );
     return self;
     }
 
@@ -54,28 +54,163 @@
     }
 
 // Default constructor
-MT_RStarterSession::MT_RStarterSession()
+MT_RStarterSession::MT_RStarterSession(CTestModuleIf& /*aTestModuleIf*/)
     {
     }
 
-// Second phase construct
-void MT_RStarterSession::ConstructL()
+// -----------------------------------------------------------------------------
+// MT_SysLangUtil::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+//
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo MT_RStarterSession::Case( const TInt aCaseNumber ) const
     {
-    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
-    // It generates the test case table.
-    CEUnitTestSuiteClass::ConstructL();
+
+    /**
+    * To add new test cases, implement new test case function and add new
+    * line to KCases array specify the name of the case and the function
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to
+    *    CenRepNotifyHandlerTest.cpp file and to CenRepNotifyHandlerTest.h
+    *    header file.
+    * 2) Add entry to following KCases array either by using FUNCENTRY or
+    *    ENTRY macro.
+    * ENTRY macro takes two parameters: test case name and test case
+    * function name.
+    * FUNCENTRY macro takes only test case function name as a parameter and uses
+    * that as a test case name and test case function name.
+    */
+	RDebug::Printf("MT_RStarterSession* case");
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array       
+        ENTRY( "1 [RStarterSession] Test ConectL", &MT_RStarterSession::T_RStarterSession_Connect ),
+        ENTRY( "2 [RStarterSession] Test SetState to Normal", &MT_RStarterSession::T_RStarterSession_SetStateToNormal),
+        ENTRY( "3 [RStarterSession] Test SetStateti Alarm", &MT_RStarterSession::T_RStarterSession_SetStateToAlarm),
+        ENTRY( "4 [RStarterSession] Test SetState to Charging", &MT_RStarterSession::T_RStarterSession_SetStateToCharging),
+        ENTRY( "5 [RStarterSession] Test SetState to OffLine", &MT_RStarterSession::T_RStarterSession_SetStateToOffLine),
+        ENTRY( "6 [RStarterSession] Test SetState to BTSap", &MT_RStarterSession::T_RStarterSession_SetStateToBTSap),
+        ENTRY( "7 [RStarterSession] Test ResetNetwork", &MT_RStarterSession::T_RStarterSession_ResetNetwork),       
+        ENTRY( "8 [RStarterSession] Test IsRTCTimeValid", &MT_RStarterSession::T_RStarterSession_IsRTCTimeValid),
+        ENTRY( "9 [RStarterSession] Test ActivateRfForEmergencyCall", &MT_RStarterSession::T_RStarterSession_ActivateRfForEmergencyCall ),
+        ENTRY( "10 [RStarterSession] Test DeactivateRfAfterEmergencyCall", &MT_RStarterSession::T_RStarterSession_DeactivateRfAfterEmergencyCall),
+        ENTRY( "11 [RStarterSession] Test EndSplashScreen", &MT_RStarterSession::T_RStarterSession_EndSplashScreen),
+        ENTRY( "12 [RStarterSession] Test Reset", &MT_RStarterSession::T_RStarterSession_Reset),
+        ENTRY( "13 [RStarterSession] Test Shutdown", &MT_RStarterSession:: T_RStarterSession_Shutdown)        
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        return null;
+        }
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[aCaseNumber].iCaseName );
+    tmp.iMethod = KCases[aCaseNumber].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+
+    return tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// MT_SysLangUtil::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation.
+// -----------------------------------------------------------------------------
+//
+TInt MT_RStarterSession::GetTestCasesL( const TFileName& /*aConfig*/,
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+	RDebug::Printf("MT_RStarterSession* gettestcase");
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo;
+
+        // PushL TTestCaseInfo to CleanupStack.
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended
+        // successfully the TTestCaseInfo object is owned (and freed)
+        // by the TestServer.
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// MT_SysLangUtil::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified
+// by aTestCase. Test cases that can be run may be requested from
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt MT_RStarterSession::RunTestCaseL( const TInt aCaseNumber,
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
     }
 
 //  METHODS
-
-
-void MT_RStarterSession::SetupEmptyL(  )
-    {
-    }
     
 void MT_RStarterSession::SetupL(  )
     {
-    iRStarterSession.Connect();
+    TInt err = iRStarterSession.Connect();
+    RDebug::Print(_L("MT_RStarterSession* SetupL Connected to RStarterSession with % error"),err);
     }
     
 void MT_RStarterSession::Teardown(  )
@@ -83,155 +218,195 @@
     iRStarterSession.Close();
     }
     
-void MT_RStarterSession::TeardownEmpty(  )
-    {
-    }
-    
-void MT_RStarterSession::T_RStarterSession_ConnectL(  )
+TInt MT_RStarterSession::T_RStarterSession_Connect( TTestResult& aResult )
     {
     RStarterSession session;
     TInt err = session.Connect();
     
-    EUNIT_PRINT( _L("Connect() err = %d"), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value");
-    
+    if ( err != KErrNone )
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_Connect" );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
     session.Close();
-    }
-    
-void MT_RStarterSession::T_RStarterSession_SetStateL(  )
-    {
-    // Perhaps test also other values...
-    TInt err = iRStarterSession.SetState( RStarterSession::ENormal );
-    EUNIT_PRINT( _L("SetState() err = %d"), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value");
-    }
-    
-void MT_RStarterSession::T_RStarterSession_ResetL(  )
-    {
-    // Perhaps test also other values...
-    iRStarterSession.Reset( (RStarterSession::TResetReason)-1 );
-    }
-    
-void MT_RStarterSession::T_RStarterSession_ShutdownL(  )
-    {
-    EUNIT_PRINT( _L("Calling Shutdown()") );
-    iRStarterSession.Shutdown( );
-    }
-    
-void MT_RStarterSession::T_RStarterSession_ResetNetworkL(  )
-    {
-    TInt err = iRStarterSession.ResetNetwork( );
-    EUNIT_PRINT( _L("ResetNetwork() err = %d"), err );
-    
-    EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value");
+    return err;
     }
     
-void MT_RStarterSession::T_RStarterSession_IsRTCTimeValidL(  )
-    {
-    TBool valid = iRStarterSession.IsRTCTimeValid();
-    EUNIT_PRINT( _L("IsRTCTimeValid() returned = %d"), valid );
-    }
-    
-void MT_RStarterSession::T_RStarterSession_ActivateRfForEmergencyCallL(  )
+TInt MT_RStarterSession::T_RStarterSession_SetStateToNormal( TTestResult& aResult )
     {
-    TInt err = iRStarterSession.ActivateRfForEmergencyCall( );
-    EUNIT_PRINT( _L("ActivateRfForEmergencyCall() err = %d"), err );
-    // Do not check the return value since in some cases it is normal that
-    // KErrGeneral(-2) is returned
-    //EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value" );
+    SetupL();
+    // State transition from Normal to normal
+    TInt err = iRStarterSession.SetState( RStarterSession::ENormal );
+    
+    if ( (err != KErrArgument) && (err != KErrGeneral) && (err != KErrNone)) 
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_SetStateToNormal " );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return KErrNone;
     }
+
+TInt MT_RStarterSession::T_RStarterSession_SetStateToAlarm( TTestResult& aResult )
+    {
+    SetupL();
+    // State transition from normal to Alarm 
+    TInt err = iRStarterSession.SetState( RStarterSession::EAlarm );
     
-void MT_RStarterSession::T_RStarterSession_DeactivateRfAfterEmergencyCallL(  )
+    if ( err != KErrNotSupported ) 
+        {
+        _LIT( KDescription, "Incorrect return value T_RStarterSession_SetStateToAlarm" );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return KErrNone;
+    }
+
+TInt MT_RStarterSession::T_RStarterSession_SetStateToCharging( TTestResult& aResult )
     {
-    TInt err = iRStarterSession.DeactivateRfAfterEmergencyCall( );
-    EUNIT_PRINT( _L("DeactivateRfAfterEmergencyCall() err = %d"), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value" );
+    SetupL();
+    // State transition from normal to ECharging
+    TInt err = iRStarterSession.SetState( RStarterSession::ECharging );
+    
+    if ( err != KErrNotSupported ) 
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_SetStateEToCharging " );	
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return KErrNone;
+    }
 
-    // Activate RF again
-    err = iRStarterSession.ActivateRfForEmergencyCall( );
-    EUNIT_PRINT( _L("ActivateRfForEmergencyCall() err = %d"), err );
-    // Do not check the return value since in some cases it is normal that
-    // KErrGeneral(-2) is returned
-    //EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value" );
+TInt MT_RStarterSession::T_RStarterSession_SetStateToOffLine( TTestResult& aResult )
+    {
+    SetupL();
+    // State transition from normal to EOffline
+    TInt err = iRStarterSession.SetState( RStarterSession::EOffline );
+    
+    if ( err != KErrNone ) 
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_SetStateTOOffLine " );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return err;
     }
-    
-void MT_RStarterSession::T_RStarterSession_EndSplashScreenL(  )
+
+TInt MT_RStarterSession::T_RStarterSession_SetStateToBTSap( TTestResult& aResult )
     {
-    TInt err = iRStarterSession.EndSplashScreen( );
-    EUNIT_PRINT( _L("EndSplashScreen() err = %d"), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "Incorrect return value" );
+    SetupL();
+    // State transition from ENormal to EBTSap
+    TInt err = iRStarterSession.SetState( RStarterSession::EBTSap );
+    
+    if ( err != KErrNone ) 
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_SetStateToBTSap " );	
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();    
+    return err;
     }
     
-//  TEST TABLE
-EUNIT_BEGIN_TEST_TABLE(
-    MT_RStarterSession,
-    "Add test suite description here.",
-    "UNIT" )
-
-EUNIT_TEST(
-    "Connect - test0",
-    "RStarterSession",
-    "Connect - test0",
-    "FUNCTIONALITY",
-    SetupEmptyL, T_RStarterSession_ConnectL, TeardownEmpty)
+TInt MT_RStarterSession::T_RStarterSession_Reset( TTestResult& aResult )
+    {
+    SetupL();
+    // Other values will be tested in BAT testing (Manual testing)...
+    iRStarterSession.Reset( (RStarterSession::TResetReason)-1 );
+    // Make request and ignore return value
+    _LIT( KDescription, "T_RStarterSession_Reset - Calling Reset()" );
+    aResult.SetResult( KErrNone, KDescription );
+    Teardown();
+    return KErrNone;
+    }
     
-EUNIT_TEST(
-    "SetState - test1",
-    "RStarterSession",
-    "SetState - test1",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_SetStateL, Teardown)
+TInt MT_RStarterSession::T_RStarterSession_Shutdown(TTestResult& aResult  )
+    {
+    SetupL();
+    iRStarterSession.Shutdown( );
+    _LIT( KDescription, "T_RStarterSession_Shutdown - Calling Shutdown()" );
+    aResult.SetResult( KErrNone, KDescription );
+    Teardown();
+    return KErrNone;
+    }
     
-EUNIT_TEST(
-    "Reset - test2",
-    "RStarterSession",
-    "Reset - test2",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_ResetL, Teardown)
-    
-EUNIT_TEST(
-    "ResetNetwork - test4",
-    "RStarterSession",
-    "ResetNetwork - test4",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_ResetNetworkL, Teardown)
+TInt MT_RStarterSession::T_RStarterSession_ResetNetwork(TTestResult& aResult  )
+    {
+    SetupL();
+    TInt err = iRStarterSession.ResetNetwork( );   
+    if ( err != KErrNone )
+        {
+        _LIT( KDescription, "T_RStarterSession_ResetNetwork - Incorrect return value in " );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return err;
+    }
     
-EUNIT_TEST(
-    "IsRTCTimeValid - test5",
-    "RStarterSession",
-    "IsRTCTimeValid - test5",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_IsRTCTimeValidL, Teardown)
+TInt MT_RStarterSession::T_RStarterSession_IsRTCTimeValid(TTestResult& aResult  )
+    {
+    SetupL();
+    TBool valid = iRStarterSession.IsRTCTimeValid();
+    if ( !valid )
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_IsRTCTimeValid  " );
+        aResult.SetResult( valid, KDescription );
+        return valid;
+        }
+    Teardown();
+    return KErrNone;
+    }
     
-EUNIT_TEST(
-    "ActivateRfForEmergencyCall - test6",
-    "RStarterSession",
-    "ActivateRfForEmergencyCall - test6",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_ActivateRfForEmergencyCallL, Teardown)
+TInt MT_RStarterSession::T_RStarterSession_ActivateRfForEmergencyCall(TTestResult& aResult  )
+    {
+    SetupL();
+    TInt err = iRStarterSession.ActivateRfForEmergencyCall( );
+
+    if (( err != KErrNone) && (err != KErrGeneral))
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_ActivateRfForEmergencyCall" );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return err;
+    }
     
-EUNIT_TEST(
-    "DeactivateRfAfterEmergencyCall - test7",
-    "RStarterSession",
-    "DeactivateRfAfterEmergencyCall - test7",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_DeactivateRfAfterEmergencyCallL, Teardown)
+TInt MT_RStarterSession::T_RStarterSession_DeactivateRfAfterEmergencyCall( TTestResult& aResult )
+    {
+    SetupL();
+    TInt err = iRStarterSession.DeactivateRfAfterEmergencyCall( );
     
-EUNIT_TEST(
-    "EndSplashScreen - test8",
-    "RStarterSession",
-    "EndSplashScreen - test8",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_EndSplashScreenL, Teardown)
+    if (( err != KErrNone) && (err != KErrGeneral))
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_DeactivateRfAfterEmergencyCall" );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    // Activate RF again
+    err = iRStarterSession.ActivateRfForEmergencyCall( );
+    Teardown();
+    return err;
+    }
     
-/*    
-EUNIT_TEST(
-    "Shutdown - test3",
-    "RStarterSession",
-    "Shutdown - test3",
-    "FUNCTIONALITY",
-    SetupL, T_RStarterSession_ShutdownL, Teardown)*/
-    
-EUNIT_END_TEST_TABLE
+TInt MT_RStarterSession::T_RStarterSession_EndSplashScreen( TTestResult& aResult )
+    {
+    SetupL();
+    TInt err = iRStarterSession.EndSplashScreen( );
+    if ( err != KErrNone )
+        {
+        _LIT( KDescription, "Incorrect return value in T_RStarterSession_EndSplashScreen" );
+        aResult.SetResult( err, KDescription );
+        return err;
+        }
+    Teardown();
+    return err;
+    }
 
-//  END OF FILE
+//END OF FILE
--- a/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h	Fri May 14 17:08:00 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h	Thu May 27 14:11:20 2010 +0300
@@ -11,39 +11,50 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Unit test code for RStarterSession class
 *
 */
-
-
 #ifndef __MT_RSTARTERSESSION_H__
 #define __MT_RSTARTERSESSION_H__
 
+#if defined (_MSC_VER) && (_MSC_VER >= 1000)
+#pragma once
+#endif
+// Function pointer related internal definitions
+#ifndef __GCC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+
 //  EXTERNAL INCLUDES
-#include <CEUnitTestSuiteClass.h>
-#include <EUnitDecorators.h>
-
+#include <stiftestmodule.h>
 
 //  INTERNAL INCLUDES
 #include <starterclient.h>
 
-//  FORWARD DECLARATIONS
-
-
+// FORWARD DECLARATIONS
+class TCaseInfo;
+class MT_RStarterSession;
+// DESCRIPTION
+// This a Test Module interface template
+// that does not really do anything.
+typedef TInt ( MT_RStarterSession::*TestFunction )( TTestResult& );
 //  CLASS DEFINITION
 /**
  *
  */
 NONSHARABLE_CLASS( MT_RStarterSession )
-	: public CEUnitTestSuiteClass
+	: public CTestModuleBase
     {
     public:     // Constructors and destructors
 
         /**
          * Two phase construction
          */
-        static MT_RStarterSession* NewL();
-        static MT_RStarterSession* NewLC();
+        static MT_RStarterSession* NewL(CTestModuleIf& aTestModuleIf);
         /**
          * Destructor
          */
@@ -51,31 +62,85 @@
 
     private:    // Constructors and destructors
 
-        MT_RStarterSession();
-        void ConstructL();
+        MT_RStarterSession( CTestModuleIf& aTestModuleIf );
+        
+        /**
+        * Function returning test case name and pointer to test case function
+        */
+        const TCaseInfo Case( const TInt aCaseNumber ) const;
+
+   	public: // Functions from base classes
 
+        // @see CTestModuleBase
+        virtual TInt GetTestCasesL( const TFileName& aTestCaseFile,
+        RPointerArray<TTestCaseInfo>& aTestCases );
+
+        // @see CTestModuleBase
+        virtual TInt RunTestCaseL( const TInt aCaseNumber,
+        const TFileName& aTestCaseFile,
+		TTestResult& aResult );
+            
     private:    // New methods
 
         void SetupL();
-        void SetupEmptyL();
         void Teardown();
-        void TeardownEmpty();
 
-        void T_RStarterSession_ConnectL();
-        void T_RStarterSession_SetStateL();
-        void T_RStarterSession_ResetL();
-        void T_RStarterSession_ShutdownL();
-        void T_RStarterSession_ResetNetworkL();
-        void T_RStarterSession_IsRTCTimeValidL();
-        void T_RStarterSession_ActivateRfForEmergencyCallL();
-        void T_RStarterSession_DeactivateRfAfterEmergencyCallL();
-        void T_RStarterSession_EndSplashScreenL();
+        TInt T_RStarterSession_Connect(TTestResult& aResult);
+        TInt T_RStarterSession_SetState(TTestResult& aResult);
+        TInt T_RStarterSession_SetStateToNormal(TTestResult& aResult);
+        TInt T_RStarterSession_SetStateToAlarm(TTestResult& aResult);
+        TInt T_RStarterSession_SetStateToCharging(TTestResult& aResult);
+        TInt T_RStarterSession_SetStateToOffLine(TTestResult& aResult);
+        TInt T_RStarterSession_SetStateToBTSap(TTestResult& aResult);
+        TInt T_RStarterSession_Reset(TTestResult& aResult);
+        TInt T_RStarterSession_Shutdown(TTestResult& aResult);
+        TInt T_RStarterSession_ResetNetwork(TTestResult& aResult);
+        TInt T_RStarterSession_IsRTCTimeValid(TTestResult& aResult);
+        TInt T_RStarterSession_ActivateRfForEmergencyCall(TTestResult& aResult);
+        TInt T_RStarterSession_DeactivateRfAfterEmergencyCall(TTestResult& aResult);
+        TInt T_RStarterSession_EndSplashScreen(TTestResult& aResult);
 
     private:    // Data
-		
+		TestFunction    iMethod;
         RStarterSession iRStarterSession;
-        EUNIT_DECLARE_TEST_TABLE; 
+
+    };
+
+// Function pointer related internal definitions
+
+// Hack around known GCC bug.
+#ifndef __GCC32__
+    #define GETPTR
+#else
+    #define GETPTR &
+#endif
+
 
+// An internal structure containing a test case name and
+// the pointer to function doing the test
+class TCaseInfoInternal
+    {
+    public:
+        const TText* iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// An internal structure containing a test case name and
+// the pointer to function doing the test
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    TCaseInfo( const TText* a ) : iCaseName( ( TText* ) a )
+        {
+        };
     };
 
 #endif      //  __MT_RSTARTERSESSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/tsrc/public/basic/rom/mt_rstartersession.iby	Thu May 27 14:11:20 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Unit test code for RStarterSession class
+* Image description file for rstartersession test
+*
+*/
+
+#ifndef MT_RSTARTERSESSION_IBY
+#define MT_RSTARTERSESSION_IBY
+
+file=ABI_DIR\BUILD_DIR\MT_RStarterSession.dll SHARED_LIB_DIR\MT_RStarterSession.dll
+
+#endif // 	MT_RSTARTERSESSION_IBY
\ No newline at end of file