Revision: 201027
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 15:43:30 +0300
changeset 45 c6215323ad55
parent 44 2c28af138640
child 49 00076e39386f
child 53 22666f07682b
child 54 072a9626b290
Revision: 201027 Kit: 2010127
accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommandObserver.cpp
accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommsService.cpp
accessoryservices/accessoryserver/tsrc/public/basic/AccessoryTestControl/AccessoryTestControlPlugin/src/TfAccessoryTestControlPlugin.cpp
accessoryservices/autoaudioasy/inc/acc_debug.h
accessoryservices/autoaudioasy/inc/cautoaudioasymainservicebase.h
accessoryservices/autoaudioasy/inc/cautoaudioasypropertyobserver.h
accessoryservices/autoaudioasy/inc/cautoaudioasyservice.h
accessoryservices/autoaudioasy/inc/mautoaudioasypropertylistener.h
accessoryservices/autoaudioasy/rom/autoaudioasy.iby
accessoryservices/autoaudioasy/src/cautoaudioasymainservicebase.cpp
accessoryservices/autoaudioasy/src/cautoaudioasypropertyobserver.cpp
accessoryservices/autoaudioasy/src/cautoaudioasyservice.cpp
accessoryservices/pluggeddisplay/edidparser/bwins/edidparseru.def
accessoryservices/pluggeddisplay/edidparser/eabi/edidparseru.def
accessoryservices/pluggeddisplay/edidparser/inc/edidparserbase.h
accessoryservices/pluggeddisplay/edidparser/src/edidparserbase.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/edidhandler.h
accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/hdmicablestateconnected.h
accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/pdeconstants.h
accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/tvoutconfigforcomposite.h
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/compositecablestateconnected.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/tvoutconfigforcomposite.cpp
accessoryservices/remotecontrolfw/client/intermediate/src/interfaceselector.cpp
commonservices/PlatformEnv/rom/PlatformEnv.iby
commonservices/activitymanager/test/tef/group/te_activitymanagerteftests.pkg
commonservices/layers.sysdef.xml
commonservices/sysutil/layers.sysdef.xml
commonservices/sysutil/src/sysutil.cpp
commonservices/sysutil/test/tef/group/te_sysutilteftests.iby
commonservices/sysutil/test/tef/group/te_sysutilteftests.pkg
devicesrv_plat/autoaudio_plugin_api/inc/autoaudiopskeys.h
group/bld.inf
hwrmhaptics/hapticsclient/src/hwrmhapticsimpl.cpp
resourceinterfaces/group/bld.inf
resourceinterfaces/layers.sysdef.xml
resourcemgmt/hwresourcesmgr/power/inc/HWRMChargingStatusObserver.h
resourcemgmt/hwresourcesmgr/server/src/HWRMPowerCommonData.cpp
resourcemgmt/hwresourcesmgr/test/data/cenrep/10205043.txt
resourcemgmt/hwresourcesmgr/test/group/bld.inf
resourcemgmt/hwresourcesmgr/test/group/hwrm_rtests.pkg
resourcemgmt/hwresourcesmgr/test/group/te_hwrm.iby
resourcemgmt/hwresourcesmgr/test/group/te_hwrm.pkg
resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.cpp
resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.mmp
resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.cpp
resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.mmp
resourcemgmt/layers.sysdef.xml
resourcemgmt/powerandmemorynotificationservice/group/PwrCliTests.pkg
resourcemgmt/powerandmemorynotificationservice/group/t_pwrbasic.mmp
resourcemgmt/powerandmemorynotificationservice/group/t_pwroffevents.mmp
resourcemgmt/powerandmemorynotificationservice/group/t_shutdownserver.mmp
sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h
sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp
sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp
sysstatemgmt/layers.sysdef.xml
sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss
sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss
sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss
sysstatemgmt/systemstarter/test/tsysstart/group/sysstarttest.pkg
sysstatemgmt/systemstatemgr/ssm/src/ssmstatetransitionengine.cpp
sysstatemgmt/systemstatemgr/sus/src/ssmsuscli.cpp
sysstatemgmt/systemstatemgr/sus/src/susemergencycallrfadaptation.cpp
sysstatemgmt/systemstatemgr/sus/src/susstateadaptation.cpp
sysstatemgmt/systemstatemgr/test/tcle/group/ssmatest_tcle.pkg
sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_tcmd.pkg
sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp
sysstatemgmt/systemstatemgr/test/tcmn/group/ssmatest_tcmn.pkg
sysstatemgmt/systemstatemgr/test/testapps/group/ssmcletestapplication.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappgood.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappnorv.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppanic.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppaniczero.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprvafterretry.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprverror.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappslow.mmp
sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappsucessfulafterretry.mmp
sysstatemgmt/systemstatemgr/test/testapps/inc/ssmtestapps.h
sysstatemgmt/systemstatemgr/test/testapps/inc/ssmtestappsucessfulafterretry.h
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappgood.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappnorv.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppanic.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppaniczero.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprvafterretry.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprverror.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappslow.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry.cpp
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry.rss
sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry_reg.rss
sysstatemgmt/systemstatemgr/test/tipcfuzz/group/tipcfuzz.pkg
sysstatemgmt/systemstatemgr/test/tss/group/ssmatest_tss.pkg
sysstatemgmt/systemstatemgr/test/tss/src/tss_apptimeout.cpp
sysstatemgmt/systemstatemgr/test/tss/src/tss_procstartwithfandf.cpp
sysstatemgmt/systemstatemgr/test/tssm/group/ssmatest_tssm.pkg
sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_swptransitionengine.cpp
sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp
sysstatemgmt/systemstatemgr/test/tsus/group/ssmatest_tsus.pkg
sysstatemgmt/systemstateplugins/adptplugin/group/stateadaptationref.mmp
sysstatemgmt/systemstateplugins/adptplugin/inc/emergencycallrfadaptationref.h
sysstatemgmt/systemstateplugins/adptplugin/inc/miscadaptationref.h
sysstatemgmt/systemstateplugins/adptplugin/inc/rtcadaptationref.h
sysstatemgmt/systemstateplugins/adptplugin/inc/simadaptationref.h
sysstatemgmt/systemstateplugins/adptplugin/inc/stateadaptationref.h
sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp
sysstatemgmt/systemstateplugins/adptplugin/src/miscadaptationref.cpp
sysstatemgmt/systemstateplugins/adptplugin/src/rtcadaptationref.cpp
sysstatemgmt/systemstateplugins/adptplugin/src/simadaptationref.cpp
sysstatemgmt/systemstateplugins/adptplugin/src/stateadaptationref.cpp
sysstatemgmt/systemstateplugins/test/tappgsapolicy/resource/sspluginstest_tappgsapolicy.rss
sysstatemgmt/systemstateplugins/test/tcmncustomcmd/group/sspluginstest_tcmncustomcmd.pkg
sysstatemgmt/systemstateplugins/test/testapps/group/gsatestappgood.mmp
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/bld.inf
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/definetestps.iby
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/definetestps.mmp
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/sspluginstest_i_adaptation.iby
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/sspluginstest_i_tadaptation.pkg
sysstatemgmt/systemstateplugins/test/tintadptplugin/group/tiadaptation_plugin.mmp
sysstatemgmt/systemstateplugins/test/tintadptplugin/inc/definetestps.h
sysstatemgmt/systemstateplugins/test/tintadptplugin/inc/ti_adaptationplugin_stepbase.h
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/definetestps.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/definetestps_reg.rss
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/temergencycallrf_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/ti_adaptationplugin_stepbase.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tmisc_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/trtc_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tsim_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tstate_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tintconditionevaluator/group/sspluginstest_tintconditionevaluator.pkg
sysstatemgmt/systemstateplugins/test/tunitadptplugin/group/sspluginstest_tadaptation.pkg
sysstatemgmt/systemstateplugins/test/tunitadptplugin/group/tadaptation_plugin.mmp
sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/temergencycallrf_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tmisc_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tsim_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tstate_adaptationplugin_step.cpp
sysstatemgmt/systemstateplugins/test/tunitconditionevaluator/group/sspluginstest_tunitconditionevaluator.pkg
sysstatemgmt/systemstateplugins/test/tunitgsapolicy/group/sspluginstest_tgsa.pkg
sysstatemgmt/systemstateplugins/test/tunitgsapolicy/group/tgsa_server.mmp
sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_fail.cpp
sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_shutdown.cpp
sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_startup.cpp
sysstatemgmt/systemstateplugins/test/tunitutilityplugin/group/sspluginstest_tutility.pkg
sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp
sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h
sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp
sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdllref.cpp
sysstatemgmt/systemstatereferenceplugins/test/tclayer/group/ssrefpluginstest_tclayer.pkg
sysstatemgmt/systemstatereferenceplugins/test/tclayer/group/tclayer_server.mmp
sysstatemgmt/systemstatereferenceplugins/test/tclayer/scripts/ssrefpluginstest_clayer_ssmsimstatusobserver.script
sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsecurityeventobserver.cpp
sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsimstatusobserver.cpp
sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startersession.cpp
sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startupadaptationadapter.cpp
sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/definesecuritystateps.mmp
sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/ssrefpluginstest_tintcustcmd.pkg
sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/tcustomcmd_server.mmp
sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_devicesecuritypincheck.cpp
sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_simsecuritypincheck.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/defineemergencycallps.mmp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/definestartupps.mmp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/ssrefpluginstest_tuintcustcmd.pkg
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifier.rss
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifierplugin.mmp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/tunitcustcmd_server.mmp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/inc/testpinnotifierplugin.h
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_activaterfforemergencycall.script
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_deactivaterfforemergencycall.script
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_activaterfforemergencycall.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrfsactions.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformshutdownactions.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysselftest.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysstatechange.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_deactivaterfforemergencycall.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_devicesecuritycheck.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_execute.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_publishstartupmode.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_simsecuritycheck.cpp
sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/testpinnotifierplugin.cpp
systemhealthmanagement/layers.sysdef.xml
systemhealthmanagement/systemhealthmgr/test/trestartsys/group/shmatest_trestartsys.pkg
systemhealthmanagement/systemhealthmgr/test/tstartsafe/group/shmatest_tstartsafe.pkg
systemhealthmanagement/systemhealthmgr/test/tstartupproperties/group/shmatest_tstartupproperties.pkg
systemhealthmanagement/systemhealthmgr/test/tsysmon/data/tsysmon.ini
systemhealthmanagement/systemhealthmgr/test/tsysmon/group/shmatest_tsysmon.pkg
systemhealthmanagement/systemhealthmgr/test/tsysmon/src/tsysmon_stepcancelallmonitors.cpp
--- a/accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommandObserver.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommandObserver.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -181,25 +181,28 @@
     {
     COM_TRACE_( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel()" );
 
-    iAsyProxyCommsSrvc->iAsyComms.CancelNotifyProcessCommand();
-
-    if ( !iInDestructionPhase )
+    if ( iAsyProxyCommsSrvc )
         {
-        COM_TRACE_( "[AccFW:AsyProxy] Proxy Command Observation is Cancelled while Destruction is not in Progress" );
-    #ifdef _DEBUG
-        TRAPD( errUpdate, iAsyProxyCommsSrvc->UpdateAsyCommsStackL() );
-        TRAPD( errCreate, iAsyProxyCommsSrvc->CreateAsyCommandHandlerL( this ) );
+        iAsyProxyCommsSrvc->iAsyComms.CancelNotifyProcessCommand();
+    
+        if ( !iInDestructionPhase )
+            {
+            COM_TRACE_( "[AccFW:AsyProxy] Proxy Command Observation is Cancelled while Destruction is not in Progress" );
+        #ifdef _DEBUG
+            TRAPD( errUpdate, iAsyProxyCommsSrvc->UpdateAsyCommsStackL() );
+            TRAPD( errCreate, iAsyProxyCommsSrvc->CreateAsyCommandHandlerL( this ) );
+            
+            COM_TRACE_1( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel - errUpdate == %d", errUpdate );
+            COM_TRACE_1( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel - errCreate == %d", errCreate );
+        #else
+            TRAP_IGNORE( iAsyProxyCommsSrvc->UpdateAsyCommsStackL() );
+            TRAP_IGNORE( iAsyProxyCommsSrvc->CreateAsyCommandHandlerL( this ) );
+        #endif
+            }
         
-        COM_TRACE_1( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel - errUpdate == %d", errUpdate );
-        COM_TRACE_1( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel - errCreate == %d", errCreate );
-    #else
-        TRAP_IGNORE( iAsyProxyCommsSrvc->UpdateAsyCommsStackL() );
-        TRAP_IGNORE( iAsyProxyCommsSrvc->CreateAsyCommandHandlerL( this ) );
-    #endif
+        iAsyProxyCommsSrvc->Destroy( KErrNotFound ); // Transaction Id is not known know
         }
-    
-    iAsyProxyCommsSrvc->Destroy( KErrNotFound ); // Transaction Id is not known know
-
+        
     COM_TRACE_( "[AccFW:AsyProxy] CASYProxyCommandObserver::DoCancel - return void" );
     }
 
--- a/accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommsService.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/accessoryserver/src/ASYProxy/ASYProxyCommsService.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -99,7 +99,7 @@
     // Zero handler needs CASYProxyCommsStack just to get simple Active Object
     //  because CActiveScheduler will be start later in any way
 
-    CASYProxyCommandObserver* iZeroObserver = CASYProxyCommandObserver::NewL( NULL );
+    iZeroObserver = CASYProxyCommandObserver::NewL( NULL );
 
     COM_TRACE_( "[AccFW:AsyProxy] CASYProxyCommsService::ConstructL - return void" );
     }
@@ -148,7 +148,11 @@
         delete iAsyProxyCommsStack;
         iAsyProxyCommsStack = 0;
         }
-
+    if ( iZeroObserver )
+        {
+        delete iZeroObserver;
+        }
+    
     COM_TRACE_( "[AccFW:AsyProxy] CASYProxyCommsService::~CASYProxyCommsService" );
     }
 
--- a/accessoryservices/accessoryserver/tsrc/public/basic/AccessoryTestControl/AccessoryTestControlPlugin/src/TfAccessoryTestControlPlugin.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/accessoryserver/tsrc/public/basic/AccessoryTestControl/AccessoryTestControlPlugin/src/TfAccessoryTestControlPlugin.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -2644,14 +2644,14 @@
     {
     { ETFAccessorySingleConnection_Open,        0, 0, 0,     0,                         0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFAccessoryNotifyNewAccessoryConnected,  0, 0, 0,     0,                         0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 1000000},
-    { ETFConnectWiredAccessory,                 0, EUnidirectional, 0,     0,           0, 11401, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFConnectWiredAccessory,                 0, EAudioConnectionStatusUnidirectional, 0,     0,           0, 11401, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11401, ETFAsyNone,     ReqNotifyNewAccessoryConnected, KErrNone, 0},
     { ETFCheckCapability,                       0, 0, ETrue, KAccAudioOutputType,       0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFCheckCapability,                       0, 0, ETrue, KAccStereoAudio,           0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFCheckCapability,                       0, 0, ETrue, KAccIntegratedAudioOutput, 0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFCheckCapability,                       0, 0, ETrue, KAccRTPStreaming,          0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFAccessoryNotifyAccessoryDisconnected,  0, 0, 0,     0,                         0, 11401, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 2000000},
-    { ETFDisconnectWiredAccessory,              0, ENone, 0,     0,                     0, 11401, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFDisconnectWiredAccessory,              0, EAudioConnectionStatusNone, 0,     0,                     0, 11401, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11401, ETFAsyNone,     ReqNotifyAccessoryDisconnected, KErrNone, 0},
 
     { ETFClearStack,                            0, 0, 0,     0,                         0, 11401, ETFAsyNone,             ReqAccRequestNone,              KErrNone, 0},
@@ -2666,10 +2666,10 @@
     {
     { ETFAccessoryMode_Open,                 0, 0,         0, 0,          0, 11402, ETFAsyNone,          ReqAccRequestNone,             KErrNone, 1000000},
     { ETFAccessoryNotifyAccessoryModeChanged,0, 0,         0, 0,          0, 11402, ETFAsyNone,          ReqAccRequestNone,             KErrNone, 1000000},
-    { ETFConnectWiredAccessory,              0, EUnidirectional, 0, 0,    0, 11402, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFConnectWiredAccessory,              0, EAudioConnectionStatusUnidirectional, 0, 0,    0, 11402, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
     { ETFFindAndCheckRequest,                0, 3,         0, 0,          0, 11402, ETFAsyNone,          ReqNotifyAccessoryModeChanged, KErrNone, 1000000},
     { ETFClearStack,                         0, 0,         0, 0,          0, 11402, ETFAsyNone,          ReqAccRequestNone,             KErrNone, 1000000},
-    { ETFDisconnectWiredAccessory,           0, ENone, 0,     0,          0, 11402, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFDisconnectWiredAccessory,           0, EAudioConnectionStatusNone, 0,     0,          0, 11402, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
     { ETFAccessoryMode_Close,                0, 0,         0, 0,          0, 11402, ETFAsyNone,          ReqAccRequestNone,             KErrNone, 1000000},
     };
 
@@ -2680,9 +2680,9 @@
     {
     { ETFAccessorySingleConnection_Open,        0, 0, 0,     0,                         0, 11403, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFAccessoryNotifyNewAccessoryConnected,  0, 0, 0,     0,                         0, 11403, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 1000000},
-    { ETFConnectWiredAccessory,                 0, ENone, 0,     0,           0, 11403, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFConnectWiredAccessory,                 0, EAudioConnectionStatusNone, 0,     0,           0, 11403, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11403, ETFAsyNone,     ReqNotifyNewAccessoryConnected, KErrNone, 0},        
-    { ETFConnectWiredAccessory,                 0, EBidirectional, 0,     0,           0, 11403, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},            
+    { ETFConnectWiredAccessory,                 0, EAudioConnectionStatusBidirectional, 0,     0,           0, 11403, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},            
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11403, ETFAsyNone,     ReqNotifyNewAccessoryConnected, KErrNone, 0},
     { ETFCancelNotifyNewAccessoryConnected,     0, 0, 0,     0,                         0, 11403, ETFAsyNone,          ReqAccRequestNone,              KErrNone, 0},
 
@@ -2698,11 +2698,11 @@
     {
     { ETFAccessorySingleConnection_Open,        0, 0, 0,     0,                         0, 11404, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 0},
     { ETFAccessoryNotifyNewAccessoryConnected,  0, 0, 0,     0,                         0, 11404, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 1000000},
-    { ETFConnectWiredAccessory,                 0, EBidirectional, 0,     0,           0, 11404, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},            
-    { ETFConnectWiredAccessory,                 0, EUnidirectional, 0,     0,           0, 11404, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 3000000},        
+    { ETFConnectWiredAccessory,                 0, EAudioConnectionStatusBidirectional, 0,     0,           0, 11404, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 2000000},            
+    { ETFConnectWiredAccessory,                 0, EAudioConnectionStatusUnidirectional, 0,     0,           0, 11404, ETFAsyRTPStreamingConn, ReqAccRequestNone,              KErrNone, 3000000},        
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11404, ETFAsyNone,     ReqNotifyNewAccessoryConnected, KErrNone, 0},
     { ETFAccessoryNotifyAccessoryDisconnected,  0, 0, 0,     0,                         0, 11404, ETFAsyNone,     ReqAccRequestNone,              KErrNone, 2000000},
-    { ETFDisconnectWiredAccessory,              0, ENone, 0,     0,                     0, 11404, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
+    { ETFDisconnectWiredAccessory,              0, EAudioConnectionStatusNone, 0,     0,                     0, 11404, ETFAsyRTPStreamingConn,     ReqAccRequestNone,              KErrNone, 2000000},
     { ETFFindAndCheckRequest,                   0, 0, 0,     0,                         0, 11404, ETFAsyNone,     ReqNotifyAccessoryDisconnected, KErrNone, 0},
 
     { ETFClearStack,                            0, 0, 0,     0,                         0, 11404, ETFAsyNone,             ReqAccRequestNone,              KErrNone, 0},
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/inc/acc_debug.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,258 @@
+/*
+* 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:  Macro definitions for tracing and debugging purposes.
+*
+*/
+
+
+#ifndef ACC_DEBUG_H
+#define ACC_DEBUG_H
+
+#ifdef _DEBUG
+
+// INCLUDES
+#include <e32svr.h>
+
+// CONSTANTS
+_LIT( KComponent, "[AccFW:Component]" );
+_LIT( KThisFile,  "[AccFW:Component] - Trace this file: %s, line: %d, compiled: %s %s" );
+_LIT( KAssertion, "[AccFW:Component] - Assertion failed: File: %s, line: %d, compiled: %s %s" );
+_LIT( KPanic,     "[AccFW:Component] - Panic occurred: File: %s, line: %d, compiled: %s %s" );
+_LIT( KMystic,    "[AccFW:Component] - Mystic failure: File: %s, line: %d, compiled: %s %s" );
+_LIT8( KDATE, __DATE__ );
+_LIT8( KTIME, __TIME__ );
+
+const TInt KTraceMaxSize = 256;
+
+// DATA TYPES
+enum TTraceType
+    {
+    ETraceInit,
+    ETraceAssert,
+    ETracePanic
+    };
+
+// INLINE FUNCTIONS
+
+    // -----------------------------------------------------------------------------
+    // ThisFileFunc
+    // -----------------------------------------------------------------------------
+    inline void ThisFileFunc( const TDesC8& aFile,
+                              TInt aLine,
+                              TTraceType aType = ETraceInit )
+        {
+        HBufC* fileBuf = HBufC::New( aFile.Length() + 1 );
+        HBufC* dateBuf = HBufC::New( 32 );
+        HBufC* timeBuf = HBufC::New( 32 );
+
+        if ( fileBuf != NULL && dateBuf != NULL && timeBuf != NULL )
+            {
+            fileBuf->Des().Copy( aFile );
+            timeBuf->Des().Copy( KTIME );
+            dateBuf->Des().Copy( KDATE );
+
+            if ( aType == ETraceInit )
+                {
+                RDebug::Print( KThisFile,
+                               fileBuf->Des().PtrZ(),
+                               aLine,
+                               dateBuf->Des().PtrZ(),
+                               timeBuf->Des().PtrZ() );
+                }
+
+            else if ( aType == ETraceAssert )
+                {
+                RDebug::Print( KAssertion,
+                               fileBuf->Des().PtrZ(),
+                               aLine,
+                               dateBuf->Des().PtrZ(),
+                               timeBuf->Des().PtrZ() );
+                }
+
+            else if ( aType == ETracePanic )
+                {
+                RDebug::Print( KPanic,
+                               fileBuf->Des().PtrZ(),
+                               aLine,
+                               dateBuf->Des().PtrZ(),
+                               timeBuf->Des().PtrZ() );
+                }
+
+            else
+                {
+                RDebug::Print( KMystic,
+                               fileBuf->Des().PtrZ(),
+                               aLine,
+                               dateBuf->Des().PtrZ(),
+                               timeBuf->Des().PtrZ() );
+                }
+            }
+
+        else
+            {
+            RDebug::Print( _L( "Assertion and memory allocation failed!" ) );
+            }
+
+        delete fileBuf;
+        delete dateBuf;
+        delete timeBuf;
+        }
+
+    // -----------------------------------------------------------------------------
+    // TraceAssertFunc
+    // -----------------------------------------------------------------------------
+    inline void TraceAssertFunc( const TDesC8& aFile, TInt aLine )
+        {
+        ThisFileFunc( aFile, aLine, ETraceAssert );
+        }
+
+    // -----------------------------------------------------------------------------
+    // TracePanicFunc
+    // -----------------------------------------------------------------------------
+    inline void TracePanicFunc( const TDesC8& aFile, TInt aLine )
+        {
+        ThisFileFunc( aFile, aLine, ETracePanic );
+        User::Panic( KComponent, KErrGeneral );
+        }
+
+// MACROS
+    #define PANIC_IF_FALSE( a ) if ( !( a ) )\
+            TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+    #define PANIC_IF_TRUE( a ) if ( ( a ) )\
+            TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+    #define PANIC_ALWAYS\
+            TracePanicFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+    // -----------------------------------------------------------------------------
+    // COMPONENT_TRACE_FLAG
+    // -----------------------------------------------------------------------------
+    #ifdef COMPONENT_TRACE_FLAG
+
+        #define COMPONENT_TRACE_THIS_FILE\
+            ThisFileFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+        #define COM_TRACE_( AAA ) do\
+            { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 )
+
+        #define COM_TRACE_1( AAA, BBB ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 )
+
+        #define COM_TRACE_2( AAA, BBB, CCC ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 )
+
+        #define COM_TRACE_3( AAA, BBB, CCC, DDD ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 )
+
+        #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 )
+
+        #define COM_TRACE_RAW_( AAA ) do\
+            { RDebug::RawPrint( AAA ); } while ( 0 )
+            
+        #define COM_TRACE_RAW_1( AAA, BBB ) do\
+             { _LIT( logStr, AAA ); TBuf<KTraceMaxSize> buffer; buffer.Append( logStr ); buffer.Append( BBB );\
+             RDebug::RawPrint( buffer ); } while ( 0 )
+        
+    #else
+
+        #define COMPONENT_TRACE_THIS_FILE
+
+        #define COM_TRACE_( AAA )
+        #define COM_TRACE_1( AAA, BBB )
+        #define COM_TRACE_2( AAA, BBB, CCC )
+        #define COM_TRACE_3( AAA, BBB, CCC, DDD )
+        #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+        #define COM_TRACE_RAW_( AAA )
+        #define COM_TRACE_RAW_1( AAA, BBB )
+
+    #endif // COMPONENT_TRACE_FLAG
+
+    #define TRACE_ASSERT( a ) if ( !( a ) )\
+            TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+    #define TRACE_ASSERT_RETURN( a ) if ( !( ( a ) == KErrNone ) )\
+            TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__), __LINE__ )
+
+    #define TRACE_ASSERT_ALWAYS\
+            TraceAssertFunc( TPtrC8( ( TText8* ) __FILE__ ), __LINE__ )
+
+    // -----------------------------------------------------------------------------
+    // API_TRACE_FLAG
+    // -----------------------------------------------------------------------------
+    #ifdef API_TRACE_FLAG
+
+        #define API_TRACE_( AAA ) do\
+            { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 )
+
+        #define API_TRACE_1( AAA, BBB ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 )
+
+        #define API_TRACE_2( AAA, BBB, CCC ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 )
+
+        #define API_TRACE_3( AAA, BBB, CCC, DDD ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 )
+
+        #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\
+             { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 )
+             
+        #define API_TRACE_RAW_1( AAA, BBB ) do\
+             { _LIT( logStr, AAA ); TBuf<KTraceMaxSize> buffer; buffer.Append( logStr ); buffer.Append( BBB );\
+             RDebug::RawPrint( buffer ); } while ( 0 )
+
+    #else
+
+        #define API_TRACE_( AAA )
+        #define API_TRACE_1( AAA, BBB )
+        #define API_TRACE_2( AAA, BBB, CCC )
+        #define API_TRACE_3( AAA, BBB, CCC, DDD )
+        #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+        #define API_TRACE_RAW_1( AAA, BBB )
+
+    #endif // API_TRACE_FLAG
+
+#else // _DEBUG
+
+    #define TRACE_ASSERT( a )
+    #define TRACE_ASSERT_RETURN( a ) a
+    #define TRACE_ASSERT_ALWAYS
+
+    #define COM_TRACE_( AAA )
+    #define COM_TRACE_1( AAA, BBB )
+    #define COM_TRACE_2( AAA, BBB, CCC )
+    #define COM_TRACE_3( AAA, BBB, CCC, DDD )
+    #define COM_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+    #define COM_TRACE_RAW_( AAA )
+    #define COM_TRACE_RAW_1( AAA, BBB )
+
+    #define API_TRACE_( AAA )
+    #define API_TRACE_1( AAA, BBB )
+    #define API_TRACE_2( AAA, BBB, CCC )
+    #define API_TRACE_3( AAA, BBB, CCC, DDD )
+    #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+    #define API_TRACE_RAW_1( AAA, BBB )
+
+    #define COMPONENT_TRACE_THIS_FILE
+
+    #define PANIC_IF_FALSE( a )
+    #define PANIC_IF_TRUE( a )
+    #define PANIC_ALWAYS
+
+#endif // _DEBUG
+
+#endif // ACC_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/inc/cautoaudioasymainservicebase.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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:  Header file for autoaudioasy main service
+*
+*/
+
+#ifndef CAUTOAUDIOASYMAINSERVICEBASE_H_
+#define CAUTOAUDIOASYMAINSERVICEBASE_H_
+
+#include <asymainservicebase.h>
+
+//Forward declarations
+class CAutoAudioAsyService;
+
+
+/**
+ *  Creates ASY main service
+ */
+NONSHARABLE_CLASS(CAutoAudioAsyMainServiceBase): public CASYMainServiceBase
+    {
+public:  // Constructors and destructor
+        
+    static CAutoAudioAsyMainServiceBase* NewL ();
+    virtual ~CAutoAudioAsyMainServiceBase ();
+
+public: // From CASYMainServiceBase
+                
+    TInt StartL();
+
+private: // Functions
+
+    CAutoAudioAsyMainServiceBase (); 
+    void ConstructL ();
+	
+	void InitPSAutoAudioL ();
+
+private: //Data
+
+    /**
+     * Handle to service class.
+     * Own.
+     */
+    CAutoAudioAsyService* iService;
+    };
+
+#endif // CAUTOAUDIOASYMAINSERVICEBASE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/inc/cautoaudioasypropertyobserver.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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:  Header file for property observer
+*
+*/
+#ifndef CAUTOAUDIOASYPROPERTYOBSERVER_H__
+#define CAUTOAUDIOASYPROPERTYOBSERVER_H__
+
+#include <e32base.h>
+#include <e32property.h>
+
+class MAutoAudioAsyPropertyListener;
+
+/**
+ * This class follows PS key (informs when RTP streaming is enabled or disabled).
+ */
+NONSHARABLE_CLASS(CAutoAudioAsyPropertyObserver): public CActive
+    {
+public:
+    /**
+     * Two-phase constructor
+     */
+    static CAutoAudioAsyPropertyObserver* NewL ( TUid aCategory, TUint aKey, MAutoAudioAsyPropertyListener& aListener ); 
+    virtual ~CAutoAudioAsyPropertyObserver ();
+
+protected:
+    // CActive
+    void DoCancel ();
+    void RunL ();
+    TInt RunError ( TInt aError );
+
+private:
+    CAutoAudioAsyPropertyObserver ( TUid aCategory, TUint aKey, MAutoAudioAsyPropertyListener& aListener );
+
+private:
+    /**
+     * Handle to P&S property.
+     * Own.
+     */
+    RProperty iProperty;
+
+    /**
+     * The UID of the property we are listening for
+     */
+    TUid iCategory;
+
+    /**
+     * The key we are listening for
+     */
+    TUint iKey;
+
+    /**
+     * Reference to listener class.
+     * Now own.
+     */
+    MAutoAudioAsyPropertyListener& iListener;
+    };
+
+#endif // CAUTOAUDIOASYPROPERTYOBSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/inc/cautoaudioasyservice.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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:  This class handles connect and disconnect to AccFw.
+*
+*/
+
+#ifndef C_AUTOAUDIOASYSERVICE_H__
+#define C_AUTOAUDIOASYSERVICE_H__
+
+#include <accessoryserver.h>
+#include <accessorycontrol.h>
+#include <accpolgenericid.h>
+#include <accpolgenericidarray.h>
+
+#include "mautoaudioasypropertylistener.h"
+
+class CAutoAudioAsyPropertyObserver;
+
+
+/**
+ * This class will notification for enabling/disabling RTP streaming channel
+   and handles connect and disconnect to AccFW.
+ */
+NONSHARABLE_CLASS(CAutoAudioAsyService): public CActive,
+										 public MAutoAudioAsyPropertyListener
+    {
+public:
+    /**
+     * Two-phased constructor
+     */
+    static CAutoAudioAsyService* NewL ();
+
+    virtual ~CAutoAudioAsyService ();    
+
+	/**
+    * Starts ASY service
+    */
+	void StartL ();
+	
+    /**
+     * Free resources on disconnect or on error
+     */
+    void FreeResources ();
+
+    /**
+     * @param aPS Handle to the property
+     * @param aUid The Uid of the property
+     * @param aKey The property key
+     * @param aStatus The property change status
+     * @return void
+     */
+    void PropertyChange ( RProperty& aPS, TUid aUid, TUint aKey, TInt aStatus );
+
+protected:
+
+    // CActive
+    void DoCancel ();
+    void RunL ();
+    TInt RunError ( TInt aError );
+
+private: //methods
+
+    CAutoAudioAsyService ();
+
+    void ConstructL ();
+    void ConnectAccessoryL ();
+    void AccessoryDisconnected ();
+
+private: //data
+    /**
+     * State of the service class.
+     */
+    enum TServiceState
+        {
+        EServiceStateIdle,
+        EServiceStateConnecting,
+        EServiceStateConnected
+        };
+
+    /**
+     * Handle to accessory server
+     * Own.
+     */
+    RAccessoryServer  iAccessoryServer;
+
+    /**
+     * Handle to accessory control
+     * Own.
+     */
+    RAccessoryControl iAccessoryControl;
+
+    /**
+     * Generic id header
+     */
+    TAccPolGIDHeader  iGenericIDHeader;
+
+    /**
+     * State of the service class
+     */
+    TServiceState iState;
+
+    /**
+     * Generic id
+     * Own.
+     */
+    CAccConGenericID* iGenericId;
+
+    /**
+     * Observer that receives notifications about RTP Channel
+     * Own.
+     */
+    CAutoAudioAsyPropertyObserver* iPropertyObserver;
+    };
+
+#endif // C_AUTOAUDIOASYSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/inc/mautoaudioasypropertylistener.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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:  Notify service class about property changes.
+*
+*/
+
+#ifndef MAUTOAUDIOASYPROPERTYLISTENER_H
+#define MAUTOAUDIOASYPROPERTYLISTENER_H
+
+#include <e32property.h>
+
+/**
+ * Methods needed to handle Publish & Subscribe property changes.
+ */
+class MAutoAudioAsyPropertyListener
+    {
+public:
+    /**
+     *
+     * @param aProperty Handle to the property
+     * @param aCategory The Uid of the property
+     * @param aKey The property key
+     * @param aStatus The property change status
+     * @return void
+     */
+    virtual void PropertyChange ( RProperty& aProperty, TUid aCategory,
+        TUint aKey, TInt aStatus ) = 0;
+    };
+
+#endif // MAUTOAUDIOASYPROPERTYLISTENER_H
--- a/accessoryservices/autoaudioasy/rom/autoaudioasy.iby	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/autoaudioasy/rom/autoaudioasy.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -1,13 +1,10 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
-* This material, including documentation and any related computer
-* programs, is protected by copyright controlled by Nokia. All
-* rights are reserved. Copying, including reproducing, storing
-* adapting or translating, any or all of this material requires the
-* prior written consent of Nokia. This material also contains
-* confidential information which may not be disclosed to others
-* without the prior written consent of Nokia.
+* 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.
@@ -18,6 +15,7 @@
 *
 */
 
+
 #ifndef AUTOAUDIOASY_IBY__
 #define AUTOAUDIOASY_IBY__
 
--- a/accessoryservices/autoaudioasy/src/cautoaudioasymainservicebase.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/autoaudioasy/src/cautoaudioasymainservicebase.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -95,7 +95,7 @@
         User::Leave ( ret );
 		}
 	
-	ret = RProperty::Set ( KPSUidAccessoryServices, KPSAutoKeyRTPStreamingConnectionStatus, ENone );
+	ret = RProperty::Set ( KPSUidAccessoryServices, KPSAutoKeyRTPStreamingConnectionStatus, EAudioConnectionStatusNone );
 	if ( ret != KErrNone )
 	    {
         COM_TRACE_1 ( "[AccFW:AutoAudioAsy] CAutoAudioAsyMainServiceBase::InitPSAutoAudioL RTP Streaming key init failed with %d", ret );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/accessoryservices/autoaudioasy/src/cautoaudioasypropertyobserver.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* 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:  Notify service class about connection state.
+*
+*/
+
+#include "cautoaudioasypropertyobserver.h" 
+#include "autoaudiopskeys.h"
+#include "mautoaudioasypropertylistener.h"
+
+#include "acc_debug.h"
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::NewL
+// ---------------------------------------------------------------------------
+CAutoAudioAsyPropertyObserver* CAutoAudioAsyPropertyObserver::NewL ( TUid aCategory, TUint aKey,
+        MAutoAudioAsyPropertyListener& aListener )
+	{
+    COM_TRACE_1 ( "[AccFW:AutoAudioAsy] CAutoAudioAsyPropertyObserver::NewL(), key- %d", aKey );
+    return new ( ELeave ) CAutoAudioAsyPropertyObserver ( aCategory, aKey, aListener );
+	}
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::CAutoAudioAsyPropertyObserver
+// ---------------------------------------------------------------------------
+CAutoAudioAsyPropertyObserver::CAutoAudioAsyPropertyObserver ( TUid aCategory, TUint aKey,
+        MAutoAudioAsyPropertyListener& aListener ):
+    CActive ( EPriorityStandard ),
+    iCategory ( aCategory ), iKey ( aKey ), iListener ( aListener )
+    {
+    CActiveScheduler::Add ( this );    
+    iProperty.Attach ( iCategory, iKey );
+    iProperty.Subscribe ( iStatus );
+    SetActive ();
+    }
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::~CAutoAudioAsyPropertyObserver
+// ---------------------------------------------------------------------------
+CAutoAudioAsyPropertyObserver::~CAutoAudioAsyPropertyObserver ()
+    {
+    COM_TRACE_ ( "[AccFW:AutoAudioAsy] CAutoAudioAsyPropertyObserver::~CAutoAudioAsyPropertyObserver");
+    Cancel ();
+    iProperty.Close ();
+    }
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::RunL
+// ---------------------------------------------------------------------------
+void CAutoAudioAsyPropertyObserver::RunL ()
+    {                      
+    COM_TRACE_ ( "AccFW:AutoAudioAsy] CAutoAudioAsyPropertyObserver::RunL");
+
+    TInt status = iStatus.Int ();
+    COM_TRACE_3 ( "[AccFW:AutoAudioAsy] key 0x%08x/%u changed, status %d", iCategory.iUid, iKey, status );
+    // Subscribe for the next change BEFORE invoking the listener to make sure
+    // that we never miss any property changes.
+    iProperty.Subscribe ( iStatus );
+    SetActive ();
+
+    // Notify the listener
+    iListener.PropertyChange ( iProperty, iCategory, iKey, status );
+    }
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::DoCancel
+// ---------------------------------------------------------------------------
+void CAutoAudioAsyPropertyObserver::DoCancel ()
+    {
+    COM_TRACE_ ( "[AccFW:AutoAudioAsy] CAutoAudioAsyPropertyObserver::DoCancel" );
+    iProperty.Cancel ();
+    }    
+
+// ---------------------------------------------------------------------------
+// CAutoAudioAsyPropertyObserver::RunError
+// ---------------------------------------------------------------------------
+TInt CAutoAudioAsyPropertyObserver::RunError ( TInt /* aError */ )
+	{
+    COM_TRACE_ ( "[AccFW:AutoAudioAsy] CAutoAudioAsyPropertyObserver::RunError" );
+    return KErrNone;
+	}
--- a/accessoryservices/autoaudioasy/src/cautoaudioasyservice.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/autoaudioasy/src/cautoaudioasyservice.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -102,7 +102,7 @@
         // Check if audio accessory has been connected
         if ( ( status == KErrNone ) && ( aStatus == KErrNone ) )
             {
-			if ( propValue == EUnidirectional ) // Current release supports only UniDirectional, so other key values ignored.
+			if ( propValue == EAudioConnectionStatusUnidirectional ) // Current release supports only UniDirectional, so other key values ignored.
 				{
 				TInt err;
 				switch ( iState )
--- a/accessoryservices/pluggeddisplay/edidparser/bwins/edidparseru.def	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/edidparser/bwins/edidparseru.def	Tue Jul 06 15:43:30 2010 +0300
@@ -55,4 +55,6 @@
 	?GetInterlacedVideoLatency@CCea861EdidParser@@QAEEXZ @ 54 NONAME ; unsigned char CCea861EdidParser::GetInterlacedVideoLatency(void)
 	?GetStandardTimings@CEdidParserBase@@QAEEH@Z @ 55 NONAME ; unsigned char CEdidParserBase::GetStandardTimings(int)
 	?HasIEEERegistration@CCea861EdidParser@@QAEHXZ @ 56 NONAME ; int CCea861EdidParser::HasIEEERegistration(void)
+	?UpdateCea861ExtensionL@CEdidParserBase@@QAEXHPAVCCea861EdidParser@@@Z @ 57 NONAME ; void CEdidParserBase::UpdateCea861ExtensionL(int, class CCea861EdidParser *)
+	?UpdateRawDataL@CEdidParserBase@@QAEXABVTDesC8@@@Z @ 58 NONAME ; void CEdidParserBase::UpdateRawDataL(class TDesC8 const &)
 
--- a/accessoryservices/pluggeddisplay/edidparser/eabi/edidparseru.def	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/edidparser/eabi/edidparseru.def	Tue Jul 06 15:43:30 2010 +0300
@@ -57,4 +57,6 @@
 	_ZTV17CCea861EdidParser @ 56 NONAME ; #<VT>#
 	_ZN15CEdidParserBase18GetStandardTimingsEi @ 57 NONAME
 	_ZN17CCea861EdidParser19HasIEEERegistrationEv @ 58 NONAME
+	_ZN15CEdidParserBase14UpdateRawDataLERK6TDesC8 @ 59 NONAME
+	_ZN15CEdidParserBase22UpdateCea861ExtensionLEiP17CCea861EdidParser @ 60 NONAME
 
--- a/accessoryservices/pluggeddisplay/edidparser/inc/edidparserbase.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/edidparser/inc/edidparserbase.h	Tue Jul 06 15:43:30 2010 +0300
@@ -378,6 +378,9 @@
      */
     IMPORT_C TUint8 GetChecksum();
 
+	IMPORT_C void UpdateRawDataL( const TDesC8& aBinaryData );
+	IMPORT_C void UpdateCea861ExtensionL( TInt aNumber, CCea861EdidParser* aParser );
+
 private:
 
     /**
@@ -558,6 +561,7 @@
      HBufC8*         iRawData;                  // Raw data that contains all EDID data
      TUint           iNumberOfExtensionBlocks;  // Number of extensionblocks for this base edid block
      TExtDataBlock   iExtensionData;            // Extension data
+     TInt            iRawdataLength;            // Raw data length
     };
 
 #endif // C_CEDIDPARSERBASE_H
--- a/accessoryservices/pluggeddisplay/edidparser/src/edidparserbase.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/edidparser/src/edidparserbase.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -52,8 +52,10 @@
 
     // Make a copy of base EDID data
     Mem::Copy( &iBaseEdidData, rawPtr.Ptr(), KEdidParserSizeOfEdidBlock );
-    
-    TRACE_EDID_DATA( *this );
+
+	iRawdataLength = aBinaryData.Length();
+	
+    //TRACE_EDID_DATA( *this );
     }
 
 // ---------------------------------------------------------------------------
@@ -761,6 +763,51 @@
     return parser;
     }
 
+EXPORT_C void CEdidParserBase::UpdateRawDataL( const TDesC8& aBinaryData )
+	{
+	FUNC_LOG;
+
+	if ( iRawData )
+		{
+		iRawData = iRawData->ReAllocL( iRawdataLength + aBinaryData.Length() );
+		
+		TPtr8 rawPtr = iRawData->Des();
+		rawPtr.Append( aBinaryData );		
+		}
+	else
+		{
+	    iRawData = HBufC8::NewL( aBinaryData.Length() );
+	    TPtr8 rawPtr = iRawData->Des();
+	    rawPtr.Copy( aBinaryData );
+		}	
+
+	iRawdataLength = iRawdataLength + aBinaryData.Length();
+	}
+
+EXPORT_C void CEdidParserBase::UpdateCea861ExtensionL( TInt aNumber, CCea861EdidParser* aParser )
+	{
+	FUNC_LOG;
+
+    TInt ext = GetExtensionType( aNumber );
+    switch( ext )
+        {
+        case ECea861Ext:
+            {
+            // CEA 861 extension
+			if( aParser )
+				{
+				aParser->ParseExtensionBlockL( iExtensionData );
+				}
+            break;
+            }
+        default:
+            {
+            // Not supported
+            break;
+            }
+        }
+	}
+
 // ---------------------------------------------------------------------------
 // CEdidParserBase::GetChecksum
 // ---------------------------------------------------------------------------
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/edidhandler.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/edidhandler.h	Tue Jul 06 15:43:30 2010 +0300
@@ -179,7 +179,7 @@
      * @param None.
      * @return None.
      */
-    void UpdateOverscanValues();
+    TBool UpdateOverscanValues();
     
 	void GetCurrentOverscanValue( TInt& aHOverscan, TInt& aVOverscan );
 
@@ -413,6 +413,12 @@
     
     // Request ID
     TRequestTypeID iRequestID;
+
+	// Number of extensions to read
+	TInt inbrOfExtensions;
+
+	// Current EDID block
+	TInt iCurrentBlock;
     };
 
 #endif // C_EDIDHANDLER_H
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/hdmicablestateconnected.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/hdmicablestateconnected.h	Tue Jul 06 15:43:30 2010 +0300
@@ -442,9 +442,6 @@
     //CCentralRepositoryWatch* iCRWatchForHOverScan;
     CCentralRepositoryWatch* iCRWatchForVOverScan;
 
-	// Flag to indicate the change of overscan
-	TBool iOverScanSettingsChanged;
-
     // Current overscan value
 	TInt iHOverscanValue;
 	TInt iVOverscanValue;
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/pdeconstants.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/pdeconstants.h	Tue Jul 06 15:43:30 2010 +0300
@@ -92,6 +92,7 @@
     // Central Repository interface's event ids    
     EPDEIfCentralRepositoryWatchEventUndefined = 0x50,
     EPDEIfCentralRepositoryWatchEventKeyChanged,
+	EPDEIfCentralRepositoryWatchEventOverscanKeyChanged,
     
     // ASY command Handler interface's event ids
     EPDEIfAsyCommandHandlerEventUndefined = 0x60,
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/tvoutconfigforcomposite.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/inc/tvoutconfigforcomposite.h	Tue Jul 06 15:43:30 2010 +0300
@@ -123,6 +123,8 @@
      */
     void Disable();
 
+	TBool UpdateOverscanValues();
+	
 private:
 
     /**
@@ -262,6 +264,12 @@
     // Time out reason and next opt after timer has 
     // elapsed
     TOpt iTimeOutReason;
+	
+    // Horizontal overscan in pixels (1% == 100)
+    TInt iHOverscan;
+
+    // Vertical overscan in pixels (1% == 100)
+    TInt iVOverscan;
     };
 
 #endif // TVOUTCONFIGFORCOMPOSITE_H
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/compositecablestateconnected.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/compositecablestateconnected.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -100,7 +100,8 @@
 void CCompositeCableStateConnected::Enter( )
     {
     FUNC_LOG;    
-    
+
+	iTVOutConfigForComposite.UpdateOverscanValues();
     ClearAvailableTvOutConfig();
     
     iTVOutConfigForSettingChanges->ListenSettingsChanges();
@@ -192,16 +193,24 @@
         TUint32 aId )
     {
     FUNC_LOG;
+	INFO("Cenrep Value Changed");
     if ( KCRUidTvoutSettings == aRepositoryId )
         {
         if (    ( KSettingsTvAspectRatio == aId ) ||
                 ( KSettingsTvoutFlickerFilter == aId  ) ||
-                ( KSettingsTvSystemInfo == aId ) ||
-                ( KSettingsTvoutVerticalOverscan == aId) )
+                ( KSettingsTvSystemInfo == aId ) )
             {
             Input( EPDEIfCentralRepositoryWatch, EPDEIfCentralRepositoryWatchEventKeyChanged );
             }
-        else
+        else if( KSettingsTvoutVerticalOverscan == aId )
+			{
+			if( iTVOutConfigForComposite.UpdateOverscanValues() )
+				{
+				INFO( "There is a real overscan change" );
+				Input( EPDEIfCentralRepositoryWatch, EPDEIfCentralRepositoryWatchEventOverscanKeyChanged );
+				}
+			}
+		else
             {
             INFO_1("Unexpected CR key ID, aId 0x%x", aId );            
             }       
@@ -375,12 +384,38 @@
 			iResettingInput = ETrue;
             Enter();
             }
+		else if ( EPDEIfCentralRepositoryWatchEventOverscanKeyChanged == aEvent )
+			{
+			INFO( "Event: EPDEIfCentralRepositoryWatchEventOverscanKeyChanged" );
+			iTVOutConfigForComposite.SetConfig( ETrue );
+			}
         else
             {
             INFO_1( "Unknown Event Id: %i", aEvent );        
             }
         break;
         }       
+    case EPDEIfTVOutConfig:
+        {       
+        INFO( "Interface: EPDEIfTVOutConfig" );       
+		if ( EIfTVOutConfigEventSet == aEvent )
+			{
+			INFO( "Event: EIfTVOutConfigEventSet" );
+			// Stay on the same state
+			}
+		else if ( EIfTVOutConfigEventSetFailed == aEvent )
+			{
+			INFO( "Event: EIfTVOutConfigEventSetFailed" );
+            iCRWatchForFlickerFilter->Cancel();
+            iCRWatchForAspectRatio->Cancel();
+            iCRWatchForTvSystem->Cancel();
+			iCRWatchForVOverScan->Cancel();
+            ClearAvailableTvOutConfig();
+            iTVOutConfigForComposite.Disable();
+            iSubState = ESubStateDisabling;
+			}
+		break;
+		}
     default:
         {
         INFO_2( "Event from unexpected interface. if Id, event id: %i", aInterfaceId, aEvent );        
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -174,6 +174,9 @@
     iEdidParserPtr = NULL;
     delete iExtensionParserPtr;
     iExtensionParserPtr = NULL;
+
+	iCurrentBlock = 0;
+	inbrOfExtensions = 0;
     }
 
 //------------------------------------------------------------------------------
@@ -516,26 +519,81 @@
         {
         case EDdcReadRequest:
             {
-            if( KErrNone == iStatus.Int() )
-                {
-                TPtrC8
-                    dataBlockDes( iDataBlockPtr->iDataBlock, sizeof( *iDataBlockPtr ) );
-                iEdidParserPtr = CEdidParserBase::NewL( dataBlockDes );
-                TInt nbrOfExtensions = iEdidParserPtr->GetNumberOfExtensions();
-                for( TInt i = 0; i < nbrOfExtensions; ++i )
-                    {
-                    if( ECea861Ext == iEdidParserPtr->GetExtensionType( i + 1 ) )
-                        {
-                        INFO_1( "ECea861Ext extension data block number: %d", ( i+1 ) );
-                        iExtensionParserPtr
-                            = iEdidParserPtr->CreateCea861ExtensionParserL( i + 1 );
-                        break;
-                        }
-                    }
-                INFO_1( "Data block count in nbrOfExtensions: %d", nbrOfExtensions );
-                iFSM.Input( EPDEIfEDIDHandler, EPDEIfEDIDHandlerEventEdidDataFetched );
-                iRetryCounter = KErrNone;
-                }
+			if( KErrNone == iStatus.Int() )
+				{				
+				if( iCurrentBlock == 0 )
+					{
+					TPtrC8 dataBlockDes( iDataBlockPtr->iDataBlock, sizeof( *iDataBlockPtr ) );
+					
+					iEdidParserPtr = CEdidParserBase::NewL( dataBlockDes );
+					inbrOfExtensions = iEdidParserPtr->GetNumberOfExtensions();
+
+					INFO_1( "No. of extensions from Block 0: %d", inbrOfExtensions );
+
+					if( inbrOfExtensions )
+						{
+						inbrOfExtensions--;
+						}
+ 					}
+				else
+					{
+					TPtrC8 dataBlockDes( iDataBlockPtr->iDataBlock, sizeof( *iDataBlockPtr ) );
+
+					INFO_1( "Updating the Rawdata for the Block %d...", iCurrentBlock );
+					iEdidParserPtr->UpdateRawDataL(dataBlockDes);
+					
+					iCurrentBlock++;
+					if( inbrOfExtensions >= 2 )
+						{
+ 						inbrOfExtensions = inbrOfExtensions - 2;
+						}
+					else
+						{
+						inbrOfExtensions--;
+						}
+  					}
+
+				if( inbrOfExtensions )
+					{
+					iRetryCounter = KErrNone;
+					
+					if( ReadEDIDDataL() != KErrNone )
+						{
+						ResetData();
+						iFSM.Input( EPDEIfEDIDHandler, EPDEIfEDIDHandlerEventEdidDataFetchFailed );
+						}
+					}
+				else
+					{
+					TInt extensions = iEdidParserPtr->GetNumberOfExtensions();
+
+					INFO_1( "No. of extensions from Block 0: %d", extensions );
+					
+					for( TInt i = 0; i < extensions; ++i )
+						{
+						if( ECea861Ext == iEdidParserPtr->GetExtensionType( i + 1 ) )
+							{
+							INFO_1( "ECea861Ext extension data block number: %d", ( i+1 ) );
+							if( !iExtensionParserPtr )
+								{
+								INFO( "First CEA 861 extension is being read..." );
+								iExtensionParserPtr
+									= iEdidParserPtr->CreateCea861ExtensionParserL( i + 1 );
+								}
+							else
+								{
+								INFO_1( "CEA 861 extension is being read... at the index %d", i+1 );
+								iEdidParserPtr->UpdateCea861ExtensionL( i + 1, iExtensionParserPtr );
+								}
+ 							}
+						}
+					}
+
+				TRACE_EDID_DATA( *iEdidParserPtr );
+				
+				iFSM.Input( EPDEIfEDIDHandler, EPDEIfEDIDHandlerEventEdidDataFetched );
+				iRetryCounter = KErrNone;
+				}
             else
                 {
                 INFO_1( "CDdcPortAccess::Read failed, error code: %d", iStatus.Int() );
@@ -622,8 +680,19 @@
         {
         iDataBlockPtr = new(ELeave) TDataBlock;
         }
+	else if( inbrOfExtensions )
+		{
+		if( iDataBlockPtr )
+			{
+			delete iDataBlockPtr;
+			iDataBlockPtr = NULL;
+			}
+		iDataBlockPtr = new(ELeave) TDataBlock;
+		}
+
+	INFO_1( "Reading EDID block %d...", iCurrentBlock );
     
-    retVal = iDdcPortAccess->Read( EMonitorPort, 0, // First block contains EDID data if that exists
+    retVal = iDdcPortAccess->Read( EMonitorPort, iCurrentBlock, // First block contains EDID data if that exists
         iDataBlockPtr->iDataBlock,
         iStatus );
         
@@ -1345,7 +1414,7 @@
 // CalculateOverscan
 //------------------------------------------------------------------------------
 //
-void CEDIDHandler::UpdateOverscanValues()
+TBool CEDIDHandler::UpdateOverscanValues()
     {
     FUNC_LOG;
 
@@ -1354,6 +1423,7 @@
     TInt vOverscan = 0;
     CRepository* cenRep = NULL;
     TInt err = KErrNone;
+	TBool valChanged = EFalse;
     
     TRAP( err, cenRep = CRepository::NewL( KCRUidTvoutSettings ) );
     if( err == KErrNone )
@@ -1376,12 +1446,19 @@
         // Cleanup
         delete cenRep;
         }
+
+	if( (iHOverscan != hOverscan) || (iVOverscan != vOverscan) )
+		{
+		valChanged = ETrue;
+		}
     
     // Update overscan values
     iHOverscan = hOverscan;
     iVOverscan = vOverscan;
 
-	INFO_2( "Overscan Values: %d,%d", iHOverscan, iVOverscan );
+	INFO_3( "Overscan Values: %d,%d Changed:%d", iHOverscan, iVOverscan, valChanged );
+
+	return valChanged;
     }
 
 // ----------------------------------------------------------------------------
@@ -1525,7 +1602,9 @@
     iFSM( aFSM ),
     iTVOutConfigForHDMI( aTVOutConfigForHDMI ),
     iRetryCounter( 0 ),
-    iRequestID( EUndefRequest )
+    iRequestID( EUndefRequest ),
+    inbrOfExtensions( 0 ),
+    iCurrentBlock( 0 )
     {
     FUNC_LOG;
     }
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -101,8 +101,11 @@
         if ( KSettingsTvoutVerticalOverscan == aId  )
             {            
 			INFO("Cenrep Value Changed");
-			iEDIDHandler.UpdateOverscanValues();
-            Input( EPDEIfCentralRepositoryWatch, EPDEIfCentralRepositoryWatchEventKeyChanged );
+			if( iEDIDHandler.UpdateOverscanValues() )
+				{
+				INFO( "There is a real change" );
+            	Input( EPDEIfCentralRepositoryWatch, EPDEIfCentralRepositoryWatchEventKeyChanged );
+				}
             }
         else
             {
@@ -153,8 +156,7 @@
     {
     FUNC_LOG;
     TInt retVal( KErrNone );
-	iOverScanSettingsChanged = EFalse;
-
+	
 	// Get the current overscan value
 	iEDIDHandler.UpdateOverscanValues();
 	iEDIDHandler.GetCurrentOverscanValue( iHOverscanValue, iVOverscanValue );
@@ -526,18 +528,11 @@
                 {
                 iSubState = ESubStateConnected;
 
-				if( !iOverScanSettingsChanged )
-					{
-	                TRAPD( err, iHDMICableStatusFSM.SettingsChangedL() );
-	                if ( KErrNone != err )
-	                    {
-	                    INFO_1( "iHDMICableStatusFSM.SettingsChangedL() failed, error code %i", err ); 
-	                    }
-					}
-				else
-					{
-					iOverScanSettingsChanged = EFalse;
-					}
+                TRAPD( err, iHDMICableStatusFSM.SettingsChangedL() );
+                if ( KErrNone != err )
+                    {
+                    INFO_1( "iHDMICableStatusFSM.SettingsChangedL() failed, error code %i", err ); 
+                    }
                 ListenCopyProtectionStatusChanges();
                 iTVOutConfigForSettingChanges->ListenSettingsChanges();
 				iCRWatchForVOverScan->Watch();
@@ -583,12 +578,14 @@
             INFO( "Event: EIfTVOutConfigEventDisabled" );
             iSubState = ESubStateIdlingDisconnectAccessory;
             iAccessoryControlIf.DisconnectAccessory();                    
+			ClearAvailableTvOutConfig();
             }
         else if ( EIfTVOutConfigEventDisableFailed == aEvent )
             {
             INFO( "Event: EIfTVOutConfigEventDisableFailed" );        
             iSubState = ESubStateIdlingDisconnectAccessory;
             iAccessoryControlIf.DisconnectAccessory();                    
+			ClearAvailableTvOutConfig();
             }
         else
             {
@@ -963,7 +960,7 @@
                 iTVOutConfigForHDMI.Enable();                
                 }
             }
-        else if ( EIfTVOutConfigEventSettingsChangesListenStarted )
+        else if ( EIfTVOutConfigEventSettingsChangesListenStarted == aEvent )
             {
             INFO( "Event: EIfTVOutConfigEventSettingsChangesListenStarted" );
             // Everything is OK. Stay in the same state.
@@ -1007,9 +1004,6 @@
 
 			if( (TTvSettings::EHDMI == curConfig.iConnector) && (!curConfig.iUnderscanEnabled) )
 				{									
-				// Clear the available config				
-				ClearAvailableTvOutConfig();
-				iCRWatchForVOverScan->Cancel();
 				
 				TInt retVal = iEDIDHandler.SetVideoParameters();
 				if ( KErrNone != retVal )
@@ -1017,7 +1011,8 @@
 					INFO( "Going to state <Rejected> since video parameter setting failed!" );		  
 					iTVOutConfigForSettingChanges->Cancel();
 					iCRWatchForVOverScan->Cancel();
-					iHDMICableStatusFSM.Transit( EHDMICableStateRejected ); 		
+					iSubState = ESubStateIdlingDisable;
+					iTVOutConfigForHDMI.Disable();			  
 					}
 				else
 					{
@@ -1030,12 +1025,8 @@
 						INFO( "Retreating back to <Idle> since cable was disconnected while not listening!" );		  
 						iTVOutConfigForSettingChanges->Cancel();
 						iCRWatchForVOverScan->Cancel();
-						iHDMICableStatusFSM.Transit( EHDMICableStateIdle ); 		
-						}
-					else
-						{
-						iOverScanSettingsChanged = ETrue;
-						iSubState = ESubStateWaitForSettingsChanged;
+						iSubState = ESubStateIdlingDisable;
+						iTVOutConfigForHDMI.Disable();			  
 						}
 					}				
 				}			
@@ -1116,24 +1107,8 @@
         else if ( EIfTVOutConfigEventSettingsChanged == aEvent )
             {
             INFO( "Event: EIfTVOutConfigEventSettingsChanged" );
-			if( iOverScanSettingsChanged )
-				{
-	            if ( iTVOutConfigForHDMI.GetTvOutConfig()->Enabled() )
-	                {
-	                iSubState = ESubStateResettingDisable;
-	                iTVOutConfigForHDMI.Disable();
-	                }
-	            else
-	                {
-	                iSubState = ESubStateResettingEnable;
-	                iTVOutConfigForHDMI.Enable();                
-	                }
-				}
-			else
-				{
-	            iSubState = ESubStateEnable;
-	            iTVOutConfigForHDMI.Enable();
-				}
+            iSubState = ESubStateEnable;
+            iTVOutConfigForHDMI.Enable();
             }
         else if ( EIfTVOutConfigEventSettingsChangesListenFailed == aEvent )
             {
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/tvoutconfigforcomposite.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/tvoutconfigforcomposite.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -189,6 +189,48 @@
     }
 
 // -----------------------------------------------------------------------------
+// CTVOutConfigForComposite::UpdateOverscanValues
+// -----------------------------------------------------------------------------
+//
+TBool CTVOutConfigForComposite::UpdateOverscanValues()
+    {
+    FUNC_LOG;
+
+    // Overscan from cenrep
+    TInt hOverscan = 0;
+    TInt vOverscan = 0;
+    TInt err = KErrNone;
+	TBool valChanged = EFalse;
+    
+    // Horizontal
+    err = iRepository->Get( KSettingsTvoutHorizontalOverscan, hOverscan );
+    if( err != KErrNone )
+        {
+        hOverscan = 0;
+        }
+    
+    // Vertical
+    err = iRepository->Get( KSettingsTvoutVerticalOverscan, vOverscan );
+    if( err != KErrNone )
+        {
+        vOverscan = 0;
+        }
+
+	if( (iHOverscan != hOverscan) || (iVOverscan != vOverscan) )
+		{
+		valChanged = ETrue;
+		}
+    
+    // Update overscan values
+    iHOverscan = hOverscan;
+    iVOverscan = vOverscan;
+
+	INFO_3( "Overscan Values: %d,%d Changed:%d", iHOverscan, iVOverscan, valChanged );
+
+	return valChanged;
+    }
+
+// -----------------------------------------------------------------------------
 // CTVOutConfigForComposite::InitializeDriverL
 // -----------------------------------------------------------------------------
 //
@@ -216,20 +258,9 @@
     ConvertFlickerFilter( value );
     settings.iFlickerFilter = ( TTvSettings::TFlickerFilterType ) value;
 
-    TInt hOverscan = 0;
-    TInt vOverscan = 0;
-    err = iRepository->Get( KSettingsTvoutHorizontalOverscan, hOverscan );
-    if( err != KErrNone )
-        {
-        hOverscan = 0;
-        }
-    err = iRepository->Get( KSettingsTvoutVerticalOverscan, vOverscan );
-    if( err != KErrNone )
-        {
-        vOverscan = 0;
-        }
-    settings.iHorizontalOverScan = hOverscan;
-    settings.iVerticalOverScan = vOverscan;
+	// Update overscan
+    settings.iHorizontalOverScan = iHOverscan;
+    settings.iVerticalOverScan = iVOverscan;
     
     // Update the PAR
     UpdatePixelAspectRatio( settings );
--- a/accessoryservices/remotecontrolfw/client/intermediate/src/interfaceselector.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/accessoryservices/remotecontrolfw/client/intermediate/src/interfaceselector.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -103,10 +103,11 @@
 		}
 	CleanupStack::PopAndDestroy(currentHeap);
 	
-	iLock = new (ELeave) RNestableLock();
-	CleanupStack::PushL(iLock);
-	LEAVEIFERRORL(iLock->CreateLocal());
-	CleanupStack::Pop(iLock);
+	RNestableLock* lock = new (ELeave) RNestableLock;
+    CleanupStack::PushL(lock);
+	LEAVEIFERRORL(lock->CreateLocal());
+	CleanupStack::Pop(lock);
+	iLock = lock;
 	}
 
 CRemConInterfaceSelector::CRemConInterfaceSelector()
@@ -441,15 +442,15 @@
 void CRemConInterfaceSelector::BulkSessionConnectL()
 	{
 	LOG_FUNC
-	iBulkSession = new(ELeave)RRemConBulk();
-	CleanupStack::PushL(iBulkSession);
-	LEAVEIFERRORL(iBulkSession->Connect());
-	CleanupStack::Pop(iBulkSession);
 
-	CleanupCloseDeleteAndNullPushL(reinterpret_cast<RRemCon**>(&iBulkSession));
+	RRemConBulk* bulkSession = new(ELeave)RRemConBulk;
+	CleanupStack::PushL(bulkSession);
+	LEAVEIFERRORL(bulkSession->Connect());
+	CleanupClosePushL(*bulkSession);
 	RCIS_VERBOSE_ASSERT(iBulkReceiver, ERemConIfSelInternalError);
-	iBulkReceiver->InitialiseL(*iBulkSession, iBulkMaxDataLength);
-	CleanupStack::Pop(&iBulkSession);
+	iBulkReceiver->InitialiseL(*bulkSession, iBulkMaxDataLength);
+	CleanupStack::Pop(2, bulkSession);
+	iBulkSession = bulkSession;
 	}
 
 /**
--- a/commonservices/PlatformEnv/rom/PlatformEnv.iby	Wed Jun 23 19:38:32 2010 +0300
+++ b/commonservices/PlatformEnv/rom/PlatformEnv.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002-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"
@@ -22,10 +22,12 @@
 file=ABI_DIR\BUILD_DIR\PlatformEnv.dll       SHARED_LIB_DIR\PlatformEnv.dll
 
 #ifdef FF_USE_MASS_STORAGE_CONFIG
-patchdata PlatformEnv.dll@KDriveInfoDefaultRemovableMassStorage 5 // EDriveF
-patchdata PlatformEnv.dll@KDriveInfoLogicallyRemovableDrive1 4 // EDriveE
+patchdata PlatformEnv.dll@KDriveInfoDefaultRemovableMassStorage FF_DEFAULT_REMOVABLE_MASS_STORAGE
+patchdata PlatformEnv.dll@KDriveInfoLogicallyRemovableDrive1 FF_LOGICALLY_REMOVABLE_DRIVE1
 #endif // FF_USE_MASS_STORAGE_CONFIG
 
+patchdata PlatformEnv.dll@KDriveInfoUsbDrivesStart FF_USB_DRIVE_START
+
 file=ABI_DIR\BUILD_DIR\disknotifyhandler.dll SHARED_LIB_DIR\disknotifyhandler.dll
 file=ABI_DIR\BUILD_DIR\sysversioninfo.dll    SHARED_LIB_DIR\sysversioninfo.dll
 file=ABI_DIR\BUILD_DIR\platformver.dll       SHARED_LIB_DIR\platformver.dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonservices/activitymanager/test/tef/group/te_activitymanagerteftests.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"activitymanagerteftests EN"}
+
+; Vendor name
+: "activitymanagerteftests"
+
+"\sf\os\devicesrv\commonservices\activitymanager\test\tef\group\te_activitymanagerteftests.script"-"c:\devicesrv\activitymanagertest\te_activitymanagerteftests.script"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonservices/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/commonservices" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="DeviceSrv_NCP">
+			<unit name="activitymanager" unitID="sos.activitymanager" bldFile="&layer_real_source_path;/activitymanager/group" mrp="&layer_real_source_path;/activitymanager/group/activitymanager.mrp"/>
+		</module>
+    </layer>
+	
+	<layer name="api_test_layer">
+		<module name="DeviceSrv_NCP">
+			<unit name="activitymanager" unitID="sos.activitymanager_test" bldFile="&layer_real_source_path;/activitymanager/group" mrp="&layer_real_source_path;/activitymanager/group/activitymanager.mrp"/>
+		</module>
+	</layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonservices/sysutil/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/commonservices/sysutil" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="sysutil" unitID="sos.sysutil" bldFile="&layer_real_source_path;/group" mrp="&layer_real_source_path;/group/sysutil.mrp"/>
+		</module>
+    </layer>
+	
+	<layer name="api_test_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="sysutil" unitID="sos.sysutil_test" bldFile="&layer_real_source_path;/group" mrp="&layer_real_source_path;/group/sysutil.mrp"/>
+		</module>
+	</layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- a/commonservices/sysutil/src/sysutil.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/commonservices/sysutil/src/sysutil.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -834,7 +834,7 @@
 	_LIT( KWildCardChar, "*" );
 	
 	RFs fs;
-	fs.Connect();
+	User::LeaveIfError( fs.Connect() );
 	CleanupClosePushL( fs );
 	
 	// Get the localised version of deviceattributes.ini, if available, and use
--- a/commonservices/sysutil/test/tef/group/te_sysutilteftests.iby	Wed Jun 23 19:38:32 2010 +0300
+++ b/commonservices/sysutil/test/tef/group/te_sysutilteftests.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -42,10 +42,10 @@
 
 #ifndef SYSUTIL_Z_DRIVE_FILES_PRESENT
 #define SYSUTIL_Z_DRIVE_FILES_PRESENT
-data = EPOCROOT##epoc32\data\z\resource\versions\lang.txt										\resource\versions\lang.txt
-data = EPOCROOT##epoc32\data\z\resource\versions\langsw.txt										\resource\versions\langsw.txt
-data = EPOCROOT##epoc32\data\z\resource\versions\sw.txt											\resource\versions\sw.txt
-data = EPOCROOT##epoc32\data\z\resource\versions\purpose.txt									\resource\versions\purpose.txt
+//data = EPOCROOT##epoc32\data\z\resource\versions\lang.txt										\resource\versions\lang.txt
+//data = EPOCROOT##epoc32\data\z\resource\versions\langsw.txt										\resource\versions\langsw.txt
+//data = EPOCROOT##epoc32\data\z\resource\versions\sw.txt											\resource\versions\sw.txt
+//data = EPOCROOT##epoc32\data\z\resource\versions\purpose.txt									\resource\versions\purpose.txt
 #endif
 
 data = EPOCROOT##epoc32\data\z\resource\versions\nocontent\lang.txt								\resource\versions\nocontent\lang.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonservices/sysutil/test/tef/group/te_sysutilteftests.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SysUtilTefTests EN"}
+
+; Vendor name
+: "SysUtilTefTests"
+
+"\sf\os\devicesrv\commonservices\sysutil\test\tef\group\te_sysutilteftests.script"-"c:\devicesrv\sysutiltest\te_sysutilteftests.script"
--- a/devicesrv_plat/autoaudio_plugin_api/inc/autoaudiopskeys.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/devicesrv_plat/autoaudio_plugin_api/inc/autoaudiopskeys.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,3 +1,20 @@
+/*
+* 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:  Provides P&S Key Defintions for Autoaudio ASY
+*
+*/
+
 #ifndef _AUTOAUDIO_PS_KEYS_
 #define _AUTOAUDIO_PS_KEYS_
 
@@ -14,9 +31,9 @@
 
 enum TPSAutoAudioConnectionStatus 
 {
-    ENone,	         // Notifies Accessory Disconnection
-    EUnidirectional, // application sound only
-    EBidirectional   // application sound + phone call
+    EAudioConnectionStatusNone,	         // Notifies Accessory Disconnection
+    EAudioConnectionStatusUnidirectional, // application sound only
+    EAudioConnectionStatusBidirectional   // application sound + phone call
 };
 
 
--- a/group/bld.inf	Wed Jun 23 19:38:32 2010 +0300
+++ b/group/bld.inf	Tue Jul 06 15:43:30 2010 +0300
@@ -32,6 +32,7 @@
 #include "../mediator/group/bld.inf"
 #include "../psmservices/group/bld.inf"
 #include "../resourcemgmt/group/bld.inf"
+#include "../resourceinterfaces/group/bld.inf"
 #include "../sysstatemgmt/group/bld.inf"
 #include "../systemhealthmanagement/systemhealthmgr/group/bld.inf"
 
--- a/hwrmhaptics/hapticsclient/src/hwrmhapticsimpl.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/hwrmhaptics/hapticsclient/src/hwrmhapticsimpl.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -427,20 +427,11 @@
 
         // send command to haptics server
         if ( KErrNone == err )
-            {
-            if( aDevicePropertyType == EHWRMHapticsLicensekey )
-                {
-                err = iClient.ExecuteOperation( 
+            {            
+            err = iClient.ExecuteOperation( 
                        EHWRMHapticsSetLicenseProp, 
-                       TIpcArgs( &iReqData, aDevicePropertyValue.Length() ) );
-                }
-            else
-                {
-                err = iClient.ExecuteOperation( EHWRMHaptics,  
-                                                TIpcArgs( &iReqData ) );
-                }
-            }
-         
+                       TIpcArgs( &iReqData, aDevicePropertyValue.Length() ) );                     
+	         }
         }
     
     API_TRACE( ( _L( "CHWRMHapticsImpl::SetDeviceProperty() - const TDesC8 overloaded - return %d" ), err ) );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourceinterfaces/group/bld.inf	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006-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:  
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+#include "../fmtransmittercontrol/group/bld.inf"
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourceinterfaces/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/resourceinterfaces" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="Hardware Interfaces">
+			<unit name="fmtransmittercontrol" unitID="sos.fmtransmittercontrol" bldFile="&layer_real_source_path;/fmtransmittercontrol/group" mrp="&layer_real_source_path;/fmtransmittercontrol/group/telephony_hwrmfmtx.mrp"/>
+		</module>
+    </layer>
+	
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- a/resourcemgmt/hwresourcesmgr/power/inc/HWRMChargingStatusObserver.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/power/inc/HWRMChargingStatusObserver.h	Tue Jul 06 15:43:30 2010 +0300
@@ -23,7 +23,8 @@
 
 /* Observer class for charging status change */
 
-class CHWRMChargingStatusObs: public MPsPropertyObserver
+class CHWRMChargingStatusObs: public CBase,
+                              public MPsPropertyObserver
     {
     public:
         static CHWRMChargingStatusObs* NewL(MHWRMBatteryChargingStatusObserver* aChargingStatusCallback);
--- a/resourcemgmt/hwresourcesmgr/server/src/HWRMPowerCommonData.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/server/src/HWRMPowerCommonData.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -166,10 +166,13 @@
     delete iPowerService;
     iPowerService = NULL;
     
-    iMaxReportingPeriodNotifyHandler->StopListening();
-    delete iMaxReportingPeriodNotifyHandler;
-    iMaxReportingPeriodNotifyHandler =  NULL;
-
+    if (iMaxReportingPeriodNotifyHandler)
+    	{
+	    iMaxReportingPeriodNotifyHandler->StopListening();
+	    delete iMaxReportingPeriodNotifyHandler;
+	    iMaxReportingPeriodNotifyHandler =  NULL;
+    	}
+    	
     delete iRepository;  
     iRepository = NULL;
     
Binary file resourcemgmt/hwresourcesmgr/test/data/cenrep/10205043.txt has changed
--- a/resourcemgmt/hwresourcesmgr/test/group/bld.inf	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/group/bld.inf	Tue Jul 06 15:43:30 2010 +0300
@@ -40,6 +40,7 @@
 ../data/cenrep/10200C8C.txt /epoc32/data/z/private/10202be9/10200c8c.txt
 ../data/cenrep/10200C8D.txt /epoc32/data/z/private/10202be9/10200c8d.txt
 ../data/cenrep/20008EA6.txt /epoc32/data/z/private/10202be9/20008ea6.txt
+../data/cenrep/10205043.txt /epoc32/data/z/private/10202be9/10205043.txt
 
 ../data/cenrep/10200C8B.txt /epoc32/release/winscw/udeb/z/private/10202be9/10200c8b.txt
 ../data/cenrep/10200C8C.txt /epoc32/release/winscw/udeb/z/private/10202be9/10200c8c.txt
@@ -98,5 +99,5 @@
 ../multiclient/mctest_b/mctest_b.mmp
 ../plugins/testuiplugin_f/group/hwrmtestuiplugin_f.mmp
 ../plugins/testuiplugin_b/group/hwrmtestuiplugin_b.mmp
-../multiclient/HWRMLightTestF/group/HWRMLightTestF.mmp
-../multiclient/HWRMLightTestB/group/HWRMLightTestB.mmp
+//../multiclient/HWRMLightTestF/group/HWRMLightTestF.mmp
+//../multiclient/HWRMLightTestB/group/HWRMLightTestB.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/hwresourcesmgr/test/group/hwrm_rtests.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,33 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Hwrm_rtests EN"}
+
+; Vendor name
+: "Hwrm_rtests"
+
+; RTest Cases
+"\epoc32\release\armv5\urel\hwrmtests.exe"-"c:\sys\bin\hwrmtests.exe"
+"\epoc32\release\armv5\urel\mctest_f.exe"-"c:\sys\bin\mctest_f.exe"
+
+
+
--- a/resourcemgmt/hwresourcesmgr/test/group/te_hwrm.iby	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/group/te_hwrm.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -20,6 +20,10 @@
 #include <hwresourcemanager.iby>
 //for test purposes, include symbian's FmTx and UI plugin
 #include <fmtx_hwrm.iby>
+// if the feature flag for FF_FMTX is undefined, include the dll here
+#ifndef FF_FMTX
+file=ABI_DIR\DEBUG_DIR\HWRMFmTxClient.dll 	 SYSTEM_BINDIR\HWRMFmTxClient.dll
+#endif //FF_FMTX
 #include <hwrmuiplugin.iby>
 
 #include <hwrmdefaultlighttargetmodifierplugin.iby>
@@ -53,10 +57,10 @@
 #endif
 
 // cenrep registration files
-#ifdef TEXT_ONLY_ROM
+//#ifdef TEXT_ONLY_ROM
 // This is required because the cenrep files are now being included only via techview_base.iby
 data=DATAZ_\private\10202BE9\10205043.txt   private\10202be9\10205043.txt
-#endif
+//#endif
 data=DATAZ_\private\10202BE9\10200C8B.txt 	private\10202be9\10200C8B.txt
 data=DATAZ_\private\10202BE9\10200C8C.txt 	private\10202be9\10200C8C.txt
 data=DATAZ_\private\10202BE9\10200C8D.txt 	private\10202be9\10200C8D.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/hwresourcesmgr/test/group/te_hwrm.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Te_Hwrm EN"}
+
+; Vendor name
+: "Te_Hwrm"
+
+"\sf\os\devicesrv\resourcemgmt\hwresourcesmgr\test\te_hwrm\te_hwrm.script"-"c:\devicesrv\hwrmtest\te_hwrm.script"
+"\sf\os\devicesrv\resourcemgmt\hwresourcesmgr\test\TestCapsHWRMPolicing\scripts\Cap_HWRM_API_Policing.script"-"c:\devicesrv\hwrmtest\Cap_HWRM_API_Policing.script"
--- a/resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -17,7 +17,7 @@
 #include <e32cons.h>
 
 _LIT(KDirectoryPath, "C:\\logs\\");
-_LIT(KLogFile,"C:\\logs\\hwrmtests.log");
+_LIT(KLogFile,"C:\\logs\\testexecute\\hwrmtests.htm");
 _LIT8(KCrLf,"\r\n");
 _LIT8(KRTest,"RTEST:");
 
--- a/resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/multiclient/hwrmtests/hwrmtests.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -13,7 +13,7 @@
 // Description:
 //
 
-TARGET          hwrmtests.exe
+TARGET          hwrmtests.exe //RTEST
 TARGETTYPE	    exe
 UID             0x102857BB 0x102857BB // 0
 VENDORID        0x70000001
--- a/resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -16,7 +16,7 @@
 #include "mctest_f.h"
 #include <e32cons.h>
 
-_LIT(KLogFile,"C:\\logs\\mctest_f.log");
+_LIT(KLogFile,"C:\\logs\\testexecute\\mctest_f.htm");
 _LIT8(KCrLf,"\r\n");
 _LIT8(KRTest,"RTEST:");
 
--- a/resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/hwresourcesmgr/test/multiclient/mctest_f/mctest_f.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -13,7 +13,7 @@
 // Description:
 //
 
-TARGET			mctest_f.exe
+TARGET			mctest_f.exe //RTEST
 TARGETTYPE		exe
 UID				0x102857BB	0x102857BB
 VENDORID        0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/resourcemgmt" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="DeviceSrv_NCP">
+			<unit name="hwresourcesmgr" unitID="sos.hwresourcesmgr" bldFile="&layer_real_source_path;/hwresourcesmgr/group" mrp="&layer_real_source_path;/hwresourcesmgr/group/telephony_hwrm.mrp"/>
+			<unit name="powerandmemorynotificationservice" unitID="sos.powerandmemorynotificationservice" bldFile="&layer_real_source_path;/powerandmemorynotificationservice/group" mrp="&layer_real_source_path;/powerandmemorynotificationservice/group/syslibs_pwrcli.mrp"/>
+		</module>
+    </layer>
+	
+	<layer name="clean_only_layer">
+		<module name="DeviceSrv_NCP">
+			<unit name="hwresourcesmgr" unitID="sos.hwresourcesmgr_clean" bldFile="&layer_real_source_path;/hwresourcesmgrconfig" mrp=""/>
+		</module>
+	</layer>
+	
+	<layer name="api_test_layer">
+		<module name="DeviceSrv_NCP">
+			<unit name="hwresourcesmgr" unitID="sos.hwresourcesmgr_test" bldFile="&layer_real_source_path;/hwresourcesmgr/test/group" mrp="&layer_real_source_path;/hwresourcesmgr/group/telephony_hwrm.mrp"/>
+			<unit name="powerandmemorynotificationservice" unitID="sos.powerandmemorynotificationservice_test" bldFile="&layer_real_source_path;/powerandmemorynotificationservice/group" mrp="&layer_real_source_path;/powerandmemorynotificationservice/group/syslibs_pwrcli.mrp"/>
+		</module>
+	</layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/powerandmemorynotificationservice/group/PwrCliTests.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,35 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"PwrCliTests EN"}
+
+; Vendor name
+: "PwrCliTests"
+
+; RTest Cases
+"\epoc32\release\armv5\urel\t_pwrbasic.exe"-"c:\sys\bin\t_pwrbasic.exe"
+"\epoc32\release\armv5\urel\t_pwroffevents.exe"-"c:\sys\bin\t_pwroffevents.exe"
+"\epoc32\release\armv5\urel\t_shutdownserver.exe"-"c:\sys\bin\t_shutdownserver.exe"
+
+
+
+
--- a/resourcemgmt/powerandmemorynotificationservice/group/t_pwrbasic.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/powerandmemorynotificationservice/group/t_pwrbasic.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -15,7 +15,7 @@
 // 
 //
 
-TARGET          t_pwrbasic.exe
+TARGET          t_pwrbasic.exe  //RTEST
 CAPABILITY      PowerMgmt
 TARGETTYPE      EXE
 
--- a/resourcemgmt/powerandmemorynotificationservice/group/t_pwroffevents.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/powerandmemorynotificationservice/group/t_pwroffevents.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -16,7 +16,7 @@
 // 
 //
 
-TARGET          t_pwroffevents.exe
+TARGET          t_pwroffevents.exe //RTEST
 // requires PowerMgmt because it is a unit test of the server code that will call the Power API which requires it
 // requires DiskAdmin because the test will make the server call RFs::FinaliseDrives() as part of power-off sequence
 CAPABILITY      PowerMgmt DiskAdmin 
--- a/resourcemgmt/powerandmemorynotificationservice/group/t_shutdownserver.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/resourcemgmt/powerandmemorynotificationservice/group/t_shutdownserver.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -15,7 +15,7 @@
 // 
 //
 
-TARGET          t_shutdownserver.exe
+TARGET          t_shutdownserver.exe //RTEST
 CAPABILITY      ProtServ PowerMgmt DiskAdmin 
 TARGETTYPE      EXE
 
--- a/sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h	Tue Jul 06 15:43:30 2010 +0300
@@ -71,6 +71,8 @@
         
         // @see CActive
         TInt RunError( TInt aError );
+	public:
+		void Start( );
         
     private: // Private data for base channel
     
--- a/sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -74,7 +74,10 @@
 	ret = iTimer.CreateLocal();
 	User::LeaveIfError( ret );
 	iTimerToHzLevel = aSetTimerToHzLevel;
-	TTimeIntervalMicroSeconds32 interval( KOneSecondInMicroSeconds / aSetTimerToHzLevel );
+	}
+void CTCSendEventTimer::Start()
+	{
+	TTimeIntervalMicroSeconds32 interval( KOneSecondInMicroSeconds / iTimerToHzLevel );
 		
 	if( !IsActive() )
 		{
--- a/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -355,6 +355,7 @@
     if( !iTimerToSend )
         {
         iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
+		iTimerToSend->Start();
         }
     else if( iHasChanged )
         {
@@ -363,6 +364,10 @@
         iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
         iHasChanged = EFalse;
         }
+	else
+		{
+		iTimerToSend->Start();
+		}
     }
 
 // ----------------------------------------------------------------------------------
@@ -375,8 +380,7 @@
     
     if( iTimerToSend )
         {
-        delete iTimerToSend;
-        iTimerToSend = NULL;
+		iTimerToSend->Cancel();
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/sysstatemgmt" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="systemstatemgr" unitID="sos.systemstatemgr" bldFile="&layer_real_source_path;/systemstatemgr/group" mrp="&layer_real_source_path;/systemstatemgr/group/app-framework_ssma.mrp"/>
+			<unit name="systemstateplugins" unitID="sos.systemstateplugins" bldFile="&layer_real_source_path;/systemstateplugins/group" mrp="&layer_real_source_path;/systemstateplugins/group/app-framework_ssplugins.mrp"/>
+			<unit name="systemstatereferenceplugins" unitID="sos.systemstatereferenceplugins" bldFile="&layer_real_source_path;/systemstatereferenceplugins/group" mrp="&layer_real_source_path;/systemstatereferenceplugins/group/app-framework_ssrefplugins.mrp"/>
+			<unit name="systemstarter" unitID="sos.systemstarter" bldFile="&layer_real_source_path;/systemstarter/group" mrp="&layer_real_source_path;/systemstarter/group/app-framework_sysstart.mrp"/>
+		</module>
+    </layer>
+	
+	<layer name="api_test_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="systemstatemgr" unitID="sos.systemstatemgr_test" bldFile="&layer_real_source_path;/systemstatemgr/group" mrp="&layer_real_source_path;/systemstatemgr/group/app-framework_ssma.mrp"/>
+			<unit name="systemstateplugins" unitID="sos.systemstateplugins_test" bldFile="&layer_real_source_path;/systemstateplugins/group" mrp="&layer_real_source_path;/systemstateplugins/group/app-framework_ssplugins.mrp"/>
+			<unit name="systemstatereferenceplugins" unitID="sos.systemstatereferenceplugins_test" bldFile="&layer_real_source_path;/systemstatereferenceplugins/group" mrp="&layer_real_source_path;/systemstatereferenceplugins/group/app-framework_ssrefplugins.mrp"/>
+			<unit name="systemstarter" unitID="sos.systemstarter_test" bldFile="&layer_real_source_path;/systemstarter/group" mrp="&layer_real_source_path;/systemstarter/group/app-framework_sysstart.mrp"/>
+		</module>
+	</layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- a/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -68,6 +68,7 @@
     {
     commands =
         {
+        r_cmd_waitidle, //CR:ETIN-86JCY2
         // prio 0xFFB7
 #ifdef __JAVA        
         r_cmd_javacaptain,
@@ -395,6 +396,33 @@
     }
 
 // ---------------------------------------------------------------------------
+// r_cmd_waitidle
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_waitidle
+    {
+    priority = 0xFFC5;
+    severity = ECmdCriticalSeverity;
+    dllname = "ssmsystemcmds.dll";
+    ordinal = 5; // WaitPsKeyExact
+    dll_data = r_dlldata_waitidle;
+    unload_on_finish = ENeverUnload;
+    retries = 2;
+    execution_behaviour = ESsmWaitForSignal;
+    }
+
+// ---------------------------------------------------------------------------
+// r_dlldata_waitidle
+// ---------------------------------------------------------------------------
+//
+RESOURCE CMD_PARAM_WAIT_PS r_dlldata_waitidle
+    {
+    category = 0x101F8766;  // KPSUidStartup
+    key = 0x00000043;       // KPSIdlePhase1Ok
+    target = 101;           // EIdlePhase1Ok
+    }
+
+// ---------------------------------------------------------------------------
 // r_cmd_watcher
 // ---------------------------------------------------------------------------
 //
--- a/sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -69,7 +69,7 @@
         r_cmd_publishstate, // prio 0xFFF1
         r_cmd_psstate,      // prio 0xFFF0
         // prio 0xFFE7
-        r_cmd_hbthemeserver,
+        r_cmd_idle,
 	    // prio 0xFFE6
         r_cmd_multiwaitforever1,
         // prio 0xFFE3
@@ -77,10 +77,6 @@
         r_cmd_phone,
         r_cmd_clockserver,
         r_cmd_multiwaitforever2,
-        // prio 0xFFDF
-        r_cmd_idle,
-        // prio 0xFFDE
-        r_cmd_multiwaitforever3,
         // prio 0xFFD8
         r_cmd_createswp_simstatus,
         // prio 0xFFD7
@@ -116,18 +112,7 @@
     key = 0x00000031; // KPSSimStatus
     filename = "ssm.swp.policy.simstatus.dll";
     }
-	
-// ---------------------------------------------------------------------------
-// r_cmd_hbthemeserver
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_PROCESS_INFO r_cmd_hbthemeserver
-    {
-    priority = 0xFFE7;
-    name = "z:\\sys\\bin\\hbthemeserver.exe";
-    execution_behaviour = ESsmDeferredWaitForSignal;
-    monitor_info = r_mon_100_restarts_reset;
-    }
+
     
 // ---------------------------------------------------------------------------
 // r_cmd_idle
@@ -135,7 +120,7 @@
 //
 RESOURCE SSM_START_APP_INFO r_cmd_idle
     {
-    priority = 0xFFDF;
+    priority = 0xFFE7;
     name = "z:\\sys\\bin\\hsapplication.exe";
     execution_behaviour = ESsmDeferredWaitForSignal;
     monitor_info = r_mon_max_restarts_ignore;
@@ -159,14 +144,6 @@
     priority = 0xFFE2;
     }
 
-// ---------------------------------------------------------------------------
-// r_cmd_multiwaitforever3
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_MULTIPLE_WAIT r_cmd_multiwaitforever3
-    {
-    priority = 0xFFDE;
-    }
 
 // ---------------------------------------------------------------------------
 // r_cmd_phone
--- a/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -93,6 +93,8 @@
         r_cmd_loaduilanguage,	// Observes changes in UI Language setting
         // prio 0xFF79
         r_cmd_aknstart,         // UI Framework
+        r_cmd_hbthemeserver,	//CR:KJLN-7WBEGU
+        r_cmd_devicedialog,     //CR:KJLN-7WBEGU   
         // prio 0xFF77
         r_cmd_apparc_init,      // Init application framework
         // prio 0xFF75
@@ -142,6 +144,29 @@
     }
 
 // ---------------------------------------------------------------------------
+// r_cmd_devicedialog
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_devicedialog
+    {
+    priority = 0xFF79;
+    severity = ECmdCriticalSeverity;             
+    name = "Z:\\sys\\bin\\hbdevicedialogappserver.exe";    
+    execution_behaviour = ESsmWaitForSignal;
+    }    
+
+// ---------------------------------------------------------------------------
+// r_cmd_hbthemeserver
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_hbthemeserver
+    {
+    priority = 0xFF79;
+    name = "z:\\sys\\bin\\hbthemeserver.exe";
+    execution_behaviour = ESsmWaitForSignal;
+    }
+
+// ---------------------------------------------------------------------------
 // r_cmd_initclkeys
 // ---------------------------------------------------------------------------
 //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstarter/test/tsysstart/group/sysstarttest.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SysStartTests EN"}
+
+; Vendor name
+: "SysStartTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstarter\test\tsysstart\scripts\appfwk_sysstart_test_ReRunSysStart.script"-"c:\devicesrv\sysstarttest\appfwk_sysstart_test_ReRunSysStart.script"
+
--- a/sysstatemgmt/systemstatemgr/ssm/src/ssmstatetransitionengine.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/ssm/src/ssmstatetransitionengine.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -533,7 +533,9 @@
 	{
 	iResolver.ReleasePolicyResolver();
 	delete iQueuedTransition;
+	iQueuedTransition = NULL;
 	delete iCurrentTransition;
+	iCurrentTransition = NULL;	
 	iCleSession.ReleaseCle();
 	}
 #endif
--- a/sysstatemgmt/systemstatemgr/sus/src/ssmsuscli.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/sus/src/ssmsuscli.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -109,7 +109,7 @@
  Usage pattern:
  @code
 	RSsmSusCli session;
-	session.Connect();
+	User::LeaveIfError(fs.Connect());
 	CleanupStackClosePushL(session);
 	TPckgC<TSsmSupInfo>* infoBuf = new (ELeave) TPckgC<TSsmSupInfo>(info);
 	session.RequestLoadSup(*infoBuf, status);
--- a/sysstatemgmt/systemstatemgr/sus/src/susemergencycallrfadaptation.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/sus/src/susemergencycallrfadaptation.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -278,8 +278,6 @@
 	DEBUGPRINT2A("CEmergencyCallRfAdaptationRequests processed the request with funtion id: %d", iCurrentMessage->Function());
 	iCurrentMessage->Complete(iStatus.Int());
 	DeleteAdaptationMessage();
-	iCurrentMessage = NULL;  
-
 	if( (iPendingEmergencyRequestsQueue.Count()) > 0 )
 		{
         CEmergencyAdaptationMessage *messageCopy = NULL;
@@ -295,7 +293,6 @@
 		{
         iCurrentMessage->Complete(aError);
 		DeleteAdaptationMessage();
-		iCurrentMessage = NULL;
 		}
 	
 	while( (iPendingEmergencyRequestsQueue.Count() > 0 ))
@@ -303,7 +300,6 @@
         Dequeue(iCurrentMessage);
         iCurrentMessage->Complete(aError);
         DeleteAdaptationMessage();
-        iCurrentMessage = NULL;
         }
 	
 	return KErrNone;
@@ -316,7 +312,6 @@
 		{
 		iCurrentMessage->Complete(KErrCancel);
 		DeleteAdaptationMessage();
-		iCurrentMessage = NULL;
 		}
 		
 	while( (iPendingEmergencyRequestsQueue.Count() > 0 ))
@@ -324,7 +319,6 @@
         Dequeue(iCurrentMessage);
         iCurrentMessage->Complete(KErrCancel);
         DeleteAdaptationMessage();
-        iCurrentMessage = NULL;
 		}
 	}
 
@@ -349,7 +343,8 @@
  */
 void CEmergencyCallRfAdaptation::DeleteAdaptationMessage()
     {
-    if(iCurrentMessage->IsMessageReserved())
+	//Do not delete iCurrentMessage if it is owned by iAdaptationReservedMessageArray.
+	if(iCurrentMessage->IsMessageReserved())
         {
         iCurrentMessage->UnsetMessageStatus(EMsgInUse);
         ++iReserveMsgCount;
@@ -357,7 +352,8 @@
     else
         {
         delete iCurrentMessage;
-        }    
+		}
+	iCurrentMessage = NULL;
     }
 
 void CEmergencyCallRfAdaptation::Dequeue(CEmergencyAdaptationMessage *&aCurrentMessage)
--- a/sysstatemgmt/systemstatemgr/sus/src/susstateadaptation.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/sus/src/susstateadaptation.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -172,7 +172,11 @@
 			DEBUGPRINT1A("CStateAdaptationRequests cancelling current request as requested");
 			iStateAdaptation.RequestCancel();
 			}
-		iPendingRequestsQueue.RemoveFromQueueAndComplete(aMessage);  	
+		iPendingRequestsQueue.RemoveFromQueueAndComplete(aMessage); 	
+		if(iPendingRequestsQueue.IsEmpty())
+		    {
+		    iPendingRequestsQueue.Close();
+		    }
 		aMessage.Complete(KErrNone);
 		}
 	else
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcle/group/ssmatest_tcle.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,36 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmCleTests EN"}
+
+; Vendor name
+: "SsmCleTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_rclesession.script"-"c:\devicesrv\ssmatest\ssmatest_cle_rclesession.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_pause.script"-"c:\devicesrv\ssmatest\ssmatest_cle_pause.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_dwfs_bad.script"-"c:\devicesrv\ssmatest\ssmatest_cle_dwfs_bad.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_dwfs_bad_norend.script"-"c:\devicesrv\ssmatest\ssmatest_cle_dwfs_bad_norend.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_dwfs_good.script"-"c:\devicesrv\ssmatest\ssmatest_cle_dwfs_good.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_fandf_bad.script"-"c:\devicesrv\ssmatest\ssmatest_cle_fandf_bad.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_fandf_good.script"-"c:\devicesrv\ssmatest\ssmatest_cle_fandf_good.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_wfs_bad.script"-"c:\devicesrv\ssmatest\ssmatest_cle_wfs_bad.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcle\scripts\ssmatest_cle_wfs_good.script"-"c:\devicesrv\ssmatest\ssmatest_cle_wfs_good.script"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_tcmd.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,46 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmCmdTests EN"}
+
+; Vendor name
+: "SsmCmdTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_resourcereader.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_resourcereader.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_amastarter.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_amastarter.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_commandlist.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_commandlist.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_customcommand.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_customcommand.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_finalisedrives.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_finalisedrives.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_loadsup.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_loadsup.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_persisthalattributes.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_persisthalattributes.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_poweroff.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_poweroff.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_publishswp.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_publishswp.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_publishsystemstate.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_publishsystemstate.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_reqswpchange.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_reqswpchange.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_multiplewait.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_multiplewait.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_startapp.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_amastarter.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_startprocess.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_startprocess.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_waitforapparcinit.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_waitforapparcinit.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_setpandskey.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_setpandskey.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_custcmd_neverunload.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_custcmd_neverunload.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_i_bics.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_i_bics.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmd\scripts\ssmatest_cmd_runcletest.script"-"c:\devicesrv\ssmatest\ssmatest_cmd_runcletest.script"
--- a/sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1880,6 +1880,7 @@
 	User::WaitForRequest(status);
 	TExitCategoryName category = thread.ExitCategory();
 	RDebug::Print(_L("***** Exit Category = %S *****"),&category);
+	INFO_PRINTF2(_L("***** Exit Category = %S *****"), &category);
 	TEST(category.Compare(KPanicCmdResourceReader) == 0); // always expecting a resource reader panic
 	const TInt exitReason = thread.ExitReason();
 	thread.Close();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcmn/group/ssmatest_tcmn.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,33 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmCmnTests EN"}
+
+; Vendor name
+: "SsmCmnTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmn\scripts\ssmatest_cmn_state.script"-"c:\devicesrv\ssmatest\ssmatest_cmn_state.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmn\scripts\ssmatest_cmn_swpvalue.script"-"c:\devicesrv\ssmatest\ssmatest_cmn_swpvalue.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmn\scripts\ssmatest_cmn_systemwideproperty.script"-"c:\devicesrv\ssmatest\ssmatest_cmn_systemwideproperty.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tcmn\scripts\ssmatest_cmn_stateawaresession.script"-"c:\devicesrv\ssmatest\ssmatest_cmn_stateawaresession.script"
+
+
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmcletestapplication.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmcletestapplication.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -31,7 +31,7 @@
 USERINCLUDE   	../../../localinc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappgood.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappgood.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -27,7 +27,8 @@
 USERINCLUDE   	../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappnorv.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappnorv.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -25,10 +25,11 @@
 
 USERINCLUDE   	.
 USERINCLUDE   	../inc
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppanic.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppanic.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -25,10 +25,11 @@
 
 USERINCLUDE   	.
 USERINCLUDE   	../inc
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     	euser.lib 
 LIBRARY			apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppaniczero.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapppaniczero.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -25,10 +25,11 @@
 
 USERINCLUDE   	.
 USERINCLUDE   	../inc
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     	euser.lib 
 LIBRARY			apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprvafterretry.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprvafterretry.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -26,7 +26,8 @@
 USERINCLUDE   	../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprverror.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestapprverror.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -25,10 +25,11 @@
 
 USERINCLUDE   	.
 USERINCLUDE   	../inc
-SYSTEMINCLUDE	/epoc32/include/techview
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
+MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY     	euser.lib 
 LIBRARY			apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappslow.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappslow.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -27,7 +27,8 @@
 USERINCLUDE   	../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappsucessfulafterretry.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/group/ssmtestappsucessfulafterretry.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -26,7 +26,8 @@
 USERINCLUDE   	../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
+
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
@@ -36,16 +37,7 @@
 LIBRARY		estor.lib
 LIBRARY		efsrv.lib 
 
-RESOURCE	 	ssmtestappsucessfulafterretry.rss
-START RESOURCE	ssmtestappsucessfulafterretry.rss
-TARGETPATH		/resource/apps
-END
 
-// Registration file
-SOURCEPATH    	../src
-START RESOURCE	ssmtestappsucessfulafterretry_reg.rss
-TARGETPATH		/private/10003a3f/apps
-END
 
 
 SMPSAFE
--- a/sysstatemgmt/systemstatemgr/test/testapps/inc/ssmtestapps.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/inc/ssmtestapps.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -46,6 +46,7 @@
 _LIT(KTestProcTranFromNormalWoCap, "ssmstatetranfromnormalwocap.exe");
 
 _LIT(KTestAppLogFileLoc, "C:\\logs\\ssmtest\\");
+_LIT(KFileForFAndF, "c:\\countforfnf.dat"); //This file is used by KTestAppForFAndF
 
 const TInt KTestCommandLineMaxLength = 200;
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/inc/ssmtestappsucessfulafterretry.h	Wed Jun 23 19:38:32 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __SSMTESTAPPSUCESSFULAFTERRETRY_H
-#define __SSMTESTAPPSUCESSFULAFTERRETRY_H
-
-#include <s32file.h>
-#include <f32file.h>
-
-_LIT(KFileForFAndF, "c:\\countforfnf.dat");	// this file should be deleted by the test application
-
-/**
-Application class
-*/
-#include <eikapp.h>
-
-class CTestFAndFApplication : public CEikApplication
-	{
-public:
-	static CApaApplication* NewApplication();
-	~CTestFAndFApplication();
-	
-private:
-CTestFAndFApplication();
-	
-	// from CApaApplication
-	TUid AppDllUid() const;
-	CApaDocument* CreateDocumentL();
-	};
-
-/**
-Document class
-*/
-#include <eikdoc.h>
-
-class CEikAppUi;
-class CEikApplication;
-class CTestFAndFDocument : public CEikDocument
-	{
-public:
-	static CTestFAndFDocument* NewL(CEikApplication& aApp);
-	~CTestFAndFDocument();
-	
-private:
-	CTestFAndFDocument(CEikApplication& aApp);
-	
-	// from CEikDocument
-	CEikAppUi* CreateAppUiL();
-	};
-
-/**
-Application UI class, root of all graphical user interface in this application
-*/
-#include <eikappui.h>
-
-class CTestAppAo;
-class CTestFAndFAppUi : public CEikAppUi
-    {
-public:
-	CTestFAndFAppUi();
-	~CTestFAndFAppUi();
-	
-	// from CEikAppUi
-	void ConstructL();
-	};
-
-#endif // __SSMTESTAPPSUCESSFILAFTERRETRY_H
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappgood.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappgood.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -22,8 +22,8 @@
 
 NAME STAG
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappnorv.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappnorv.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -22,8 +22,8 @@
 
 NAME STAN
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppanic.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppanic.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -22,8 +22,8 @@
 
 NAME STAP
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppaniczero.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapppaniczero.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -21,8 +21,8 @@
 
 NAME STAZ
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprvafterretry.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprvafterretry.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -21,8 +21,8 @@
 
 NAME STAR
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprverror.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestapprverror.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -21,8 +21,8 @@
 
 NAME STAE
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappslow.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappslow.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -21,8 +21,8 @@
 
 NAME STAS
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -19,107 +19,14 @@
  @internalComponent - Internal Symbian test code
 */
 
-#include <eikstart.h> 
-#include <eikapp.h>
-#include "ssmtestappsucessfulafterretry.h"
+#include <s32file.h>
+#include <f32file.h>
 #include "ssmtestapps.h"
 
-
-/**
-Standard DLL entry point function.
-Creates and returns an instance of the CApaApplication-derived class.
-@return an instance of the CApaApplication-derived class
-*/
-TInt E32Main()
-	{
-	return EikStart::RunApplication(CTestFAndFApplication::NewApplication);
-	}
-
-CTestFAndFApplication::CTestFAndFApplication()
-	{
-	}
-
-CTestFAndFApplication::~CTestFAndFApplication()
-	{
-	}
-		
-/**
-@return The application's UID 
-*/
-TUid CTestFAndFApplication::AppDllUid() const
-	{
-	const TUid dll = {KTestAppForFAndFUid};
-	return dll;
-	}
-
-/**
-@return CTestFAndFApplication or NULL if KErrNoMemory
-*/
-CApaApplication* CTestFAndFApplication::NewApplication()
-	{
-	// As the framework has at this point not started up enough, and therefore the TRAP-harness and 
-	// exception handlers aren’t available yet, this factory function is a non-leaving function and 
-	// can't use the new(Eleave) operator.
-	return new CTestFAndFApplication();
-	}
-	
-/**
-Called by the UI framework at application start-up to create an instance of the document class.
-@leave	KErrNoMemory
-@return A CTestFAndFDocument
-*/
-CApaDocument* CTestFAndFApplication::CreateDocumentL()
-	{
-	return CTestFAndFDocument::NewL(*this);
-	}
-
-CTestFAndFDocument::CTestFAndFDocument(CEikApplication& aApp) : CEikDocument(aApp)
-	{
-	}
-
-CTestFAndFDocument::~CTestFAndFDocument()
-	{
-	}
-
-/**
-Factory function for this class
-@return a new CEndTaskTestDocument instance.
-*/
-CTestFAndFDocument* CTestFAndFDocument::NewL(CEikApplication& aApp)
-	{
-	return new(ELeave) CTestFAndFDocument(aApp);
-	}
-
-
-
-/**
-Called by the UI framework to construct the application UI class. 
-Note that the app UI's ConstructL() is called by the UI framework.
-*/
-CEikAppUi* CTestFAndFDocument::CreateAppUiL()
-	{
-	return new(ELeave) CTestFAndFAppUi();
-	}
-
-
-
-CTestFAndFAppUi::CTestFAndFAppUi()
-	{
-	}
-
-
-
-CTestFAndFAppUi::~CTestFAndFAppUi()
-	{
-	}
-
-
-
-void CTestFAndFAppUi::ConstructL()
-	{
-	// Complete the UI framework's construction of the App UI.
-	BaseConstructL(CEikAppUi::ENoAppResourceFile);
-	
+// This exe fails to start for a specified number of times given in failCount, 
+// decrements the failCount each time and starts successfully once the fail count is exhausted
+static void StartProcessL()
+{
 	RFs fs;
 	RFileReadStream readStream;
 	RFileWriteStream writeStream;
@@ -159,6 +66,29 @@
 		RProcess::Rendezvous(KErrGeneral);
 		}
 	CleanupStack::PopAndDestroy(3, &fs);
+}
+
+/**
+Process entry point function.
+@return KErrNone if successful; KErrNoMemory if there is insufficient memory; otherwise, one of the other system-wide error codes.
+*/
+TInt E32Main()
+	{
+    CTrapCleanup* cleanup=CTrapCleanup::New();
+	
+	TInt error = KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(error, StartProcessL());
+		delete cleanup;
+		}
+
+	if (KErrNone != error)
+		{
+		User::Panic(_L("SUCCESSFULRETRY"),error);
+		}
+	User::WaitForAnyRequest();
+	return error;
 	}
 
 
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry.rss	Wed Jun 23 19:38:32 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-NAME FNDF
-
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-
--- a/sysstatemgmt/systemstatemgr/test/testapps/src/ssmtestappsucessfulafterretry_reg.rss	Wed Jun 23 19:38:32 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <appinfo.rh>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x20010332
-
-RESOURCE APP_REGISTRATION_INFO
-	{
-	// filename of application binary (minus extension)
-	app_file="ssmtestappsucessfulafterretry";
-	}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tipcfuzz/group/tipcfuzz.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmIpcFuzzTests EN"}
+
+; Vendor name
+: "SsmIpcFuzzTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tipcfuzz\scripts\tipcfuzz.script"-"c:\devicesrv\ssmatest\tipcfuzz.script"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tss/group/ssmatest_tss.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,38 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmTssTests EN"}
+
+; Vendor name
+: "SsmTssTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_appstart.script"-"c:\devicesrv\ssmatest\ssmatest_tss_appstart.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_appstartapparcinit.script"-"c:\devicesrv\ssmatest\ssmatest_tss_appstartapparcinit.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_apptimeout.script"-"c:\devicesrv\ssmatest\ssmatest_tss_apptimeout.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_procstart.script"-"c:\devicesrv\ssmatest\ssmatest_tss_procstart.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_procstartmon.script"-"c:\devicesrv\ssmatest\ssmatest_tss_procstartmon.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_errors.script"-"c:\devicesrv\ssmatest\ssmatest_tss_errors.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_appstartrverror.script"-"c:\devicesrv\ssmatest\ssmatest_tss_appstartrverror.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_startandcancel.script"-"c:\devicesrv\ssmatest\ssmatest_tss_startandcancel.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_appstartmultiple.script"-"c:\devicesrv\ssmatest\ssmatest_tss_appstartmultiple.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tss\scripts\ssmatest_tss_procstartwithfandf.script"-"c:\devicesrv\ssmatest\ssmatest_tss_procstartwithfandf.script"
+
--- a/sysstatemgmt/systemstatemgr/test/tss/src/tss_apptimeout.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tss/src/tss_apptimeout.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -26,7 +26,6 @@
 
 #include "tss_apptimeout.h"
 #include "ssmtestapps.h"
-#include "ssmtestappsucessfulafterretry.h"
 #include "ssmtestappslow.h"
 
 const TInt KWaitTime = 300;
--- a/sysstatemgmt/systemstatemgr/test/tss/src/tss_procstartwithfandf.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tss/src/tss_procstartwithfandf.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -24,8 +24,8 @@
 
 
 #include "tss_procstartwithfandf.h"
-#include "ssmtestappsucessfulafterretry.h"
 #include "ssmtestappslow.h"
+#include "ssmtestapps.h"
 
 const TInt KProcStartStopperTimeout = 5000000;
 const TInt KWaitTimeForTestAppForFAndF = 500;	// 500ms is the delay given for the KTestAppForFAndF test app for each retry.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tssm/group/ssmatest_tssm.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,50 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmTSsmTests EN"}
+
+; Vendor name
+: "SsmTSsmTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swptransitionengine.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swptransitionengine.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_platsec.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_platsec.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_paniccle.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_paniccle.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_server.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_server.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_statefurthertransition.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_statefurthertransition.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_conditionalcommands.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_conditionalcommands.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_ssmcledeadlock.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_ssmcledeadlock.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_repeatedpublishstate.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_repeatedpublishstate.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_statepolicyresolver.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_statepolicyresolver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_statetransitionengine.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_statetransitionengine.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swpcommonplugin.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swpcommonplugin.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swphandlecleret.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swphandlecleret.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swpdependencies.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swpdependencies.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swppolicymap.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swppolicymap.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swppolicyresolver.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swppolicyresolver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swptransitionscheduler.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swptransitionscheduler.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_swprequesthandler.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_swprequesthandler.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_validstatelist.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_validstatelist.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_validswplist.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_validswplist.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_notifypropertychange.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_notifypropertychange.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_rswppolicysess.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_rswppolicysess.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tssm\scripts\ssmatest_ssm_cmdexecution_oom.script"-"c:\devicesrv\ssmatest\ssmatest_ssm_cmdexecution_oom.script"
+
--- a/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_swptransitionengine.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_swptransitionengine.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -281,7 +281,9 @@
 	CleanupStack::PushL(cleSession);
 
 	// Define and set the rproperty
-	TEST(KErrNone == iProperty.Define(RProcess().SecureId(), KSwpTestKey1, RProperty::EInt));
+	TInt err = (iProperty.Define(RProcess().SecureId(), KSwpTestKey1, RProperty::EInt));
+	INFO_PRINTF2(_L("doTestRequestSimpleL :: Define KSwpTestKey1 returns : %d "), err);
+	TEST ((KErrNone == err) ||(KErrAlreadyExists == err));
 	TEST(KErrNone == iProperty.Set(RProcess().SecureId(), KSwpTestKey1, 0));
 
 	TInt value;
--- a/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,7 @@
  @internalComponent - Internal Symbian test code
 */
 
+#include <e32property.h>
 #include "ssmserverpanic.h"
 #include "ssmswppolicyframe.h"
 #include "ssmswppolicyresolver.h"
@@ -33,6 +34,8 @@
 
 
 const TInt KTestInvalidPanicCategory = -988;
+// property uids should be real uids (use these temporarily for test purposes)
+const TUint key={0x01};
 _LIT(KSsmSwpPolicyServerName, "TestSsmSwpPolicyServer");
 
 //----------------------------------------------------------------------------------------------------------------
@@ -65,7 +68,7 @@
 	User::SetJustInTime(EFalse);
 	thread.Resume();
 	User::WaitForRequest(status);
-
+	
 	// always expecting a state transition engine panic
 	TExitCategoryName category = thread.ExitCategory();
 	if (category.Compare(KPanicSysStateMgr) != 0)
@@ -101,9 +104,6 @@
 	CleanupStack::PushL(sched);
 	CActiveScheduler::Install(sched);
 
-	// property uids should be real uids (use these temporarily for test purposes)
-	const TUint key={0x01};
-
 	// Create a swp policy resolver and register our property
 	CSsmSwpPolicyResolver* resolver = CSsmSwpPolicyResolver::NewL();
 	CleanupStack::PushL(resolver);
@@ -129,6 +129,7 @@
 
 	//Request transition according to the reason action, which will define the invalid list
 	const TSsmSwp swp(key, aSsmValidSwpListTest->Function());
+	
 	handler->SubmitRequestL(swp);
 
 	sched->Start();
@@ -200,10 +201,12 @@
 
 	__UHEAP_MARK;
 
+	TInt err = RProperty::Define(RProcess().SecureId(), key, RProperty::EInt);
+	TEST(err == KErrNone || err == KErrAlreadyExists);
 	INFO_PRINTF1(_L("Checking cmd list without a Publish System Swp command"));
 	TInt exitReason(0);
 	SetFunction(ESwpCmdWithoutPublishSwp);
-	TRAPD(err, exitReason = StartSwpInvalidListInThreadL(this));
+	TRAP(err, exitReason = StartSwpInvalidListInThreadL(this));
 	TEST(err == KErrNone);
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	TEST(exitReason == ESwpTransitionEngineError16);
@@ -243,12 +246,13 @@
 	TEST(err == KErrNone);
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	const TInt threadExitReason = iThread.ExitReason();
+	TBuf<16> threadExitCategory = iThread.ExitCategory();
 	// This is the exit reason for the ssmswppolicyserver
 	TEST(threadExitReason == KSsmTestAppRvError);
 	// this is the exit reason for the engine.
 	TEST(exitReason == ESwpTransitionEngineError20);
 	iThread.Close();
-	INFO_PRINTF3(_L("    -- received panic '%d', expected was '%d'."), threadExitReason, KSsmTestAppRvError);
+	INFO_PRINTF4(_L("    -- received panic '%d', category '%S', expected was '%d'."), threadExitReason, &threadExitCategory, KSsmTestAppRvError);
 
 	INFO_PRINTF1(_L("Checking cmd list with too many Multiple Wait command and and no deferred commands - Validation should be OK - Panic originates in HandleCleReturnValue returning an error"));
 	exitReason=0;
@@ -267,7 +271,9 @@
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	TEST(exitReason == ESwpTransitionEngineError20);
 	INFO_PRINTF3(_L("    -- received panic '%d', expected was '%d'."), exitReason, ESwpTransitionEngineError20);
-
+	
+	err = RProperty::Delete(RProcess().SecureId(), key);
+	TEST(err == KErrNone);
 	__UHEAP_MARKEND;
 
 	// this test raises panics due to negative testing - close them to clear the screen.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tsus/group/ssmatest_tsus.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,38 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SsmTSusTests EN"}
+
+; Vendor name
+: "SsmTSusTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_adaptationpluginloader.script"-"c:\devicesrv\ssmatest\ssmatest_sus_adaptationpluginloader.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_adaptionserver.script"-"c:\devicesrv\ssmatest\ssmatest_sus_adaptionserver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_supinfo.script"-"c:\devicesrv\ssmatest\ssmatest_sus_supinfo.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_suploader.script"-"c:\devicesrv\ssmatest\ssmatest_sus_suploader.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_platsec.script"-"c:\devicesrv\ssmatest\ssmatest_sus_platsec.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_platsec2.script"-"c:\devicesrv\ssmatest\ssmatest_sus_platsec2.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_utilserver.script"-"c:\devicesrv\ssmatest\ssmatest_sus_utilserver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_loadplugin.script"-"c:\devicesrv\ssmatest\ssmatest_sus_loadplugin.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatemgr\test\tsus\scripts\ssmatest_sus_adptpluginloaderoom.script"-"c:\devicesrv\ssmatest\ssmatest_sus_adptpluginloaderoom.script"
+
+
--- a/sysstatemgmt/systemstateplugins/adptplugin/group/stateadaptationref.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/group/stateadaptationref.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -36,5 +36,6 @@
 deffile		stateadaptationref.def
 
 library		euser.lib
+library 	ssmcmn.lib
 
 SMPSAFE
--- a/sysstatemgmt/systemstateplugins/adptplugin/inc/emergencycallrfadaptationref.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/inc/emergencycallrfadaptationref.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -37,10 +37,17 @@
 	void ActivateRfForEmergencyCall(TRequestStatus& aStatus);
 	void DeactivateRfForEmergencyCall(TRequestStatus& aStatus);
 	void Cancel();
-
+	
 private:
 	CEmergencyCallRfAdaptationRef();
 	~CEmergencyCallRfAdaptationRef();
+	void ConstructL();
+	//Helper function to check for P&S Key
+    TBool IsTestPsKeyDefined();
+	
+private:    
+	MEmergencyCallRfAdaptation* iSaaEmergencyCallRfAdaptationDll;
+	RLibrary iSaaEmergencyCallRfAdaptationLib;
 	};
 
 #endif // __EMERGENCYCALLRFADAPTATION_H__
--- a/sysstatemgmt/systemstateplugins/adptplugin/inc/miscadaptationref.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/inc/miscadaptationref.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -59,16 +59,20 @@
 	void GetSimLanguagesL(CBufBase* aBuf, TInt aCount);
 	void GetHiddenReset(TDes8& aHiddenResetPckg, TRequestStatus& aStatus);
 	void Cancel();
-
+	
 private:
 	CMiscAdaptationRef();
 	void ConstructL();	
 	~CMiscAdaptationRef();
+	//Helper function to check for P&S Key
+    TBool IsTestPsKeyDefined();
 
 private:
 	TInt iTestCaseNum;
 	RFs iFs;
 	RFileReadStream iFile;
+	MMiscAdaptation* iSaaMiscAdaptationDll;
+	RLibrary iSaaMiscAdaptationLib;
 	};
 
 #endif // __MISCADAPTATION_H__
--- a/sysstatemgmt/systemstateplugins/adptplugin/inc/rtcadaptationref.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/inc/rtcadaptationref.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -37,6 +37,13 @@
 
 private:
 	CRtcAdaptationRef();
+	void ConstructL();
+	//Helper function to check for P&S Key
+    TBool IsTestPsKeyDefined();
+    
+private:	
+	MRtcAdaptation* iSaaRtcAdaptationDll;
+	RLibrary iSaaRtcAdaptationLib;
 	};
 
 #endif // __RTCADAPTATION_H__
--- a/sysstatemgmt/systemstateplugins/adptplugin/inc/simadaptationref.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/inc/simadaptationref.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,8 +27,7 @@
   On a device when NotifySimEvent is called, Sim Adaptation Plug-in would request for notification 
   from the Cooperating System for 'aEvent'.
   
-  On HRP/Techview,the reference implementation has to complete the notification request with KErrNotSupported
-  since there is no Cooperating System on HRP/Techview.
+  The reference implementation has to complete the notification request with KErrNotSupported.
   
   But this implementation will cause problems in the following scenario.
   
@@ -45,7 +44,7 @@
   In this context if NotifySimEvent just completes the message immediately this results in a infinite 
   loop and starves other active objects with same priority.
   
-  This makes testing of Adaptation servers notification functionality impossible on HRP/Techview.
+  This makes testing of Adaptation servers notification functionality impossible on PlatSim/device.
   
   *********Solution*********
 
@@ -97,8 +96,13 @@
 private:
 	CSimAdaptationRef();
 	void ConstructL();
+	//Helper function to check for P&S Key
+    TBool IsTestPsKeyDefined();
+	
 private:
 	CSimRefAdaptationTimer* iTimer;
+	MSimAdaptation* iSaaSimAdaptationDll;
+	RLibrary iSaaSimAdaptationLib;
 	};
 
 
--- a/sysstatemgmt/systemstateplugins/adptplugin/inc/stateadaptationref.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/inc/stateadaptationref.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,8 +27,7 @@
   On a device when NotifyCoopSysEvent is called, State Adaptation Plug-in would request for notification 
   from the Cooperating System for 'aEvent'.
   
-  On HRP/Techview,the reference implementation has to complete the notification request with KErrNotSupported
-  since there is no Cooperating System on HRP/Techview.
+  The reference implementation has to complete the notification request with KErrNotSupported.
   
   But this implementation will cause problems in the following scenario.
   
@@ -45,7 +44,7 @@
   In this context if NotifyCoopSysEvent just completes the message immediately this results in a infinite 
   loop and starves other active objects with same priority.
   
-  This makes testing of Adaptation servers notification functionality impossible on HRP/Techview.
+  This makes testing of Adaptation servers notification functionality impossible on PlatSim/device.
   
   *********Solution*********
 
@@ -97,13 +96,17 @@
 
 	void NotifyCoopSysEvent(TDes8& aEvent, TRequestStatus& aStatus);
 	void NotifyCancel();
-
+	
 private:
 	CStateAdaptationRef();
 	void ConstructL();
+	//Helper function to check for P&S Key
+    TBool IsTestPsKeyDefined();
 
 private:
-	CStateRefAdaptationTimer* iTimer;	
+    CStateRefAdaptationTimer* iTimer;
+	MStateAdaptation* iSaaStateAdaptationDll;
+	RLibrary iSaaStateAdaptationLib;
 	};
 
 
--- a/sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -10,11 +10,21 @@
 //
 // Contributors:
 //
-// Description:
+// Description: This adaptation plugin implementation is for test/reference purposes.   
+// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
+// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
+// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
+// Else the actual plugins are loaded and the calls are routed to the actual implementations.
+// The test P & S key which it looks for is KEmergencyCallRfAdaptationPluginPropertyKey(0x2000E657)
 //
 
+#include "ssmdebug.h"
+#include <e32property.h>
 #include "emergencycallrfadaptationref.h"
 
+const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657;
+const TUid KPropertyCategory={0x2000D75B};
+
 /**
  Function to create new Emergency Call RF Adaptation Plugin.
 
@@ -32,11 +42,25 @@
 CEmergencyCallRfAdaptationRef* CEmergencyCallRfAdaptationRef::NewL()
 	{
 	CEmergencyCallRfAdaptationRef* self = new(ELeave) CEmergencyCallRfAdaptationRef;
+	
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	
 	return self;
 	}
 
+void CEmergencyCallRfAdaptationRef::ConstructL()
+    {
+    DEBUGPRINT1A("Loading Actual plugins");
+    _LIT(KSaaEmergencyCallRfAdaptationDLL, "saaemergencycallrfadaptation.dll");
+    User::LeaveIfError(iSaaEmergencyCallRfAdaptationLib.Load(KSaaEmergencyCallRfAdaptationDLL));
+    iSaaEmergencyCallRfAdaptationDll = (MEmergencyCallRfAdaptation *)(iSaaEmergencyCallRfAdaptationLib.Lookup(1)());
+    }
+
 CEmergencyCallRfAdaptationRef::~CEmergencyCallRfAdaptationRef()
 	{
+	iSaaEmergencyCallRfAdaptationLib.Close();
 	}
 
 CEmergencyCallRfAdaptationRef::CEmergencyCallRfAdaptationRef()
@@ -48,36 +72,65 @@
 */
 void CEmergencyCallRfAdaptationRef::Release()
 	{
-	delete this;
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("Release:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)");
+        iSaaEmergencyCallRfAdaptationDll->Release();
+        }
+    else
+        {
+        DEBUGPRINT1A("Release:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)");
+        }
+    delete this;
 	}
 
 /**
  Request RF activation so that an emergency call can be made.
- Reference implementation completes the request with KErrNone as support for RF activation is not available on Techview/H4 hrp.
+ Reference implementation completes the request with KErrNone. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
 
  @param aStatus to complete when the operation has finished
  @see TRequestStatus 
 */
 void CEmergencyCallRfAdaptationRef::ActivateRfForEmergencyCall(TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("ActivateRfForEmergencyCall:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)");
+        iSaaEmergencyCallRfAdaptationDll->ActivateRfForEmergencyCall(aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("ActivateRfForEmergencyCall:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
 /**
  Request RF deactivation after an emergency call have been made.
- Reference implementation completes the request with KErrNone as support for RF deactivation is not available on Techview/H4 hrp.
-
+ Reference implementation completes the request with KErrNone. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
+ 
  @param aStatus to complete when the operation has finished
  @see TRequestStatus 
 */
 void CEmergencyCallRfAdaptationRef::DeactivateRfForEmergencyCall(TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);	
-	}
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("DeactivateRfForEmergencyCall:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)");
+        iSaaEmergencyCallRfAdaptationDll->DeactivateRfForEmergencyCall(aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("DeactivateRfForEmergencyCall:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
+ 	}
 
 /**
   Cancel the outstanding request. Reference implementation completes the requests immediately so there is nothing to cancel.
@@ -85,4 +138,26 @@
 */
 void CEmergencyCallRfAdaptationRef::Cancel()
 	{
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("Cancel:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)");
+        iSaaEmergencyCallRfAdaptationDll->Cancel();
+        }
 	}
+
+/**
+    Helper function to check for P&S Key
+*/
+TBool CEmergencyCallRfAdaptationRef::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KEmergencyCallRfAdaptationPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        //Could not retrieve property value. Tests might fail 
+        DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
+        }
+    return testPsKeyDefined;
+    }
+
--- a/sysstatemgmt/systemstateplugins/adptplugin/src/miscadaptationref.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/src/miscadaptationref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -10,14 +10,23 @@
 //
 // Contributors:
 //
-// Description:
+// Description: This adaptation plugin implementation is for test/reference purposes.   
+// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
+// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
+// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
+// Else the actual plugins are loaded and the calls are routed to the actual implementations.
+// The test P & S key which it looks for is KMiscPluginPropertyKey(0x2000E658)
 //
 
+#include "ssmdebug.h"
 #include "miscadaptationref.h"
 #include <ssm/startupadaptationcommands.h>
+#include <e32property.h> 
 
 _LIT(KTestCmdSecurityCheckTestFile, "c:\\cmdsecuritychecktest\\pinchecksecuritycaseno.txt");
 
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+const TUid KPropertyCategory={0x2000D75B};              // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file)
 /**
  Function to create new Misc Adaptation Plugin. Used for a collection of activities.
 
@@ -42,6 +51,7 @@
 CMiscAdaptationRef::~CMiscAdaptationRef()
 	{
 	iFs.Close();
+	iSaaMiscAdaptationLib.Close();
 	}
 
 CMiscAdaptationRef::CMiscAdaptationRef()
@@ -50,6 +60,11 @@
 
 void CMiscAdaptationRef::ConstructL()
 	{
+	DEBUGPRINT1A("Loading Actual plugins");
+    _LIT(KSaaMiscAdaptationDLL, "saamiscadaptation.dll");
+    User::LeaveIfError(iSaaMiscAdaptationLib.Load(KSaaMiscAdaptationDLL));
+    iSaaMiscAdaptationDll = (MMiscAdaptation *)(iSaaMiscAdaptationLib.Lookup(1)());   
+    
 	iTestCaseNum = 1;
 	User::LeaveIfError(iFs.Connect());
 	}
@@ -59,29 +74,45 @@
 */
 void CMiscAdaptationRef::Release()
 	{
+	if(!IsTestPsKeyDefined())
+	    {
+	    DEBUGPRINT1A("Release :: Calling Actual plugins functions (saamiscadaptation.dll)");
+	    iSaaMiscAdaptationDll->Release();
+	    }
 	delete this;
 	}
 
 /**
  Get the start-up mode from the Cooperating System.
- Reference implementation completes with KErrNone as a cooperating system does not exist on Techview/H4 hrp.
+ Reference implementation completes the request with KErrNone. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
 
  @param aModePckg should contain start-up of the Cooperating System on completion
  @param aStatus to complete when the operation has finished
 
  @see TRequestStatus
 */
-void CMiscAdaptationRef::GetGlobalStartupMode(TDes8& /*aModePckg*/, TRequestStatus& aStatus)
+void CMiscAdaptationRef::GetGlobalStartupMode(TDes8& aModePckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+	    {
+	    DEBUGPRINT1A("GetGlobalStartupMode :: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->GetGlobalStartupMode(aModePckg,aStatus);
+	    }
+	else
+	    {
+	    DEBUGPRINT1A("GetGlobalStartupMode :: Calling ref plugins functions (miscadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);        
+	    }
 	}
 
 /**
  Prepare language codes stored in the SIM in preferred language lists. The next call should be GetSimLanguagesL()
- Reference implementation completes with KErrNotSupported as SIM support is not available on Techview/H4 hrp.
-
+ Reference implementation completes with KErrNotSupported. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
+ 
  @param aPriority priority for which the language lists need to be prepared
  @param aSizePckg on return contains the size of the buffer, which a client should allocate and pass as one of the parameters (TInt aCount) to GetSimLanguagesL()
  @param aStatus to complete when the operation has finished
@@ -90,34 +121,62 @@
  @see TRequestStatus
  @see GetSimLanguagesL
 */
-void CMiscAdaptationRef::PrepareSimLanguages(TSsmLanguageListPriority /*aPriority*/, TDes8& /*aSizePckg*/, TRequestStatus& aStatus)
+void CMiscAdaptationRef::PrepareSimLanguages(TSsmLanguageListPriority aPriority, TDes8& aSizePckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	// No support for SIM on H4hrp/Techview.
-	User::RequestComplete(status, KErrNotSupported);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("PrepareSimLanguages :: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->PrepareSimLanguages(aPriority,aSizePckg,aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("PrepareSimLanguages :: Calling ref plugins functions (miscadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        // No support for SIM on H4hrp/Techview.
+        User::RequestComplete(status, KErrNotSupported);
+        }
 	}
 
 /**
  Get language codes stored in the SIM in preferred language lists. PrepareSimLanguages() call should precede this call.
- Reference implementation completes with KErrNotSupported as SIM support is not available on Techview/H4 hrp.
-
+ Reference implementation completes with KErrNotSupported.  This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
+ 
  @param aBuf should contain the language lists on completion
  @param aCount to contain the count of the languages
 
  @see PrepareSimLanguages
 */
-void CMiscAdaptationRef::GetSimLanguagesL(CBufBase* /*aBuf*/, TInt /*aCount*/)
+void CMiscAdaptationRef::GetSimLanguagesL(CBufBase* aBuf, TInt aCount)
 	{
-	User::Leave(KErrNotSupported);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("GetSimLanguagesL :: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->GetSimLanguagesL(aBuf,aCount);
+        }
+    else
+        {
+        DEBUGPRINT1A("GetSimLanguagesL :: Calling ref plugins functions (miscadaptationref.dll)");
+        User::Leave(KErrNotSupported);
+        }	
 	}
 
-void CMiscAdaptationRef::GetHiddenReset(TDes8& /*aHiddenResetPckg*/, TRequestStatus& aStatus)
+void CMiscAdaptationRef::GetHiddenReset(TDes8& aHiddenResetPckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	// No support for Reset in HRP/Techview.
-	User::RequestComplete(status, KErrNotSupported);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("GetHiddenReset :: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->GetHiddenReset(aHiddenResetPckg,aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("GetHiddenReset :: Calling ref plugins functions (miscadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        // No support for Reset in HRP/Techview.
+        User::RequestComplete(status, KErrNotSupported);        
+        }
 	}
 
 
@@ -127,11 +186,18 @@
 */
 void CMiscAdaptationRef::Cancel()
 	{
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("Cancel :: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->Cancel();
+        }
 	}
 
 /**
  Request the next security state.
- Techview/H4hrp does not support SIM operations so a reference implementation would always return 'KErrNotSupported'.
+ Reference implementation would always return 'KErrNotSupported'.  This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
+  
  The function is modified to suit testing needs for PinCheck Security Command.
  A real implementation is intended to differ a lot based on the runtime changes/events on the device.
  
@@ -155,251 +221,276 @@
 */
 void CMiscAdaptationRef::SecurityStateChange(TInt aState, TDes8& aResponsePckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	StartupAdaptation::TSecurityStateInfo info = StartupAdaptation::EYes;
-	
-	//Read Test case number from the file 
-	TInt err = iFile.Open(iFs, KTestCmdSecurityCheckTestFile, EFileRead);
-	if (err == KErrNone)
-		{
-		TRAP(err,iTestCaseNum = iFile.ReadInt32L());
-		iFile.Close();
-		if(err)
-			{
-			RDebug::Printf("Error while reading tst case number from the file pinchecksecuritycaseno.txt");
-			User::RequestComplete(status, err);
-			return;
-			}
-		}	
-	switch(iTestCaseNum)
-		{
-		case EPINCHECK01:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("SecurityStateChange:: Calling Actual plugins functions (saamiscadaptation.dll)");
+        iSaaMiscAdaptationDll->SecurityStateChange(aState,aResponsePckg,aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("SecurityStateChange:: Calling ref plugins functions (miscadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        StartupAdaptation::TSecurityStateInfo info = StartupAdaptation::EYes;
+        
+        //Read Test case number from the file 
+        TInt err = iFile.Open(iFs, KTestCmdSecurityCheckTestFile, EFileRead);
+        if (err == KErrNone)
+            {
+            TRAP(err,iTestCaseNum = iFile.ReadInt32L());
+            iFile.Close();
+            if(err)
+                {
+                RDebug::Printf("Error while reading tst case number from the file pinchecksecuritycaseno.txt");
+                User::RequestComplete(status, err);
+                return;
+                }
+            }   
+        switch(iTestCaseNum)
+            {
+            case EPINCHECK01:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::EPINRequired:
+                    info = StartupAdaptation::EPIN1Required;
+                    break;
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockOk;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes;
+                    break;  
+                default:
+                    break;
+                }
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::EPINRequired:
-				info = StartupAdaptation::EPIN1Required;
-				break;
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockOk;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;
-				break;	
-			default:
-				break;
-			}
-			break;
-		case EPINCHECK02:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+            case EPINCHECK02:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes;
+                    break;  
+                default:
+                break;
+                }
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::EYes;
-				break;
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;
-				break;	
-			default:
-			break;
-			}
-			break;
-		case EPINCHECK03:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
-                break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::EPUK1Required;
-				break;	
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockOk;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;
-				break;	
-			default:
-				break;
-			}
-			break;
-		case EPINCHECK04:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+            case EPINCHECK03:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::EPUK1Required;
+                    break;  
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockOk;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes;
+                    break;  
+                default:
+                    break;
+                }
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::EPUK1Required;
-				break;	
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockOk;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;
-				break;	
-			default:
-				break;
-			}	
-			break;
-		case EPINCHECK05:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+            case EPINCHECK04:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::EPUK1Required;
+                    break;  
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockOk;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes;
+                    break;  
+                default:
+                    break;
+                }   
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::EUPUKRequired;
-				break;	
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockRestrictionOn;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;
-				break;	
-			default:
-				break;	
-			}	
-			break;
-		case EPINCHECK06:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+            case EPINCHECK05:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::EUPUKRequired;
+                    break;  
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockRestrictionOn;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes;
+                    break;  
+                default:
+                    break;  
+                }   
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::EUPUKRequired;
-				break;	
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockRestrictionPending;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;	
-				break;	
-			default:
-				break;	
-			}
-			break;
-		case EPINCHECK07:
-			switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-            case StartupAdaptation::ESIMInvalid:
-                info = StartupAdaptation::ENo;
+            case EPINCHECK06:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::EUPUKRequired;
+                    break;  
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockRestrictionPending;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                default:
+                    break;  
+                }
                 break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::EUPUKRequired;
-				break;	
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockRestricted;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;	
-				break;	
-			default:
-				break;	
-			}
-			break;
-		case EPINCHECK08:
-		switch(aState)
-			{
-			case StartupAdaptation::ESIMPresent:
-				info = StartupAdaptation::EYes;
-				break;
-			case StartupAdaptation::ESIMInvalid:
-			    info = StartupAdaptation::ENo;
-			    break;
-			case StartupAdaptation::ESIMRejected:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::ESIMBlocked:
-				info = StartupAdaptation::ENo;
-				break;
-			case StartupAdaptation::EPINRequired:
-				info = StartupAdaptation::EPIN1Required;
-				break;
-			case StartupAdaptation::ESIMLock:
-				info = StartupAdaptation::ESimLockOk;
-				break;
-			case StartupAdaptation::ESecurityCheckOK:
-				info = StartupAdaptation::EYes;	
-				break;	
-			case StartupAdaptation::ESecurityCheckFailed:
-				info = StartupAdaptation::EYes;	
-				break;	
-			default:
-				break;
-			}	
-			break;	
-		default:
-			break;
-		}
-	TPckgBuf<StartupAdaptation::TSecurityStateInfo> securityStateInfoResult(info);
-	aResponsePckg = securityStateInfoResult;	
-	User::RequestComplete(status, KErrNone);
+            case EPINCHECK07:
+                switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::EUPUKRequired;
+                    break;  
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockRestricted;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                default:
+                    break;  
+                }
+                break;
+            case EPINCHECK08:
+            switch(aState)
+                {
+                case StartupAdaptation::ESIMPresent:
+                    info = StartupAdaptation::EYes;
+                    break;
+                case StartupAdaptation::ESIMInvalid:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMRejected:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::ESIMBlocked:
+                    info = StartupAdaptation::ENo;
+                    break;
+                case StartupAdaptation::EPINRequired:
+                    info = StartupAdaptation::EPIN1Required;
+                    break;
+                case StartupAdaptation::ESIMLock:
+                    info = StartupAdaptation::ESimLockOk;
+                    break;
+                case StartupAdaptation::ESecurityCheckOK:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                case StartupAdaptation::ESecurityCheckFailed:
+                    info = StartupAdaptation::EYes; 
+                    break;  
+                default:
+                    break;
+                }   
+                break;  
+            default:
+                break;
+            }
+        TPckgBuf<StartupAdaptation::TSecurityStateInfo> securityStateInfoResult(info);
+        aResponsePckg = securityStateInfoResult;    
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
+/**
+    Helper function to check for P&S Key
+*/
+TBool CMiscAdaptationRef::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KMiscPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KMiscPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        //Could not retrieve property value. Tests might fail 
+        DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
+        }
+    return testPsKeyDefined;
+    }
+
--- a/sysstatemgmt/systemstateplugins/adptplugin/src/rtcadaptationref.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/src/rtcadaptationref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -10,16 +10,26 @@
 //
 // Contributors:
 //
-// Description:
+// Description: This adaptation plugin implementation is for test/reference purposes.   
+// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
+// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
+// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
+// Else the actual plugins are loaded and the calls are routed to the actual implementations.
+// The test P & S key which it looks for is KRtcAdaptationPluginPropertyKey (0x2000D76A)
 //
 
 #include "rtcadaptationref.h"
 
 #include <e32property.h>
+#include "ssmdebug.h"
 
 const TUid KAlarmServerUID = {0x101f5027};
 const TInt KTestRTCValueKey = 200;
 
+
+const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C;
+const TUid KPropertyCategory={0x2000D75B};
+
 /**
 Function to create new Rtc Adaptation Plugin.
 
@@ -34,11 +44,25 @@
 CRtcAdaptationRef* CRtcAdaptationRef::NewL()
 	{
 	CRtcAdaptationRef* self = new(ELeave) CRtcAdaptationRef;
+	
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	
 	return self;	
 	}
 
+void CRtcAdaptationRef::ConstructL()
+    {
+    DEBUGPRINT1A("Loading Actual plugins");
+    _LIT(KSaaRtcAdaptationDLL, "saartcadaptation.dll");
+    User::LeaveIfError(iSaaRtcAdaptationLib.Load(KSaaRtcAdaptationDLL));
+    iSaaRtcAdaptationDll = (MRtcAdaptation *)(iSaaRtcAdaptationLib.Lookup(1)());    
+    }
+
 CRtcAdaptationRef::~CRtcAdaptationRef()
 	{
+	iSaaRtcAdaptationLib.Close();
 	}
 
 CRtcAdaptationRef::CRtcAdaptationRef()
@@ -50,28 +74,44 @@
 */
 void CRtcAdaptationRef::Release()
 	{
-	delete this;
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("Release:: Calling Actual plugins functions (saartcadaptation.dll)");
+        iSaaRtcAdaptationDll->Release();
+        }
+    delete this;
 	}
 
 /**
  Check that the RTC is valid.
- Reference implementation completes the request with KErrNotSupported as support for RTC is not available on Techview/H4 hrp.
-
+ Reference implementation completes the request with KErrNotSupported. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
+ 
  @param aValidityPckg on return contains the status of the validity of the RTC as a boolean value
  @param aStatus to complete when the operation has finished
 
  @see TRequestStatus
 */
-void CRtcAdaptationRef::ValidateRtc(TDes8& /*aValidityPckg*/, TRequestStatus& aStatus)
+void CRtcAdaptationRef::ValidateRtc(TDes8& aValidityPckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNotSupported);
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("ValidateRtc:: Calling Actual plugins functions (saartcadaptation.dll)");
+        iSaaRtcAdaptationDll->ValidateRtc(aValidityPckg, aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("ValidateRtc:: Calling ref plugins functions (rtcadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNotSupported);
+        }
 	}
 
 /**
  Set a device wake-up alarm time, in UTC (coordinated universal time), in the RTC.
- Reference implementation completes the request with KErrNotSupported as support for RTC is not available on Techview/H4 hrp.
+ Reference implementation completes the request with KErrNotSupported. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
  For testing purposes it sets a pub sub property defined in test code.
 
  @param aAlarmTimePckg requested wake up time
@@ -81,19 +121,29 @@
 */
 void CRtcAdaptationRef::SetWakeupAlarm(TDesC8& aAlarmTimePckg, TRequestStatus& aStatus)
 	{
-	// Set this pub sub property (for testing purposes)
-	// The property is defined in the test code.  In normal operation this will fail silently because the property has not been defined.
-	RProperty::Set(KAlarmServerUID, KTestRTCValueKey, aAlarmTimePckg);
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("SetWakeupAlarm:: Calling Actual plugins functions (saartcadaptation.dll)");
+        iSaaRtcAdaptationDll->SetWakeupAlarm(aAlarmTimePckg, aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("SetWakeupAlarm:: Calling ref plugins functions (rtcadaptationref.dll)");
+        // Set this pub sub property (for testing purposes)
+        // The property is defined in the test code.  In normal operation this will fail silently because the property has not been defined.
+        RProperty::Set(KAlarmServerUID, KTestRTCValueKey, aAlarmTimePckg);
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        // No support for RTC on HRP/Techview.
+        User::RequestComplete(status, KErrNotSupported);
+        }
+	}
 
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	// No support for RTC on HRP/Techview.
-	User::RequestComplete(status, KErrNotSupported);
-	}
 
 /**
  Delete the current device wake-up alarm time in the RTC.
- Reference implementation completes the request with KErrNotSupported as support for RTC is not available on Techview/H4 hrp.
+ Reference implementation completes the request with KErrNotSupported. This is required for automated testing.
+ Actual plugins return expected values and this can be verified by manual testing
  For testing purposes it sets a pub sub property to a NULL value defined in test code.
 
  @param aStatus to complete when the operation has finished
@@ -102,16 +152,24 @@
 */
 void CRtcAdaptationRef::UnsetWakeupAlarm(TRequestStatus& aStatus)
 	{
-	// Set this pub sub property to a NULL value because we are unsetting the RTC (for testing purposes)
-	// The property is defined in the test code. In normal operation this will fail silently because the property has not been defined.
-	TTime nullTime(Time::NullTTime());
-	TPckgC<TTime> wakeupAlarmTimePckg(nullTime);
-	RProperty::Set(KAlarmServerUID, KTestRTCValueKey, wakeupAlarmTimePckg);
-
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	// No support for RTC on HRP/Techview.
-	User::RequestComplete(status, KErrNotSupported);
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("UnsetWakeupAlarm:: Calling Actual plugins functions (saartcadaptation.dll)");
+        iSaaRtcAdaptationDll->UnsetWakeupAlarm(aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("UnsetWakeupAlarm:: Calling ref plugins functions (rtcadaptationref.dll)");
+        // Set this pub sub property to a NULL value because we are unsetting the RTC (for testing purposes)
+        // The property is defined in the test code. In normal operation this will fail silently because the property has not been defined.
+        TTime nullTime(Time::NullTTime());
+        TPckgC<TTime> wakeupAlarmTimePckg(nullTime);
+        RProperty::Set(KAlarmServerUID, KTestRTCValueKey, wakeupAlarmTimePckg);
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        // No support for RTC on HRP/Techview.
+        User::RequestComplete(status, KErrNotSupported);
+        }
 	}
 
 /**
@@ -120,4 +178,25 @@
 */
 void CRtcAdaptationRef::Cancel()
 	{
+    if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("Cancel:: Calling Actual plugins functions (saartcadaptation.dll)");
+        iSaaRtcAdaptationDll->Cancel();
+        }
 	}
+
+/**
+    Helper function to check for P&S Key
+*/
+TBool CRtcAdaptationRef::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KRtcAdaptationPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KRtcAdaptationPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        //Could not retrieve property value. Tests might fail 
+        DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
+        }
+    return testPsKeyDefined;
+    }
--- a/sysstatemgmt/systemstateplugins/adptplugin/src/simadaptationref.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/src/simadaptationref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -10,10 +10,20 @@
 //
 // Contributors:
 //
-// Description:
+// Description: This adaptation plugin implementation is for test/reference purposes.   
+// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
+// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
+// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
+// Else the actual plugins are loaded and the calls are routed to the actual implementations.
+// The test P & S key which it looks for is KSimPluginPropertyKey (0x2000D76A)
 //
 
 #include "simadaptationref.h"
+#include "ssmdebug.h"
+#include <e32property.h> 
+
+const TUint32 KSimPluginPropertyKey = 0x2000D76B;
+const TUid KPropertyCategory={0x2000D75B};
 
 /**
 Function to create new Sim Adaptation Plugin.
@@ -40,6 +50,7 @@
 CSimAdaptationRef::~CSimAdaptationRef()
 	{
 	delete iTimer;
+	iSaaSimAdaptationLib.Close();
 	}
 
 CSimAdaptationRef::CSimAdaptationRef()
@@ -48,6 +59,11 @@
 
 void CSimAdaptationRef::ConstructL()
 	{
+	DEBUGPRINT1A("Loading Actual plugins");
+    _LIT(KSaaSimAdaptationDLL, "saaSimadaptation.dll");
+    User::LeaveIfError(iSaaSimAdaptationLib.Load(KSaaSimAdaptationDLL));
+    iSaaSimAdaptationDll = (MSimAdaptation *)(iSaaSimAdaptationLib.Lookup(1)()); 
+    
 	iTimer = CSimRefAdaptationTimer::NewL();
 	}
 
@@ -57,11 +73,20 @@
 	delete this;
 	}
 
-void CSimAdaptationRef::GetSimOwned(TDes8& /*aOwnedPckg*/, TRequestStatus& aStatus)
+void CSimAdaptationRef::GetSimOwned(TDes8& aOwnedPckg, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* pStatus = &aStatus;
-	User::RequestComplete(pStatus, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("GetSimOwned:: Calling Actual plugins functions (saaSimadaptation.dll)");
+        iSaaSimAdaptationDll->GetSimOwned(aOwnedPckg,aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("GetSimOwned :: Calling ref plugins functions (Simadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* pStatus = &aStatus;
+        User::RequestComplete(pStatus, KErrNone);      
+        }	
 	}
 
 /**
@@ -70,10 +95,16 @@
 */
 void CSimAdaptationRef::GetCancel()
 	{
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("GetCancel ::Calling Actual plugins functions (saaSimadaptation.dll)");
+        iSaaSimAdaptationDll->GetCancel();
+        }
 	}
 
 /**
-  The reference implementation completes with KErrNotSupported since there is no SIM support on HRP/Techview.
+  The reference implementation completes with KErrNotSupported. This is required for automated testing.
+  Actual plugins return expected values and this can be verified by manual testing
   On a device, Sim Adaptation Plug-in would complete 'aTypePckg' with one of the event types in TSsmSimEventType.
   
   
@@ -94,8 +125,23 @@
 */
 void CSimAdaptationRef::NotifySimEvent(TDes8& /*aTypePckg*/, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	iTimer->After(2000000,aStatus);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("NotifySimEvent :: Calling Actual plugins functions (saaSimadaptation.dll)");
+        /* Only clayersup.dll has an outstanding request. If this is passed to the actual plugin, the
+        request will never complete till a SIM event happens. This would add the test code requests in a queue
+        and the test code waits indefinitely. Hence, complete the request with KErrCancel. This would free the 
+        queue for test code to be executed. It has not impact on the test environment */
+        TRequestStatus *request = &aStatus; 
+        User::RequestComplete(request, KErrCancel);
+        }
+    else
+        {
+        DEBUGPRINT1A("NotifySimEvent :: Calling ref plugins functions (Simadaptationref.dll)");
+        aStatus = KRequestPending;
+        iTimer->After(2000000,aStatus);      
+        }   
+
 	}
 
 /**
@@ -104,12 +150,36 @@
 */
 void CSimAdaptationRef::NotifyCancel()
 	{
-	if(iTimer->IsActive())
-		{
-		iTimer->Cancel();			
-		}
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("NotifyCancel :: Calling Actual plugins functions (saaSimadaptation.dll)");
+        iSaaSimAdaptationDll->NotifyCancel();
+        }
+    else
+        {
+        DEBUGPRINT1A("NotifyCancel :: Calling ref plugins functions (Simadaptationref.dll)");
+        if(iTimer->IsActive())
+            {
+            iTimer->Cancel();           
+            }     
+        }	
 	}
 
+/**
+    Helper function to check for P&S Key
+*/
+TBool CSimAdaptationRef::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KSimPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KSimPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        //Could not retrieve property value. Tests might fail 
+        DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
+        }
+    return testPsKeyDefined;
+    }
 
 
 CSimRefAdaptationTimer::CSimRefAdaptationTimer():CTimer(CActive::EPriorityUserInput)
--- a/sysstatemgmt/systemstateplugins/adptplugin/src/stateadaptationref.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/adptplugin/src/stateadaptationref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -10,10 +10,21 @@
 //
 // Contributors:
 //
-// Description:
+// Description: This adaptation plugin implementation is for test/reference purposes.   
+// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
+// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
+// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
+// Else the actual plugins are loaded and the calls are routed to the actual implementations.
+// The test P & S key which it looks for is KStateAdaptationPluginPropertyKey (0x2000D76A)
 //
 
+#include <e32property.h>
+#include <ssm/ssmstate.h>
 #include "stateadaptationref.h"
+#include "ssmdebug.h"
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 /**
 Static method to create new State Adaptation Plugin.
@@ -40,6 +51,7 @@
 CStateAdaptationRef::~CStateAdaptationRef()
 	{
 	delete iTimer;
+	iSaaStateAdaptationLib.Close();
 	}
 
 CStateAdaptationRef::CStateAdaptationRef()
@@ -48,6 +60,10 @@
 
 void CStateAdaptationRef::ConstructL()
 	{
+    DEBUGPRINT1A("Loading Actual plugins");
+    _LIT(KSaaStateAdaptationDLL, "saastateadaptation.dll");
+    User::LeaveIfError(iSaaStateAdaptationLib.Load(KSaaStateAdaptationDLL));
+    iSaaStateAdaptationDll = (MStateAdaptation *)(iSaaStateAdaptationLib.Lookup(1)()); 
 	iTimer = CStateRefAdaptationTimer::NewL();
 	}
 
@@ -57,39 +73,84 @@
 	delete this;
 	}
 
-void CStateAdaptationRef::RequestCoopSysStateChange(TSsmState /*aState*/, TRequestStatus& aStatus)
+void CStateAdaptationRef::RequestCoopSysStateChange(TSsmState aState, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+	    {
+	    DEBUGPRINT1A("RequestCoopSysStateChange:: Calling Actual plugins functions (saastateadaptation.dll)");
+	    iSaaStateAdaptationDll->RequestCoopSysStateChange(aState, aStatus);
+	    }
+	else
+	    {
+	    DEBUGPRINT1A("RequestCoopSysStateChange:: Calling ref plugins functions (stateadaptationref.dll)");
+	    aStatus = KRequestPending;
+	    TRequestStatus* status = &aStatus;
+	    User::RequestComplete(status, KErrNone);
+	    }
 	}
 
 void CStateAdaptationRef::RequestCoopSysSelfTest(TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RequestCoopSysSelfTest:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->RequestCoopSysSelfTest(aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("RequestCoopSysSelfTest:: Calling ref plugins functions (stateadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
-void CStateAdaptationRef::RequestCoopSysPerformRestartActions(TInt /*aReason*/, TRequestStatus& aStatus)
+void CStateAdaptationRef::RequestCoopSysPerformRestartActions(TInt aReason, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformRestartActions:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->RequestCoopSysPerformRestartActions(aReason, aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformRestartActions:: Calling ref plugins functions (stateadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
-void CStateAdaptationRef::RequestCoopSysPerformShutdownActions(TInt /*aReason*/, TRequestStatus& aStatus)
+void CStateAdaptationRef::RequestCoopSysPerformShutdownActions(TInt aReason, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformShutdownActions:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->RequestCoopSysPerformShutdownActions(aReason, aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformShutdownActions:: Calling ref plugins functions (stateadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
-void CStateAdaptationRef::RequestCoopSysPerformRfsActions(TSsmRfsType /*aRfsType*/, TRequestStatus& aStatus)
+void CStateAdaptationRef::RequestCoopSysPerformRfsActions(TSsmRfsType aRfsType, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformRfsActions:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->RequestCoopSysPerformRfsActions(aRfsType, aStatus);
+        }
+    else
+        {
+        DEBUGPRINT1A("RequestCoopSysPerformRfsActions:: Calling ref plugins functions (stateadaptationref.dll)");
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrNone);
+        }
 	}
 
 /**
@@ -98,10 +159,16 @@
 */
 void CStateAdaptationRef::RequestCancel()
 	{
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RequestCancel:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->RequestCancel();
+        }
 	}
 
 /**
-  The reference implementation completes with KErrNotSupported since there isn't a Cooperating System on HRP/Techview.
+  The reference implementation completes with KErrNotSupported. This is required for automated testing.
+  Actual plugins return expected values and this can be verified by manual testing
   On a device, State Adaptation Plug-in would request for notification from the Cooperating System for 'aEvent'.
   
   The above mentioned implementation is modified to facilitate testing and increase the code coverage of the Adaptation 
@@ -120,8 +187,22 @@
 */
 void CStateAdaptationRef::NotifyCoopSysEvent(TDes8& /*aEvent*/, TRequestStatus& aStatus)
 	{
-	aStatus = KRequestPending;
-	iTimer->After(2000000,aStatus);
+	if(!IsTestPsKeyDefined())
+        {
+        /* Only ssmpowersup.dll has an outstanding request. If this is passed to the actual plugin, the
+        request will never complete till a power event happens. This would add the test code requests in a queue
+        and the test code waits indefinitely. Hence, complete the request with KErrServerTerminated. This would free 
+        the queue for test code to be executed. It has not impact on the test environment */
+        aStatus = KRequestPending;
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete(status, KErrServerTerminated);
+        }
+    else
+        {
+        DEBUGPRINT1A("NotifyCoopSysEvent:: Calling ref plugins functions (stateadaptationref.dll)");
+        aStatus = KRequestPending;
+        iTimer->After(2000000,aStatus);
+        }
 	}
 
 /**
@@ -130,13 +211,36 @@
 */
 void CStateAdaptationRef::NotifyCancel()
 	{
-	if(iTimer->IsActive())
-		{
-		iTimer->Cancel();			
-		}	
+	if(!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("NotifyCancel:: Calling Actual plugins functions (saastateadaptation.dll)");
+        iSaaStateAdaptationDll->NotifyCancel();
+        }
+    else
+        {
+        DEBUGPRINT1A("NotifyCancel:: Calling ref plugins functions (stateadaptationref.dll)");
+        if(iTimer->IsActive())
+            {
+            iTimer->Cancel();
+            }
+        }
 	}
 
-
+/**
+    Helper function to check for P&S Key
+*/
+TBool CStateAdaptationRef::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KStateAdaptationPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KStateAdaptationPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        //Could not retrieve property value. Tests might fail 
+        DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
+        }
+    return testPsKeyDefined;
+    }
 
 CStateRefAdaptationTimer::CStateRefAdaptationTimer():CTimer(CActive::EPriorityUserInput)
 	{
--- a/sysstatemgmt/systemstateplugins/test/tappgsapolicy/resource/sspluginstest_tappgsapolicy.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tappgsapolicy/resource/sspluginstest_tappgsapolicy.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -22,8 +22,8 @@
 
 NAME STAG
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
 
 RESOURCE RSS_SIGNATURE { }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tcmncustomcmd/group/sspluginstest_tcmncustomcmd.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,33 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SspluginsCmnCustomcmdTests EN"}
+
+; Vendor name
+: "SspluginsCmnCustomcmdTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tcmncustomcmd\scripts\sspluginstest_cmncustomcmd_rendezvouswithestart.script"-"c:\devicesrv\sspluginstest\sspluginstest_cmncustomcmd_rendezvouswithestart.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tcmncustomcmd\scripts\sspluginstest_cmncustomcmd_persistreboots.script"-"c:\devicesrv\sspluginstest\sspluginstest_cmncustomcmd_persistreboots.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tcmncustomcmd\scripts\sspluginstest_cmncustomcmd_cancelmonitoring.script"-"c:\devicesrv\sspluginstest\sspluginstest_cmncustomcmd_cancelmonitoring.script"
+
+
+
--- a/sysstatemgmt/systemstateplugins/test/testapps/group/gsatestappgood.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/testapps/group/gsatestappgood.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -27,7 +27,8 @@
 USERINCLUDE   	../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
+//SYSTEMINCLUDE	/epoc32/include/techview
 
 LIBRARY     euser.lib 
 LIBRARY		apparc.lib 
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/bld.inf	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/bld.inf	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -33,10 +33,12 @@
 
 PRJ_TESTMMPFILES
 tiadaptation_plugin.mmp
+definetestps.mmp
 
 
 PRJ_TESTEXPORTS
 sspluginstest_i_adaptation.iby			/epoc32/rom/include/sspluginstest_i_adaptation.iby
+definetestps.iby						/epoc32/rom/include/definetestps.iby
 
 // batch files for emulator / hardware test execution
 ../scripts/sspluginstest_adaptation_i_run.bat			/epoc32/data/z/sspluginstest/sspluginstest_adaptation_i_run.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/definetestps.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,23 @@
+// 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:
+//
+
+#ifndef __DEFINETEST_IBY__
+#define __DEFINETEST_IBY__
+
+file=ABI_DIR\BUILD_DIR\definetestps.exe	sys\bin\definetestps.exe
+
+data=EPOCROOT##epoc32\data\Z\private\10003a3f\apps\definetestps_reg.rsc	private\10003a3f\apps\definetestps_reg.rsc
+
+#endif // __DEFINETEST_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/definetestps.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,51 @@
+// 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:
+//
+
+TARGET			definetestps.exe
+TARGETTYPE		exe
+CAPABILITY		WriteDeviceData
+
+UID           	0x100039CE 0x200315B2
+VENDORID 		0x70000001
+
+//Secure id of sysstatemgr.exe
+SECUREID		0x2000D75B
+
+SOURCEPATH    	../src
+SOURCE        	definetestps.cpp
+
+USERINCLUDE   	.
+USERINCLUDE   	../inc
+
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
+MW_LAYER_SYSTEMINCLUDE  
+
+
+// Registration file
+SOURCEPATH    	../src
+START RESOURCE	definetestps_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
+
+LIBRARY     euser.lib
+LIBRARY		apparc.lib
+LIBRARY		apgrfx.lib
+LIBRARY		cone.lib
+LIBRARY		eikcore.lib
+LIBRARY		ssmuiproviderdll.lib
+
+SMPSAFE
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/sspluginstest_i_adaptation.iby	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/sspluginstest_i_adaptation.iby	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -16,6 +16,8 @@
 #ifndef __SSPLUGINSTEST_I_ADAPTATION_IBY__
 #define __SSPLUGINSTEST_I_ADAPTATION_IBY__
 
+#include <definetestps.iby>
+
 // test server
 data=ABI_DIR\DEBUG_DIR\tiadaptation_plugin.exe			sys\bin\tiadaptation_plugin.exe
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/sspluginstest_i_tadaptation.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,35 @@
+;
+; 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: 
+;
+
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"SspluginsiAdaptationTests EN"}
+
+; Vendor name
+: "SspluginsiAdaptationTests"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_emergency.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_emergency.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_misc.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_misc.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_rtc.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_rtc.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_sim.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_sim.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_state.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_state.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintadptplugin\scripts\sspluginstest_adaptation_i_statenotify.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_i_statenotify.script"
+
+
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/tiadaptation_plugin.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/group/tiadaptation_plugin.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,6 +27,9 @@
 UID				0x1000007A 0x10285A52	
 VENDORID		0x70000001
 
+//Secure id of sysstatemgr.exe
+SECUREID		0x2000D75B
+
 CAPABILITY 		PowerMgmt ReadDeviceData WriteDeviceData ProtServ SwEvent ReadUserData WriteUserData DiskAdmin
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/inc/definetestps.h	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,76 @@
+// 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: This is the header file for "DefineTestPs" app. This app is used to define the P & S keys required for activating the reference plugins.
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#ifndef __DEFINETESTPS_H
+#define __DEFINETESTPS_H
+
+/**
+Application class
+*/
+#include <eikapp.h>
+class CTestApplication : public CEikApplication
+	{
+public:
+	static CApaApplication* NewApplication();
+	~CTestApplication();
+	
+private:
+	CTestApplication();
+	
+	// from CApaApplication
+	TUid AppDllUid() const;
+	CApaDocument* CreateDocumentL();
+	};
+
+/**
+Document class
+*/
+#include <eikdoc.h>
+class CEikAppUi;
+class CEikApplication;
+class CTestDocument : public CEikDocument
+	{
+public:
+	static CTestDocument* NewL(CEikApplication& aApp);
+	~CTestDocument();
+	
+private:
+	CTestDocument(CEikApplication& aApp);
+	
+	// from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+/**
+Application UI class, root of all graphical user interface in this application
+*/
+#include <eikappui.h>
+class CTestAppUi : public CEikAppUi
+    {
+public:
+	CTestAppUi();
+	~CTestAppUi();
+	
+	// from CEikAppUi
+	void ConstructL();
+	};
+
+#endif // __DEFINETESTPS_H
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/inc/ti_adaptationplugin_stepbase.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/inc/ti_adaptationplugin_stepbase.h	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,6 +27,14 @@
 #include <test/testexecutestepbase.h>
 #include <ssm/ssmadaptationcli.h>
 
+//for define, set and unset of P&S keys.
+const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657;
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C;
+const TUint32 KSimPluginPropertyKey = 0x2000D76B;
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+
+const TUid KPropertyCategory={0x2000D75B};
 
 class CTestAdaptStep : public CTestStep
 	{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/definetestps.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,154 @@
+// 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: This app is used to define the P & S keys required for activating the reference plugins.
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <eikstart.h> 
+#include <eikapp.h>
+#include <e32property.h>
+#include "definetestps.h"
+#include "ti_adaptationplugin_stepbase.h"
+
+
+/**
+Standard DLL entry point function.
+Creates and returns an instance of the CApaApplication-derived class.
+@return an instance of the CApaApplication-derived class
+*/
+TInt E32Main()
+	{
+	return EikStart::RunApplication( CTestApplication::NewApplication );
+	}
+
+CTestApplication::CTestApplication()
+	{
+	}
+
+CTestApplication::~CTestApplication()
+	{
+ 	}
+		
+/**
+@return The application's UID 
+*/
+TUid CTestApplication::AppDllUid() const
+	{
+	const TUid dll = {0x200315B2};
+	return dll;
+	}
+
+/**
+@return CTestApplication or NULL if KErrNoMemory
+*/
+CApaApplication* CTestApplication::NewApplication()
+	{
+	// As the framework has at this point not started up enough, and therefore the TRAP-harness and 
+	// exception handlers aren’t available yet, this factory function is a non-leaving function and 
+	// can't use the new(Eleave) operator.
+	return new CTestApplication();
+	}
+	
+/**
+Called by the UI framework at application start-up to create an instance of the document class.
+@leave	KErrNoMemory
+@return A CTestDocument
+*/
+CApaDocument* CTestApplication::CreateDocumentL()
+	{
+	return CTestDocument::NewL(*this);
+	}
+
+CTestDocument::CTestDocument(CEikApplication& aApp) : CEikDocument(aApp)
+	{
+	}
+
+CTestDocument::~CTestDocument()
+	{
+	}
+
+/**
+Factory function for this class
+@return a new CEndTaskTestDocument instance.
+*/
+CTestDocument* CTestDocument::NewL(CEikApplication& aApp)
+	{
+	return new(ELeave) CTestDocument(aApp);
+	}
+
+
+/**
+Called by the UI framework to construct the application UI class. 
+Note that the app UI's ConstructL() is called by the UI framework.
+*/
+CEikAppUi* CTestDocument::CreateAppUiL()
+	{
+	return new(ELeave) CTestAppUi();
+	}
+
+CTestAppUi::CTestAppUi()
+	{
+	}
+
+CTestAppUi::~CTestAppUi()
+	{
+	}
+
+void CTestAppUi::ConstructL()
+	{
+	//This appplication is used to define the property for using dummy plugins. Uid3 of the application should be 
+	//same as the SSM's Secure Id. 
+	
+	
+	//Define the property for using Dummy plugins.
+	TInt result = KErrNone;
+	result = RProperty::Define(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, RProperty::EInt);
+	if ((KErrNone != result) && (KErrAlreadyExists !=result))
+        {
+        User::Leave(result);            
+        }
+	
+	
+	result = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+	if ((KErrNone != result) && (KErrAlreadyExists !=result))
+        {
+        User::Leave(result);            
+        }	
+	
+    result = RProperty::Define(KPropertyCategory, KRtcAdaptationPluginPropertyKey, RProperty::EInt);
+	if ((KErrNone != result) && (KErrAlreadyExists !=result))
+        {
+        User::Leave(result);            
+        }    
+
+    result = RProperty::Define(KPropertyCategory, KSimPluginPropertyKey, RProperty::EInt);
+	if ((KErrNone != result) && (KErrAlreadyExists !=result))
+        {
+        User::Leave(result);            
+        }   
+
+    result = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+	if ((KErrNone != result) && (KErrAlreadyExists !=result))
+        {
+        User::Leave(result);            
+        }
+	
+	RProcess::Rendezvous(KErrNone);
+	// Complete the UI framework's construction of the App UI.
+	BaseConstructL(CEikAppUi::ENoAppResourceFile);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/definetestps_reg.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,33 @@
+// 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: This is the registration resource file for "DefineTestPs" app. This app is used 
+// to define the P & S keys required for activating the reference plugins.
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x200315B2
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	// filename of application binary (minus extension)
+	app_file="definetestps";
+	newfile = KAppDoesNotSupportNewFile;
+	}
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/temergencycallrf_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/temergencycallrf_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -157,10 +157,9 @@
 TInt RTestSsmEmergencyCallRfAdaptation::CleanupAdaptations()
 	{
 	TInt ret = KErrNone;
-	if(Handle())
-		{
-		ret =  SendReceive(EDebugCleanupAdaptations);
-		}
+	// Since actual plugins are being used, they cannot be unloaded.
+	// Hence return without doing anything. There will be HeapMarkEnd to check that
+	// memory is not leaked.
 	return ret;
 	}
 
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/ti_adaptationplugin_stepbase.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/ti_adaptationplugin_stepbase.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -21,6 +21,9 @@
 #include "ti_adaptationplugin_stepbase.h"
 
 #include <e32debug.h>
+#include <e32property.h>
+
+_LIT (KExeToDefineTestPS, "\\sys\\bin\\definetestps.exe");
 
 static TInt StopScheduler(TAny* aTestAdaptStep)
 	{
@@ -51,6 +54,41 @@
 
 TVerdict CTestAdaptStep::doTestStepPreambleL()
 	{
+	RProcess processHandle;
+	CleanupClosePushL(processHandle);
+	
+	//Start the test exe which defines property keys for loading reference plugins
+	    
+	TInt err = processHandle.Create(KExeToDefineTestPS, KNullDesC);
+	INFO_PRINTF2(_L("Process creation returned : %d"), err);
+	User::LeaveIfError(err);
+	processHandle.Resume();
+	
+    // wait for the newly created process to rendezvous
+    TRequestStatus status;
+    processHandle.Rendezvous(status);
+    User::WaitForRequest(status);
+    TInt retVal = status.Int();
+    INFO_PRINTF2(_L("iStatus.Int() returned : %d"), retVal);
+    TEST(KErrNone == retVal);
+    CleanupStack::PopAndDestroy();
+    
+	// Set all the property keys
+	err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KSimPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
 	INFO_PRINTF1(_L("Starting the scheduler in CTestEmergencyAdaptStep::doTestStepPreambleL ..."));
 	iActiveScheduler = new(ELeave) CActiveScheduler;
 	CActiveScheduler::Install (iActiveScheduler);
@@ -65,5 +103,22 @@
 /** */
 TVerdict CTestAdaptStep::doTestStepPostambleL()
 	{
+	//Unset all the PandS keys
+	TInt err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 0); 
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 0);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 0);
+	TEST(KErrNone == err);
+	
+	err = RProperty::Set(KPropertyCategory, KSimPluginPropertyKey, 0);
+	TEST(KErrNone == err);
+
+	err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 0);
+	TEST(KErrNone == err);
+	
+	
 	return CTestStep::doTestStepPostambleL();
 	}
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tmisc_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tmisc_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -199,10 +199,9 @@
 TInt RTestSsmMiscAdaptation::CleanupAdaptations()
 	{
 	TInt ret = KErrNone;
-	if(Handle())
-		{
-		ret =  SendReceive(EDebugCleanupAdaptations);
-		}
+    // Since actual plugins are being used, they cannot be unloaded.
+    // Hence return without doing anything. There will be HeapMarkEnd to check that
+    // memory is not leaked.
 	return ret;
 	}
 
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/trtc_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/trtc_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -165,10 +165,9 @@
 TInt RTestSsmRtcAdaptation::CleanupAdaptations()
 	{
 	TInt ret = KErrNone;
-	if(Handle())
-		{
-		ret =  SendReceive(EDebugCleanupAdaptations);
-		}
+    // Since actual plugins are being used, they cannot be unloaded.
+    // Hence return without doing anything. There will be HeapMarkEnd to check that
+    // memory is not leaked.
 	return ret;
 	}
 
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tsim_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tsim_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -162,10 +162,9 @@
 TInt RTestSsmSimAdaptation::CleanupAdaptations()
 	{
 	TInt ret = KErrNone;
-	if(Handle())
-		{
-		ret =  SendReceive(EDebugCleanupAdaptations);
-		}
+    // Since actual plugins are being used, they cannot be unloaded.
+    // Hence return without doing anything. There will be HeapMarkEnd to check that
+    // memory is not leaked.
 	return ret;
 	}
 
--- a/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tstate_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tintadptplugin/src/tstate_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -176,10 +176,9 @@
 TInt RTestSsmStateAdaptation::CleanupAdaptations()
 	{
 	TInt ret = KErrNone;
-	if(Handle())
-		{
-		ret =  SendReceive(EDebugCleanupAdaptations);
-		}
+    // Since actual plugins are being used, they cannot be unloaded.
+    // Hence return without doing anything. There will be HeapMarkEnd to check that
+    // memory is not leaked.
 	return ret;
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tintconditionevaluator/group/sspluginstest_tintconditionevaluator.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssplugins_tintconditionevaluator EN"}
+
+; Vendor name
+: "Ssplugins_tintconditionevaluator"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tintconditionevaluator\scripts\sspluginstest_conditionevaluator_evaluate.script"-"c:\devicesrv\sspluginstest\sspluginstest_conditionevaluator_evaluate.script"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/group/sspluginstest_tadaptation.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,31 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssplugins_TUnitAdptPlugin EN"}
+
+; Vendor name
+: "Ssplugins_TUnitAdptPlugin"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitadptplugin\scripts\sspluginstest_adaptation_emergency.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_emergency.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitadptplugin\scripts\sspluginstest_adaptation_misc.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_misc.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitadptplugin\scripts\sspluginstest_adaptation_rtc.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_rtc.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitadptplugin\scripts\sspluginstest_adaptation_sim.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_sim.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitadptplugin\scripts\sspluginstest_adaptation_state.script"-"c:\devicesrv\sspluginstest\sspluginstest_adaptation_state.script"
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/group/tadaptation_plugin.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/group/tadaptation_plugin.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,11 +22,10 @@
 
 TARGET			tadaptation_plugin.exe
 TARGETTYPE		exe
-TARGETPATH	/sys/bin
-UID				0x1000007A 0x1028359E
+TARGETPATH		/sys/bin
+UID				0x1000007A 0x2000D75B
 VENDORID		0x70000001
 
-//CAPABILITY 		All -Tcb
 CAPABILITY 		PowerMgmt ReadDeviceData WriteDeviceData ProtServ SwEvent ReadUserData WriteUserData
 
 
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/temergencycallrf_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/temergencycallrf_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,8 +22,12 @@
 
 
 #include <s32mem.h>
+#include <e32property.h>
 #include "temergencycallrf_adaptationplugin_step.h"
 
+const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657;
+const TUid KPropertyCategory={0x2000D75B};
+
 //
 // Run the tests
 //
@@ -73,10 +77,13 @@
 //from CAdaptationTestBase
 TVerdict CTestEmergencyCallRfAdaptationPlugin::doTestStepL()
 	{
-	TInt err = KErrNone;
-
 	__UHEAP_MARK;
 	
+	TInt err = RProperty::Define(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, RProperty::EInt);
+	TEST((KErrNone == err) || (KErrAlreadyExists == err));
+	err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
 	TRAP(err, TestActivateRfForEmergencyCall());
 	TEST(iStatus.Int() == KErrDisconnected);
 	TEST(err == KErrNone);
@@ -97,6 +104,8 @@
 	TestCancel();
 	//TestRelease();			// have to test this part too ...
 
+	err = RProperty::Delete(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	__UHEAP_MARKEND;
 
 	return TestStepResult();
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tmisc_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tmisc_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -20,7 +20,7 @@
 */
 
 
-
+#include <e32property.h>
 #include <s32mem.h>
 #include "tmisc_adaptationplugin_step.h"
 
@@ -28,6 +28,9 @@
 // Run the tests
 //
 
+const TUid KPropertyCategory={0x2000D75B};              // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file)
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+
 CTestMiscAdaptationPlugin::CTestMiscAdaptationPlugin()
 	:CAdaptationTestBase(KTCTestMiscAdaptationPlugin)
 	{
@@ -174,6 +177,12 @@
 	{
 	__UHEAP_MARK;
 	
+	TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+	INFO_PRINTF2(_L("Defining KMiscPluginPropertyKey returns %d"), err);
+	TEST((KErrNone == err) || (KErrAlreadyExists == err));
+	err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+		
 	TestSecurityStateChange();
 
 	TestGetGlobalStartupMode();
@@ -200,7 +209,10 @@
 
 	TestCancel();
 	//TestRelease();			// have to test this part too ...
-
+	
+	err = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
+	TEST(KErrNone == err);
+	
 	__UHEAP_MARKEND;
 
 	return TestStepResult();
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -20,14 +20,16 @@
 */
 
 
-
+#include <e32property.h>
 #include <s32mem.h>
 #include "trtc_adaptationplugin_step.h"
 
 //
 // Run the tests
 //
-
+_LIT (KExeToDefineTestPS, "\\sys\\bin\\definetestps.exe");
+const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C;
+const TUid KPropertyCategory={0x2000D75B};
 
 CTestRtcAdaptationPlugin::CTestRtcAdaptationPlugin()
 	:CAdaptationTestBase(KTCTestRtcAdaptationPlugin)
@@ -53,7 +55,7 @@
 	if(iSsmRtcAdaptation.Handle())
 		{
 		TEST(KErrNotSupported == status.Int());	
-		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestValidateRtc completed with %d error : expected %d>"),status.Int(),KErrNone);	
+		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestValidateRtc completed with %d error : expected %d>"),status.Int(),KErrNotSupported);	
 		}
 	else
 		{
@@ -74,7 +76,7 @@
 	if(iSsmRtcAdaptation.Handle())
 		{
 		TEST(KErrNotSupported == status.Int());	
-		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestSetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNone);	
+		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestSetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNotSupported);	
 		}
 	else
 		{
@@ -94,7 +96,7 @@
 	if(iSsmRtcAdaptation.Handle())
 		{
 		TEST(KErrNotSupported == status.Int());	
-		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestUnsetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNone);	
+		INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestUnsetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNotSupported);	
 		}
 	else
 		{
@@ -114,9 +116,29 @@
 //from CAdaptationTestBase
 TVerdict CTestRtcAdaptationPlugin::doTestStepL()
 	{
-	TInt err = KErrNone;
-
 	__UHEAP_MARK;
+	
+	RProcess processHandle;
+    CleanupClosePushL(processHandle); 
+	        
+    //Start the test exe which defines startup related property keys 
+	            
+    TInt err = processHandle.Create(KExeToDefineTestPS, KNullDesC); 
+    INFO_PRINTF2(_L("Process creation returned : %d"), err);
+    User::LeaveIfError(err);
+	processHandle.Resume(); 
+	        
+	// wait for the newly created process to rendezvous 
+	TRequestStatus status; 
+	processHandle.Rendezvous(status); 
+	User::WaitForRequest(status); 
+	TInt retVal = status.Int(); 
+	INFO_PRINTF2(_L("iStatus.Int() returned : %d"), retVal); 
+	TEST(KErrNone == retVal); 
+	CleanupStack::PopAndDestroy();
+	
+    err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 	TRAP(err, TestValidateRtc());
 	TEST(err == KErrNone);
 
@@ -142,7 +164,8 @@
 	TestCancel();
 	//TestRelease();			// have to test this part too ...
 
-
+    err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 0);
+    TEST(KErrNone == err);
 	__UHEAP_MARKEND;
 
 	return TestStepResult();
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tsim_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tsim_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,12 +22,14 @@
 
 
 #include <s32mem.h>
+#include <e32property.h>
 #include "tsim_adaptationplugin_step.h"
 
 //
 // Run the tests
 //
-
+const TUint32 KSimPluginPropertyKey = 0x2000D76B;
+const TUid KPropertyCategory={0x2000D75B};              // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file)
 
 CTestSimAdaptationPlugin::CTestSimAdaptationPlugin()
 	:CAdaptationTestBase(KTCTestSimAdaptationPlugin)
@@ -102,10 +104,13 @@
 //from CAdaptationTestBase
 TVerdict CTestSimAdaptationPlugin::doTestStepL()
 	{
-	TInt err = KErrNone;
-
 	__UHEAP_MARK;
 	
+    TInt err = RProperty::Define(KPropertyCategory, KSimPluginPropertyKey, RProperty::EInt);
+    TEST((KErrNone == err) || (KErrAlreadyExists == err));
+    err = RProperty::Set(KPropertyCategory, KSimPluginPropertyKey, 1);
+    TEST(KErrNone == err);
+	
 	TRAP(err, TestGetSimOwned());
 	TEST(err == KErrNone);
 
@@ -128,6 +133,8 @@
 	TestGetCancel();
 	//TestRelease();			// have to test this part too ...
 
+    err = RProperty::Delete(KPropertyCategory, KSimPluginPropertyKey);
+    TEST(KErrNone == err);
 	__UHEAP_MARKEND;
 
 	return TestStepResult();
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tstate_adaptationplugin_step.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tstate_adaptationplugin_step.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,9 +22,13 @@
 
 
 #include <s32mem.h>
+#include <e32property.h>
 #include <ssm/ssmadaptation.h>
 #include "tstate_adaptationplugin_step.h"
 
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
+
 typedef MStateAdaptation* (*TFuncNewL)();
 
 CTestStateAdaptationPlugin::CTestStateAdaptationPlugin()
@@ -181,7 +185,10 @@
 //from CAdaptationTestBase
 TVerdict CTestStateAdaptationPlugin::doTestStepL()
 	{
-	TInt err = KErrNone;
+	TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+	TEST((KErrNone == err) || (KErrAlreadyExists == err));
+	err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
 	
 	__UHEAP_MARK;
 	TRAP(err, TestRequestCoopSysStateChangeL());
@@ -256,6 +263,8 @@
 
 	TestNotifyCancel();
 	TEST(err == KErrNone);
-
+	
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	return TestStepResult();
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tunitconditionevaluator/group/sspluginstest_tunitconditionevaluator.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssplugins_TUnitConditionEvaluator EN"}
+
+; Vendor name
+: "Ssplugins_TUnitConditionEvaluator"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitconditionevaluator\scripts\sspluginstest_cndeval_conditionevaluator.script"-"c:\devicesrv\sspluginstest\sspluginstest_cndeval_conditionevaluator.script"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/group/sspluginstest_tgsa.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,31 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssplugins_TGsa EN"}
+
+; Vendor name
+: "Ssplugins_TGsa"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitgsapolicy\scripts\sspluginstest_gsa_startup.script"-"c:\devicesrv\sspluginstest\sspluginstest_gsa_startup.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitgsapolicy\scripts\sspluginstest_gsa_normal.script"-"c:\devicesrv\sspluginstest\sspluginstest_gsa_normal.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitgsapolicy\scripts\sspluginstest_gsa_shutdown.script"-"c:\devicesrv\sspluginstest\sspluginstest_gsa_shutdown.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitgsapolicy\scripts\sspluginstest_gsa_fail.script"-"c:\devicesrv\sspluginstest\sspluginstest_gsa_fail.script"
+
--- a/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/group/tgsa_server.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/group/tgsa_server.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -34,6 +34,7 @@
 USERINCLUDE		../inc
 USERINCLUDE		../../../gsapolicy/inc
 USERINCLUDE		../../../localinc
+USERINCLUDE		../../../../ssmpolicyplugins/inc
 
 SOURCEPATH		../src
 SOURCE			tgsa_server.cpp
--- a/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_fail.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_fail.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,12 +27,19 @@
 #include <ssm/ssmcommandlist.h>
 #include <ssm/ssmcmd.hrh>
 #include <ssm/ssmcommand.h>
+#include "ssmsubstateext.hrh"
 
 #include "tgsa_step_fail.h"
 
-TSsmCommandType ArrFail[] = { ESsmCmdPublishSystemState, ESsmCmdPersistHalAttributes, 
-							ESsmCmdFinaliseDrives, ESsmCmdPowerOff };
-
+TSsmCommandType ArrFail[] = {   ESsmCmdCustomCommand,       //r_cmd_sastate
+                                ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                ESsmCmdSetPAndSKey,         //r_cmd_psstate
+                                ESsmCmdCustomCommand,       //r_cmd_cancelmonitoring
+                                ESsmCmdSetPAndSKey,         //r_cmd_killsplash
+                                ESsmCmdCustomCommand,       //r_cmd_contactservice
+                                ESsmCmdStartApp,            //r_cmd_sysap
+                                ESsmCmdMultipleWait         //r_cmd_multiwaitforever
+                                };
 CGsaFailTest::~CGsaFailTest()
 	{
 	}
@@ -112,8 +119,10 @@
  void CGsaFailTest::doTestPrepareCommandListL()
 	{
 	INFO_PRINTF1(_L("> CGsaFailTest::doTestPrepareCommandListL"));
-	TestPrepareCommandListL(ESsmFail ,KSsmAnySubState, KErrNone);
-	TestPrepareCommandListL(ESsmFail ,KSsmAnySubState, KErrNone);
+	//The default substate in the actual (fail policy) is mapped to 
+	//ESsmStateFail = 0x30
+	//Hence testing for the same.
+	TestPrepareCommandListL(ESsmFail ,ESsmStateFail , KErrNone);
 	TestPrepareCommandListL(ESsmFail ,100, KErrNotFound);
 	}
 
@@ -125,7 +134,7 @@
 	{
 	INFO_PRINTF1(_L("> CGsaFailTest::doTestCommandListL"));
 
-	TestCommandListL(ESsmFail, KSsmAnySubState, (sizeof(ArrFail)/sizeof(ArrFail[0])));
+	TestCommandListL(ESsmFail, ESsmStateFail, (sizeof(ArrFail)/sizeof(ArrFail[0])));
 	}
 
 /**
@@ -137,11 +146,11 @@
 	{
 	CGsaStatePolicyFail* policy = CreateAndInitializeFailPolicyLC();
 
-	TSsmState state(ESsmFail, KSsmAnySubState);
+	TSsmState state(ESsmFail, ESsmStateFail);
 	TSsmState result(0, 0);
 	TestGetNextState(policy, state, KErrNone, result);
 
-	TSsmState firstState(ESsmFail, KSsmAnySubState);
+	TSsmState firstState(ESsmFail, ESsmStateFail);
 	TestGetNextState(policy, firstState, KErrNone, result);
 
 	TSsmState unknownState(ESsmFail, 100);
@@ -266,7 +275,7 @@
 void CGsaFailTest::TestGetNextState(CGsaStatePolicyFail* aPolicy, TSsmState aCurrentTransition, TInt aError, TSsmState aResult)
 	{
 	TRequestStatus trs;
-	TSsmState state(ESsmFail, KSsmAnySubState);
+	TSsmState state(ESsmFail, ESsmStateFail);
 	aPolicy->PrepareCommandList(state, KErrNone, trs);
 	StartScheduler();
 	User::WaitForRequest(trs);
--- a/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_shutdown.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_shutdown.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,12 +27,24 @@
 #include <ssm/ssmcommandlist.h>
 #include <ssm/ssmcmd.hrh>
 #include <ssm/ssmcommand.h>
+#include <ssmsubstateext.hrh> 
 
 #include "tgsa_step_shutdown.h"
 
-TSsmCommandType ArrCriticalShutdown[] = { ESsmCmdPublishSystemState};
-TSsmCommandType ArrNonCriticalShutdown[] = { ESsmCmdPublishSystemState, ESsmCmdPersistHalAttributes, ESsmCmdFinaliseDrives};
-TSsmCommandType ArrPowerOffShutdown[] = { ESsmCmdPublishSystemState, ESsmCmdPowerOff };
+TSsmCommandType ArrCriticalShutdown[] = {   ESsmCmdCustomCommand,       //r_cmd_sastate
+                                            ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                            ESsmCmdSetPAndSKey,         //r_cmd_psstate
+                                            ESsmCmdCustomCommand,       //r_cmd_cancelmonitoring
+                                            ESsmCmdCustomCommand        //r_cmd_shutdownapps
+                                            };
+TSsmCommandType ArrNonCriticalShutdown[] = {ESsmCmdPublishSystemState,  //r_cmd_publishstate 
+                                            ESsmCmdSetPAndSKey,         //r_cmd_killsplash
+                                            ESsmCmdCustomCommand,       //r_cmd_sashutdown
+                                            ESsmCmdFinaliseDrives       //r_cmd_finalisedrives
+                                            };
+TSsmCommandType ArrPowerOffShutdown[] = {   ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                            ESsmCmdPowerOff             //r_cmd_poweroff 
+                                            };
 
 const TUint16 KUnknownState = 100;
 
@@ -132,11 +144,11 @@
 	{
 	INFO_PRINTF1(_L("> CGsaShutdownTest::doTestCommandListL"));
 
-	TestCommandListL(ESsmShutdown, ESsmShutdownSubStateCritical, 1);
+	TestCommandListL(ESsmShutdown, ESsmShutdownSubStateCritical, (sizeof(ArrCriticalShutdown)/sizeof(ArrCriticalShutdown[0])));
 	// KSsmAnySubState
-	TestCommandListL(ESsmShutdown, KSsmAnySubState, 1);
-	TestCommandListL(ESsmShutdown, ESsmShutdownSubStateNonCritical, 3);
-	TestCommandListL(ESsmShutdown, ESsmShutdownSubStatePowerOff, 2);
+	TestCommandListL(ESsmShutdown, KSsmAnySubState, (sizeof(ArrCriticalShutdown)/sizeof(ArrCriticalShutdown[0])));
+	TestCommandListL(ESsmShutdown, ESsmShutdownSubStateNonCritical, (sizeof(ArrNonCriticalShutdown)/sizeof(ArrNonCriticalShutdown[0])));
+	TestCommandListL(ESsmShutdown, ESsmShutdownSubStatePowerOff, (sizeof(ArrPowerOffShutdown)/sizeof(ArrPowerOffShutdown[0])));
 	}
 
 /**
--- a/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_startup.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitgsapolicy/src/tgsa_step_startup.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -27,10 +27,20 @@
 #include <ssm/ssmcommandlist.h>
 #include <ssm/ssmsubstates.hrh>
 #include <ssm/ssmcommand.h>
+#include <ssmsubstateext.hrh>
 
 
 #ifdef SYMBIAN_SSM_GRACEFUL_SHUTDOWN
-TSsmCommandType ArrCriticalStartUp[] = { ESsmCmdCustomCommand,ESsmCmdPublishSystemState,ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess,ESsmCmdStartProcess, ESsmCmdSetPAndSKey, ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdLoadSup };
+TSsmCommandType ArrCriticalStartUp[] = {ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                        ESsmCmdStartProcess,        //r_cmd_sysagt
+                                        ESsmCmdCustomCommand,       //r_cmd_initpskeys
+                                        ESsmCmdCustomCommand,       //r_cmd_checkuserdrive
+                                        ESsmCmdCustomCommand,       //r_cmd_deltempfiles
+                                        ESsmCmdStartProcess,        //r_cmd_reservedisk
+                                        ESsmCmdStartProcess,        //r_cmd_sysmon
+                                        ESsmCmdStartProcess,        //r_cmd_ssmutilsrv
+                                        ESsmCmdMultipleWait         //r_cmd_multiwaitforever
+                                        };
 #else
 TSsmCommandType ArrCriticalStartUp[] = { ESsmCmdCustomCommand,ESsmCmdPublishSystemState,ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess,ESsmCmdStartProcess, ESsmCmdSetPAndSKey, ESsmCmdStartProcess, ESsmCmdStartProcess, ESsmCmdStartProcess };
 #endif
@@ -39,8 +49,45 @@
 #ifdef TEST_SSM_GRACEFUL_OFFLINE
 TSsmCommandType ArrNonCriticalStartUp[] = { ESsmCmdSetPAndSKey, ESsmCmdSetPAndSKey,ESsmCmdSetPAndSKey,ESsmCmdPublishSystemState ,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdAMAStarter};
 #else
-TSsmCommandType ArrNonCriticalStartUp[] = { ESsmCmdPublishSystemState ,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdStartProcess,ESsmCmdAMAStarter};
+TSsmCommandType ArrNonCriticalStartUp[] = { ESsmCmdCustomCommand,       //r_cmd_sastate
+                                            ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                            ESsmCmdSetPAndSKey,         //r_cmd_psstate
+                                            ESsmCmdCustomCommand,       //r_cmd_startupmode
+                                            ESsmCmdLoadSup,             //r_cmd_loadpowersup
+                                            ESsmCmdCustomCommand,       //r_cmd_rfsfirstboot
+                                            ESsmCmdCustomCommand,       //r_cmd_rfsdeep
+                                            ESsmCmdCustomCommand,       //r_cmd_rfsnormal
+                                            ESsmCmdCustomCommand,       //r_cmd_initclkeys
+                                            ESsmCmdCustomCommand,       //r_cmd_initramdrive
+                                            ESsmCmdStartProcess,        //r_cmd_wserv
+                                            ESsmCmdStartProcess,        //r_cmd_splash
+                                            ESsmCmdStartProcess,        //r_cmd_tzsrv
+                                            ESsmCmdStartProcess,        //r_cmd_mediator
+                                            ESsmCmdStartProcess,        //r_cmd_hwrmsrv
+                                            ESsmCmdCustomCommand,       //r_cmd_rtc
+                                            ESsmCmdMultipleWait,        //r_cmd_multiwaitforever1
+                                            ESsmCmdStartProcess,        //r_cmd_dbrecovery
+                                            ESsmCmdStartProcess,        //r_cmd_accsrv
+                                            ESsmCmdCustomCommand,       //r_cmd_selectlanguage
+                                            ESsmCmdMultipleWait,        //r_cmd_multiwaitforever2
+                                            ESsmCmdLoadSup,             //r_cmd_loadlocalesup
+                                            ESsmCmdLoadSup,             //r_cmd_loadcollation
+                                            ESsmCmdLoadSup,             //r_cmd_loadregion
+                                            ESsmCmdLoadSup,             //r_cmd_loaduilanguage
+                                            ESsmCmdCustomCommand,       //r_cmd_aknstart
+                                            ESsmCmdWaitForApparcInit,   //r_cmd_apparc_init
+                                            ESsmCmdCustomCommand        //r_cmd_rfspostui
+                                            };
 #endif
+TSsmCommandType ArrCriticalAppsStartUp[] = {ESsmCmdCustomCommand,       //r_cmd_sastate
+                                            ESsmCmdPublishSystemState,  //r_cmd_publishstate
+                                            ESsmCmdSetPAndSKey,         //r_cmd_psstate
+                                            ESsmCmdCustomCommand,       //r_cmd_selftest
+                                            ESsmCmdStartProcess,        //r_cmd_cfserver
+                                            ESsmCmdStartApp,            //r_cmd_sysap
+                                            ESsmCmdStartProcess,        //r_cmd_profmon
+                                            ESsmCmdMultipleWait         //r_cmd_multiwaitforever
+                                            };
 
 CGsaStartupTest::~CGsaStartupTest()
 	{
@@ -123,9 +170,8 @@
 	INFO_PRINTF1(_L("> CGsaStartupTest::doTestPrepareCommandListL"));
 	TestPrepareCommandListL(ESsmStartup ,ESsmStartupSubStateCriticalStatic, KErrNone);
 	TestPrepareCommandListL(ESsmStartup ,KSsmAnySubState, KErrNone);
-	TestPrepareCommandListL(ESsmStartup ,ESsmStartupSubStateCriticalDynamic, KErrNone);
-	TestPrepareCommandListL(ESsmStartup ,ESsmStartupSubStateNetworkingCritical, KErrNone);
 	TestPrepareCommandListL(ESsmStartup ,ESsmStartupSubStateNonCritical, KErrNone);
+	TestPrepareCommandListL(ESsmStartup ,ESsmStateStartingCriticalApps, KErrNone); //ESsmStateStartingCriticalApps = 0x31
 	TestPrepareCommandListL(ESsmStartup ,100, KErrNotFound);
 	}
 
@@ -139,10 +185,8 @@
 	INFO_PRINTF1(_L("> CGsaStartupTest::doTestCommandListL"));
 
 	TestCommandListL(ESsmStartup, ESsmStartupSubStateCriticalStatic, sizeof(ArrCriticalStartUp) / sizeof(ArrCriticalStartUp[0]));
-	TestCommandListL(ESsmStartup, KSsmAnySubState, sizeof(ArrCriticalStartUp) / sizeof(ArrCriticalStartUp[0]));
-	TestCommandListL(ESsmStartup, ESsmStartupSubStateCriticalDynamic, sizeof(ArrDynamicStartUp) / sizeof(ArrDynamicStartUp[0]));
-	TestCommandListL(ESsmStartup, ESsmStartupSubStateNetworkingCritical, sizeof(ArrNetworkingStartUp) / sizeof(ArrNetworkingStartUp[0]));
 	TestCommandListL(ESsmStartup, ESsmStartupSubStateNonCritical, sizeof(ArrNonCriticalStartUp) / sizeof(ArrNonCriticalStartUp[0]));
+	TestCommandListL(ESsmStartup, ESsmStateStartingCriticalApps, sizeof(ArrCriticalAppsStartUp) / sizeof(ArrCriticalAppsStartUp[0]));	
 	}
 
 /**
@@ -156,46 +200,22 @@
 	CGsaStatePolicyStartup* policy = CreateAndInitializeStartUpPolicyLC();
 
 	TSsmState state(ESsmStartup, KSsmAnySubState);
-	TSsmState result(ESsmStartup, ESsmStartupSubStateCriticalDynamic);
-	// KSsmAnySubState (KSsmAnySubState) will return ESsmStartUpSubStateCriticalDynamic only for the first time, 
+	TSsmState result(ESsmStartup, ESsmStartupSubStateNonCritical);
+	// KSsmAnySubState (KSsmAnySubState) will return ESsmStartupSubStateNonCritical only for the first time, 
 	// next call will always return the next sub state for transition.
 	TestGetNextState(policy, state, KErrNone, result);
 
 	TSsmState firstState(ESsmStartup, ESsmStartupSubStateCriticalStatic);
-	TSsmState firstResult(ESsmStartup, ESsmStartupSubStateCriticalDynamic);
+	TSsmState firstResult(ESsmStartup, ESsmStartupSubStateNonCritical);
 	TestGetNextState(policy, firstState, KErrNone, firstResult);
 
-	TSsmState secondState(ESsmStartup, ESsmStartupSubStateCriticalDynamic);
-	TSsmState secondResult(ESsmStartup, ESsmStartupSubStateNetworkingCritical);
+	TSsmState secondState(ESsmStartup, ESsmStartupSubStateNonCritical);
+	TSsmState secondResult(ESsmStartup, ESsmStateStartingCriticalApps);
 	TestGetNextState(policy, secondState, KErrNone, secondResult);
 
-	TSsmState thirdState(ESsmStartup, ESsmStartupSubStateNetworkingCritical);
-	TSsmState thirdResult(ESsmStartup, ESsmStartupSubStateNonCritical);
+	TSsmState thirdState(ESsmStartup, ESsmStateStartingCriticalApps);
+	TSsmState thirdResult(ESsmStartup, ESsmStateSelfTestOK);
 	TestGetNextState(policy, thirdState, KErrNone, thirdResult);
-#ifdef __WINS__
-	TSsmState fourthState(ESsmStartup, ESsmStartupSubStateNonCritical);
-	TSsmState fourthResult(ESsmNormal, KSsmAnySubState);
-	TestGetNextState(policy, fourthState, KErrNone, fourthResult);
-#else
-	TSsmState fourthState(ESsmStartup, ESsmStartupSubStateNonCritical);
-	TSsmState fourthResult(ESsmStartup, 0x48);//Added 0x48 sub-state for new test for ARMV5 
-	TestGetNextState(policy, fourthState, KErrNone, fourthResult);
-	//This new state test Added for the one more sub-state available in ARMV5 compare to WINSCW
-	TSsmState fourthToNextState(ESsmStartup, 0x48);
-	TSsmState fourthToNextStateResult(ESsmNormal, KSsmAnySubState);
-	TestGetNextState(policy, fourthToNextState, KErrNone, fourthToNextStateResult);
-#endif
-
-	TSsmState fifthState(ESsmStartup, KSsmAnySubState);
-	TSsmState fifthResult(ESsmStartup, ESsmStartupSubStateCriticalDynamic);
-	// KSsmAnySubState (0xffff) will return ESsmStartUpSubStateCriticalDynamic only for the first time, 
-	// next call will always return the next sub state for transition.
-	TestGetNextState(policy, fifthState, KErrNone, fifthResult);
-	
-	//Commented this test because CGsaStatePolicyStartup::GETNExtstate panicks if substate is unknown
-	//TSsmState unknownState(ESsmStartup, 100);
-	//TSsmState knownResult(ESsmStartup, 0);
-	//TestGetNextState(policy, unknownState, KErrNone, knownResult);
 
 	CleanupStack::PopAndDestroy(policy);
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstateplugins/test/tunitutilityplugin/group/sspluginstest_tutility.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssplugins_TUtility EN"}
+
+; Vendor name
+: "Ssplugins_TUtility"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitutilityplugin\scripts\sspluginstest_utility.script"-"c:\devicesrv\sspluginstest\sspluginstest_utility.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstateplugins\test\tunitutilityplugin\scripts\sspluginstest_unit_utility.script"-"c:\devicesrv\sspluginstest\sspluginstest_unit_utility.script"
+
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -35,15 +35,33 @@
 NOEXPORTLIBRARY
 
 SOURCEPATH		../src
+// This is a temporary fix for fixing the build issues arising out of XSymbian code
+// getting compiled before xS60 code is in the mainline. This will be removed after
+// the merged package issues are resolved
+#ifdef FF_SIMLESS_OFFLINE_SUPPORT
 SOURCE			ssmuiproviderdlldefault.cpp
+#else //FF_SIMLESS_OFFLINE_SUPPORT
+SOURCE			ssmuiproviderdllref.cpp
+#endif //FF_SIMLESS_OFFLINE_SUPPORT
 
 USERINCLUDE 	../inc
 USERINCLUDE		../../localinc
 USERINCLUDE		../../clayer/inc
 
+#ifdef FF_SIMLESS_OFFLINE_SUPPORT
+USERINCLUDE		../../../ssmmapperutility/inc
+USERINCLUDE		../../../ssmmapperutility/pubsub
+USERINCLUDE		../../../ssmpolicyplugins/inc
+#endif //FF_SIMLESS_OFFLINE_SUPPORT
+
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib
 LIBRARY			efsrv.lib
+#ifdef FF_SIMLESS_OFFLINE_SUPPORT
+LIBRARY         platformenv.lib
+LIBRARY         ssmcmn.lib
+LIBRARY         ssmmapperutility.lib
+#endif //FF_SIMLESS_OFFLINE_SUPPORT
 
 SMPSAFE
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h	Tue Jul 06 15:43:30 2010 +0300
@@ -63,6 +63,9 @@
 private:
 	CSsmUiSpecific();
 	void ConstructL();
+	
+    //Helper function to check for P&S Key
+    static TBool IsTestPsKeyDefined();
 private:
 	TStrtSecurityStatus iStrtSecurityStatus;
 	TInt iReferenceCount;
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -22,8 +22,20 @@
 #include "ssmpanic.h"
 #include <e32property.h>
 #include "ssmdebug.h"
+#include <f32file.h>
+#include <ctsydomainpskeys.h>
+#include <mmtsy_names.h>
+#include <pathinfo.h>
+#include <securitynotification.h>
+#include <ssm/ssmstate.h>
+#include <startupdomainpskeys.h>
+#include "ssmmapperutilitystatic.h"
+#include "ssmmapperutilityinternalpskeys.h"
+#include "ssmsubstateext.hrh"
+#include "ssmswp.hrh"
+#include "trace.h"
 
-const TUid KPSStartupUid = {0x2000E65E};
+const TUid KPSStartupDefaultUid = {0x2000E65E};
 const TUid KSecurityPinNotifierUid = {0x2000E667};
 const TUid KScreenOutputChannel = {0x10009D48};
 const TUid KEmergencyCallPropertyCategory = {0x2001032C};
@@ -40,8 +52,17 @@
 //Number of clusterSize to be reserve for phone memory space 
 const TInt KNumberOfCluster = 2;
 
-_LIT(KTsyModuleName, "mm.tsy");
-_LIT(KTsyPhoneName, "GsmPhone1");
+//For test code
+/** Channel used to communicate with Security Notifier. */
+static const TUid KSecurityNotifierChannel = { 0x1000598F };
+
+// Type definitions for a buffer containing a drive id (drive letter + :).
+const TInt KDriveIdLength = 2;
+typedef TBuf<KDriveIdLength> TDriveId;
+
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+const TUid KPropertyCategory={0x2000D75B};              // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file)
+
 
 CSsmUiSpecific::CSsmUiSpecific()
 : iReferenceCount(1), iReservedPhoneMemory(0)
@@ -55,36 +76,85 @@
 
 EXPORT_C TUid CSsmUiSpecific::StartupPSUid()
 	{
-	return KPSStartupUid;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("StartupPSUid :: Calling S60 plugins functions ");
+        return KPSUidStartup;        
+        }
+    else
+        {
+        DEBUGPRINT1A("StartupPSUid :: Calling Symbian(dummy) plugins functions ");
+        return KPSStartupDefaultUid;
+        }	
 	}
 
 EXPORT_C TUid CSsmUiSpecific::SecurityPinNotifierUid()
 	{
-	return KSecurityPinNotifierUid;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("SecurityPinNotifierUid :: Calling S60 plugins functions ");
+        return KSecurityNotifierUid;  
+        }
+    else
+        {
+        DEBUGPRINT1A("SecurityPinNotifierUid :: Calling Symbian(dummy) plugins functions ");
+        return KSecurityPinNotifierUid;
+        }   
+
 	}
 
 EXPORT_C TUint CSsmUiSpecific::EmergencyCallPropertyKey()
 	{
-	return KEmergencyCallPropertyKey;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("EmergencyCallPropertyKey :: Calling S60 plugins functions ");
+        return KCTsyCallState;       
+        }
+    else
+        {
+        DEBUGPRINT1A("EmergencyCallPropertyKey :: Calling Symbian(dummy) plugins functions ");
+        return KEmergencyCallPropertyKey;
+        }   
+
 	}
 
 EXPORT_C TUid CSsmUiSpecific::EmergencyCallPropertyCategory()
 	{
-	return KEmergencyCallPropertyCategory;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("EmergencyCallPropertyCategory :: Calling S60 plugins functions ");
+        return KPSUidCtsyCallInformation;       
+        }
+    else
+        {
+        DEBUGPRINT1A("EmergencyCallPropertyCategory :: Calling Symbian(dummy) plugins functions ");
+        return KEmergencyCallPropertyCategory;
+        }   
+
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsSimSupported()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsSimSupported :: Calling S60 plugins functions ");
+        return SsmMapperUtility::FeatureStatus( TUid::Uid( KFeatureIdSimCard ) );       
+        }
+    else
+        {
+        DEBUGPRINT1A("IsSimSupported :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
+
 	}
 
 EXPORT_C void CSsmUiSpecific::SetSecurityStatus(const TStrtSecurityStatus& aSecurityStatus)
-	{
+	{   
 	iStrtSecurityStatus = aSecurityStatus;
 	}
 
 EXPORT_C TStrtSecurityStatus CSsmUiSpecific::SecurityStatus() const
-	{
+	{   
 	return iStrtSecurityStatus;
 	}
 
@@ -127,83 +197,269 @@
 
 EXPORT_C TUid CSsmUiSpecific::ScreenOutputChannelUid()
 	{
-	return KScreenOutputChannel;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("ScreenOutputChannelUid :: Calling S60 plugins functions ");
+        return KSecurityNotifierChannel;       
+        }
+    else
+        {
+        DEBUGPRINT1A("ScreenOutputChannelUid :: Calling Symbian(dummy) plugins functions ");
+        return KScreenOutputChannel;
+        }   
+
 	}
 
 EXPORT_C TUint CSsmUiSpecific::SimStatusPropertyKey()
 	{
-	return KSimStatusPropertyKey;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("SimStatusPropertyKey :: Calling S60 plugins functions ");
+        return KPSSimStatus;        
+        }
+    else
+        {
+        DEBUGPRINT1A("SimStatusPropertyKey :: Calling Symbian(dummy) plugins functions ");
+        return KSimStatusPropertyKey;
+        }   
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsSimStateChangeAllowed()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsSimStateChangeAllowed :: Calling S60 plugins functions ");
+        TSsmState state;
+        TInt err = SsmMapperUtility::GetCurrentState( state );
+        ERROR( err, "Failed to get current state" );
+        return ( err == KErrNone &&
+                 ( state.MainState() == ESsmStartup && state.SubState() == ESsmStateSecurityCheck ) ||
+                 ( state.MainState() == ESsmStartup && state.SubState() == ESsmStateNonCritical ) ||
+                   state.MainState() == ESsmNormal );        
+        }
+    else
+        {
+        DEBUGPRINT1A("IsSimStateChangeAllowed :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
+
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsAmaStarterSupported()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsAmaStarterSupported :: Calling S60 plugins functions ");
+        return SsmMapperUtility::FeatureStatus( TUid::Uid( KFeatureIdExtendedStartup ) );       
+        }
+    else
+        {
+        DEBUGPRINT1A("IsAmaStarterSupported :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
+
 	}
 
 EXPORT_C HBufC* CSsmUiSpecific::GetTsyModuleNameL()
 	{
-	HBufC* tstModuleName = KTsyModuleName().AllocL();
-	return tstModuleName;
+    DEBUGPRINT1A("GetTsyModuleNameL :: Calling S60 plugins functions ");
+    /*****************************************************
+    *   Series 60 Customer / TSY
+    *   Needs customer TSY implementation
+    *****************************************************/
+
+    HBufC* name = KMmTsyModuleName().AllocL();
+    INFO_1( "TSY name: %S", name );
+    return name;      
 	}
 
 EXPORT_C TUid CSsmUiSpecific::StarterPSUid()
 	{
-	return KSecurityStatusPropertyCategory;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("StarterPSUid :: Calling S60 plugins functions ");
+        return KPSStarterUid;        
+        }
+    else
+        {
+        DEBUGPRINT1A("StartupPSUid :: Calling Symbian(dummy) plugins functions ");
+        return KSecurityStatusPropertyCategory;
+        }   
 	}
 
 EXPORT_C HBufC* CSsmUiSpecific::PhoneTsyNameL()
 	{
-	HBufC* tsyPhoneName = KTsyPhoneName().AllocL();
-	return tsyPhoneName;
+    DEBUGPRINT1A("PhoneTsyNameL :: Calling S60 plugins functions ");
+    /*****************************************************
+    *   Series 60 Customer / TSY
+    *   Needs customer TSY implementation
+    *****************************************************/
+
+    HBufC* name = KMmTsyPhoneName().AllocL();
+    INFO_1( "Phone name: %S", name );
+    return name;     
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsSimPresent()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsSimPresent :: Calling S60 plugins functions ");
+        TInt value( 0 );
+        TInt err = RProperty::Get( SsmMapperUtility::PsUid( KPSUidStartup ), KPSSimStatus, value );
+        ERROR( err, "Failed to get value of KPSUidStartup::KPSSimStatus" );
+        return ( err == KErrNone &&
+                 ( value == ESimUsable ||
+                   value == ESimReadable ||
+                   value == ESimNotReady ) );       
+        }
+    else
+        {
+        DEBUGPRINT1A("IsSimPresent :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsSimlessOfflineSupported()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsSimlessOfflineSupported :: Calling S60 plugins functions ");
+        return SsmMapperUtility::FeatureStatus(
+            TUid::Uid( KFeatureIdFfSimlessOfflineSupport ) );      
+        }
+    else
+        {
+        DEBUGPRINT1A("IsSimlessOfflineSupported :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsNormalBoot()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsNormalBoot :: Calling S60 plugins functions ");
+        TInt value( 0 );
+        TInt errorCode = RProperty::Get( SsmMapperUtility::PsUid( KPSUidStartup ), KPSStartupReason, value );
+        ERROR( errorCode, "Failed to get value of KPSUidStartup::KPSStartupReason" );
+
+        TBool ret = ( errorCode == KErrNone && value == ENormalStartup );
+        INFO_1( "Is normal boot = %d", ret );
+        return ret;     
+        }
+    else
+        {
+        DEBUGPRINT1A("IsNormalBoot :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
 	}
 
 EXPORT_C TBool CSsmUiSpecific::IsSimChangedReset()
 	{
-	return ETrue;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("IsSimChangedReset :: Calling S60 plugins functions ");
+        TUid startupPsUid( SsmMapperUtility::PsUid( KPSUidStartup ) );
+        TInt value( 0 );
+        TInt errorCode = RProperty::Get( startupPsUid, KPSStartupReason, value );
+        ERROR( errorCode, "Failed to get value of KPSUidStartup::KPSStartupReason" );
+
+        TBool ret( EFalse );
+        if ( errorCode == KErrNone && value == ESIMStatusChangeReset )
+            {
+            errorCode = RProperty::Get( startupPsUid, KPSSimChanged, value );
+            ret = ( errorCode == KErrNone && value == ESimChanged );
+            }
+
+        INFO_1( "Is SIM changed reset = %d", ret );
+        return ret;       
+        }
+    else
+        {
+        DEBUGPRINT1A("IsSimChangedReset :: Calling Symbian(dummy) plugins functions ");
+        return ETrue;
+        }   
 	}
 
 EXPORT_C TUint CSsmUiSpecific::RFStatusPropertyKey()
 	{
-	return KRFStatusPropertyKey;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RFStatusPropertyKey :: Calling S60 plugins functions ");
+        return SWP_UID_SSM_RF_STATUS;        
+        }
+    else
+        {
+        DEBUGPRINT1A("RFStatusPropertyKey :: Calling Symbian(dummy) plugins functions ");
+        return KRFStatusPropertyKey;
+        }   
 	}
 
 EXPORT_C TUid CSsmUiSpecific::RFStatusPropertyCategory()
 	{
-	return KRFStatusPropertyCategory;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("RFStatusPropertyCategory :: Calling S60 plugins functions ");
+        return TUid::Uid( SWP_UID_SSM_RF_STATUS );       
+        }
+    else
+        {
+        DEBUGPRINT1A("RFStatusPropertyCategory :: Calling Symbian(dummy) plugins functions ");
+        return KRFStatusPropertyCategory;
+        }   
 	}
+
 EXPORT_C TUint CSsmUiSpecific::ValidateRTCPropertyKey()
     {
-    return KValidateRTCPropertyKey;
+    if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("ValidateRTCPropertyKey :: Calling S60 plugins functions ");
+        return KRTCPropertyKey;       
+        }
+    else
+        {
+        DEBUGPRINT1A("ValidateRTCPropertyKey :: Calling Symbian(dummy) plugins functions ");
+        return KValidateRTCPropertyKey;
+        }   
+
     }
 
 EXPORT_C TUid CSsmUiSpecific::ValidateRTCPropertyCategory()
     {
-    return KValidateRTCPropertyCategory;
+    if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("ValidateRTCPropertyCategory :: Calling S60 plugins functions ");
+        return KPSStarterUid;        
+        }
+    else
+        {
+        DEBUGPRINT1A("ValidateRTCPropertyCategory :: Calling Symbian(dummy) plugins functions ");
+        return KValidateRTCPropertyCategory;
+        }   
     }
 
 EXPORT_C TInt CSsmUiSpecific::PhoneMemoryRootDriveId()
 	{
-	return EDriveC;
+	if (!IsTestPsKeyDefined())
+        {
+        DEBUGPRINT1A("PhoneMemoryRootDriveId :: Calling S60 plugins functions ");
+        TInt driveId = EDriveC;
+        TDriveId driveIdBuf = PathInfo::PhoneMemoryRootPath().Left( KDriveIdLength );
+        if ( driveIdBuf.Length() > 0 )
+            {
+            TInt err = RFs::CharToDrive( driveIdBuf[0], driveId ) ;
+            INFO_1( "PhoneMemoryRootDriveId - CharToDrive returns: %d", err );            
+            }
+
+        INFO_1( "Phone memory root path ID: %d", driveId );
+        return driveId;      
+        }
+    else
+        {
+        DEBUGPRINT1A("PhoneMemoryRootDriveId :: Calling Symbian(dummy) plugins functions ");
+        return EDriveC;
+        }   
 	}
 
 /**
@@ -215,6 +471,21 @@
 	}
 
 /**
+    Helper function to check for P&S Key
+*/
+TBool CSsmUiSpecific::IsTestPsKeyDefined()
+    {
+    TBool testPsKeyDefined = EFalse;
+    TInt result = RProperty::Get(KPropertyCategory, KMiscPluginPropertyKey, testPsKeyDefined);
+    DEBUGPRINT3(_L("KMiscPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
+    if ((KErrNone != result) && (KErrNotFound != result))
+        {
+        User::Leave(result);
+        }
+    return testPsKeyDefined;
+    }
+
+/**
 Reserve two ClusterSize in Phone Memory Space on H/W
 and 512 bytes for __WINS__
 @return KErrNone if successful or systemwide error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdllref.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,278 @@
+// 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"
+// 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:
+//
+
+/**
+ @internalComponent
+ @released
+*/
+
+#include "ssmuiproviderdll.h"
+#include "ssmpanic.h"
+#include <e32property.h>
+#include "ssmdebug.h"
+
+const TUid KPSStartupUid = {0x2000E65E};
+const TUid KSecurityPinNotifierUid = {0x2000E667};
+const TUid KScreenOutputChannel = {0x10009D48};
+const TUid KEmergencyCallPropertyCategory = {0x2001032C};
+
+const TUint KEmergencyCallPropertyKey = 0x0101;
+const TUint KSimStatusPropertyKey = 0x0102;
+
+const TUid KSecurityStatusPropertyCategory =  {0x2000E664};
+
+const TUid KRFStatusPropertyCategory = {0x2000D75B};
+const TUint KRFStatusPropertyKey = 0x2001D2A9;
+const TUid KValidateRTCPropertyCategory = {0x2000D75B};
+const TUint KValidateRTCPropertyKey = 0x2001D2AB;
+//Number of clusterSize to be reserve for phone memory space 
+const TInt KNumberOfCluster = 2;
+
+_LIT(KTsyModuleName, "mm.tsy");
+_LIT(KTsyPhoneName, "GsmPhone1");
+
+CSsmUiSpecific::CSsmUiSpecific()
+: iReferenceCount(1), iReservedPhoneMemory(0)
+	{
+	}
+
+EXPORT_C CSsmUiSpecific::~CSsmUiSpecific()
+	{
+	iReservedPhoneMemoryFs.Close();
+	}
+
+EXPORT_C TUid CSsmUiSpecific::StartupPSUid()
+	{
+	return KPSStartupUid;
+	}
+
+EXPORT_C TUid CSsmUiSpecific::SecurityPinNotifierUid()
+	{
+	return KSecurityPinNotifierUid;
+	}
+
+EXPORT_C TUint CSsmUiSpecific::EmergencyCallPropertyKey()
+	{
+	return KEmergencyCallPropertyKey;
+	}
+
+EXPORT_C TUid CSsmUiSpecific::EmergencyCallPropertyCategory()
+	{
+	return KEmergencyCallPropertyCategory;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsSimSupported()
+	{
+	return ETrue;
+	}
+
+EXPORT_C void CSsmUiSpecific::SetSecurityStatus(const TStrtSecurityStatus& aSecurityStatus)
+	{
+	iStrtSecurityStatus = aSecurityStatus;
+	}
+
+EXPORT_C TStrtSecurityStatus CSsmUiSpecific::SecurityStatus() const
+	{
+	return iStrtSecurityStatus;
+	}
+
+EXPORT_C CSsmUiSpecific* CSsmUiSpecific::InstanceL()
+	{
+	CSsmUiSpecific* self;
+
+	//Check Tls data
+	if (NULL == Dll::Tls())
+		{
+		//Instantiate CSsmUiSpecific if TLS is null
+		self = new (ELeave) CSsmUiSpecific();
+		CleanupStack::PushL(self);
+		self->ConstructL();
+		//Copy CSsmUiSpecific pointer in TLS
+		User::LeaveIfError(Dll::SetTls(self));
+		CleanupStack::Pop(self);
+		}
+	else
+		{
+		//CSsmUiSpecific has already been instantiated
+		self = static_cast<CSsmUiSpecific*>(Dll::Tls());
+		++self->iReferenceCount;
+		}
+	return self;
+	}
+
+EXPORT_C void CSsmUiSpecific::Release()
+	{
+	   TAny* tlsPtr = Dll::Tls();
+	__ASSERT_DEBUG(NULL != tlsPtr, User::Panic(KPanicSsmUiSpecific, KErrNotFound));
+ 
+    CSsmUiSpecific* self = static_cast<CSsmUiSpecific*>(tlsPtr);
+    if (0 == --self->iReferenceCount)
+        {
+        Dll::FreeTls();
+        delete self;
+        }
+	}
+
+EXPORT_C TUid CSsmUiSpecific::ScreenOutputChannelUid()
+	{
+	return KScreenOutputChannel;
+	}
+
+EXPORT_C TUint CSsmUiSpecific::SimStatusPropertyKey()
+	{
+	return KSimStatusPropertyKey;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsSimStateChangeAllowed()
+	{
+	return ETrue;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsAmaStarterSupported()
+	{
+	return ETrue;
+	}
+
+EXPORT_C HBufC* CSsmUiSpecific::GetTsyModuleNameL()
+	{
+	HBufC* tstModuleName = KTsyModuleName().AllocL();
+	return tstModuleName;
+	}
+
+EXPORT_C TUid CSsmUiSpecific::StarterPSUid()
+	{
+	return KSecurityStatusPropertyCategory;
+	}
+
+EXPORT_C HBufC* CSsmUiSpecific::PhoneTsyNameL()
+	{
+	HBufC* tsyPhoneName = KTsyPhoneName().AllocL();
+	return tsyPhoneName;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsSimPresent()
+	{
+	return ETrue;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsSimlessOfflineSupported()
+	{
+	return ETrue;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsNormalBoot()
+	{
+	return ETrue;
+	}
+
+EXPORT_C TBool CSsmUiSpecific::IsSimChangedReset()
+	{
+	return ETrue;
+	}
+
+EXPORT_C TUint CSsmUiSpecific::RFStatusPropertyKey()
+	{
+	return KRFStatusPropertyKey;
+	}
+
+EXPORT_C TUid CSsmUiSpecific::RFStatusPropertyCategory()
+	{
+	return KRFStatusPropertyCategory;
+	}
+EXPORT_C TUint CSsmUiSpecific::ValidateRTCPropertyKey()
+    {
+    return KValidateRTCPropertyKey;
+    }
+
+EXPORT_C TUid CSsmUiSpecific::ValidateRTCPropertyCategory()
+    {
+    return KValidateRTCPropertyCategory;
+    }
+
+EXPORT_C TInt CSsmUiSpecific::PhoneMemoryRootDriveId()
+	{
+	return EDriveC;
+	}
+
+/**
+Leaving construction inside ConstructL
+*/
+void CSsmUiSpecific::ConstructL()
+	{
+	User::LeaveIfError( iReservedPhoneMemoryFs.Connect() );
+	}
+
+/**
+Reserve two ClusterSize in Phone Memory Space on H/W
+and 512 bytes for __WINS__
+@return KErrNone if successful or systemwide error
+*/
+EXPORT_C TInt CSsmUiSpecific::ReservePhoneMemorySpace()
+    {
+	TVolumeIOParamInfo volumeParamInfo; 
+	const TInt phoneMemoryDriveID = PhoneMemoryRootDriveId();
+	TInt errorCode = iReservedPhoneMemoryFs.VolumeIOParam(phoneMemoryDriveID, volumeParamInfo); 
+	if( KErrNone == errorCode )
+		{
+#ifdef __WINS__
+		//512 bytes for __WINS__
+		const TInt reservedMemory = 512;
+#else
+		//Reserving two clusterSize Phone memory 
+		const TInt reservedMemory = KNumberOfCluster * (volumeParamInfo.iClusterSize);
+#endif //__WINS__
+		errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace(phoneMemoryDriveID, reservedMemory);
+
+		if ( KErrNone == errorCode )
+			{
+			iReservedPhoneMemory = reservedMemory;
+			}
+		}
+    return errorCode;
+    }
+
+/**
+Free reserved bytes from Phone Memory Space. If aSpaceToFree is 0 bytes 
+then free complete reserved memory
+@param aSpaceToFree request to free memory
+@return KErrNone if successful or systemwide error
+*/
+EXPORT_C TInt CSsmUiSpecific::FreeReservedPhoneMemorySpace(const TInt aSpaceToFree)
+    {
+    TInt errorCode(KErrGeneral);
+	DEBUGPRINT3A("Reserved memory is = %d bytes, Request to free memory is = %d bytes", iReservedPhoneMemory, aSpaceToFree);
+    if(0 < iReservedPhoneMemory)
+        {
+		if(0 == aSpaceToFree)
+		    {
+		   	//Free complete reserved phone memory
+			errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), 0 );
+			DEBUGPRINT2A("Freeing memory completed with = %d", errorCode);
+			iReservedPhoneMemory = 0; 
+		    }
+		else
+		    {
+		    TInt newReserveSize = iReservedPhoneMemory - aSpaceToFree;
+		    newReserveSize = newReserveSize >= 0 ? newReserveSize : 0;
+		    errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), newReserveSize );
+			DEBUGPRINT2A("Freeing partial phone memory completed with = %d", errorCode);
+		    if(KErrNone == errorCode)
+			    {
+			    iReservedPhoneMemory = newReserveSize;
+			    }
+		    }
+    	}
+    return errorCode;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/group/ssrefpluginstest_tclayer.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,33 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssrefplugins_TClayer EN"}
+
+; Vendor name
+: "Ssrefplugins_TClayer"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_startersession.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_startersession.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_startupadaptationadapter.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_startupadaptationadapter.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_ssmpropertyobserver.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_ssmpropertyobserver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_ssmsimstatusobserver.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_ssmsimstatusobserver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_ssmsecurityeventobserver.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_ssmsecurityeventobserver.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tclayer\scripts\ssrefpluginstest_clayer_startersessionwithssm.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_clayer_startersessionwithssm.script"
+
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/group/tclayer_server.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/group/tclayer_server.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -25,8 +25,9 @@
 TARGETPATH		/sys/bin
 UID				0x1000007A 0xA00056EB
 VENDORID		0x70000001
-// Use KPSUidStartup as the secure id of this test server to allow P+S keys to be defined
-SECUREID 		0x101F8766
+SECUREID 		0x2000D75B
+
+CAPABILITY 		WriteDeviceData   
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
@@ -47,6 +48,7 @@
 LIBRARY			etel.lib
 LIBRARY			etelmm.lib
 LIBRARY			centralrepository.lib
+LIBRARY			ws32.lib
 
 // testcode
 SOURCEPATH		../src
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/scripts/ssrefpluginstest_clayer_ssmsimstatusobserver.script	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/scripts/ssrefpluginstest_clayer_ssmsimstatusobserver.script	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,9 +15,7 @@
 
 PRINT Run SSM SIM Status Observer tests
 
-PRINT Swapping SID over to CSsmUiSpecific::StartupPSUid()
-RUN_PROGRAM -1 setcap tclayer_server.exe 0 -SID 2000e65e tclayer_serverSID.exe
-LOAD_SUITE tclayer_serverSID
+LOAD_SUITE tclayer_server
 
 START_TESTCASE 			DEVSRVS-SSREFPLUGINS-CLAYER-0023
 //! @SYMTestCaseID 		DEVSRVS-SSREFPLUGINS-CLAYER-0023
@@ -38,6 +36,6 @@
 //! 					are no panics.
 //! 				All methods handle the object data appropriately, with no errors reported and there
 //! 					are no panics.
-RUN_TEST_STEP 100 tclayer_serverSID CCLayerTestSsmSimStatusObserver
+RUN_TEST_STEP 100 tclayer_server CCLayerTestSsmSimStatusObserver
 END_TESTCASE 			DEVSRVS-SSREFPLUGINS-CLAYER-0023
 
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsecurityeventobserver.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsecurityeventobserver.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,8 @@
  @internalComponent - Internal Symbian test code  
 */
 
+#include <e32property.h>
+#include <w32std.h>
 #include "ssmdebug.h"
 #include "strtsecphaseobserver.h"
 #include "ssmsecurityeventobserver.h"
@@ -33,6 +35,8 @@
 
 //Exe name which defines security state PS keys
 _LIT (KExeToDefineSecurityStatePS, "\\sys\\bin\\definesecuritystateps.exe");
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+const TUid KPropertyCategory={0x2000D75B};
 
 CLayerTestSsmEventObserver::CLayerTestSsmEventObserver()
 	{
@@ -60,15 +64,31 @@
 
 	//Start the test exe which defines security state related property keys
 	RProcess processHandle;
+	CleanupClosePushL(processHandle);
 	processHandle.Create(KExeToDefineSecurityStatePS, KNullDesC);
 	processHandle.Resume();
-	processHandle.Close();
+	TRequestStatus status;
+    processHandle.Rendezvous(status);
+    User::WaitForRequest(status);
+	        
+    TInt retVal = status.Int();
+    INFO_PRINTF2(_L("retVal = %d"),retVal);
+    TEST(KErrNone == retVal);
+    // leave if the process has not started properly
+    User::LeaveIfError(retVal);
+    CleanupStack::PopAndDestroy();
+	//processHandle.Close();
+    
+    TInt error = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+    TInt error1 = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+    INFO_PRINTF3(_L("Defining and setting property returned %d & %d"), error, error1);
 
 	return CTestStep::doTestStepPreambleL();
 	}
 
 TVerdict CLayerTestSsmEventObserver::doTestStepPostambleL()
 	{
+    TInt error = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
 	return CTestStep::doTestStepPostambleL();
 	}
 
@@ -82,6 +102,9 @@
 
 void CLayerTestSsmEventObserver::SimulatePasswordEntry()
 	{
+    /*RWsSession wsSession;
+    wsSession.Connect();*/
+    
 	TRawEvent eventDown;
 	TRawEvent eventUp;
 
@@ -90,12 +113,21 @@
 	UserSvr::AddEvent(eventDown);
 	eventUp.Set(TRawEvent::EKeyUp, EStdKeyComma);
 	UserSvr::AddEvent(eventUp);
+	User::After(1000000);
 
-	eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter);
+/*    eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter);
+    UserSvr::AddEvent(eventDown);
+    eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter);
+    UserSvr::AddEvent(eventUp);*/
+    
+	eventDown.Set(TRawEvent::EButton1Down, 60, 600);
 	UserSvr::AddEvent(eventDown);
-	eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter);
+	eventUp.Set(TRawEvent::EButton1Up, 60, 600);
 	UserSvr::AddEvent(eventUp);
 	User::After(1000000);
+	
+   /* wsSession.Flush();
+    wsSession.Close();*/
 	}
 
 void CLayerTestSsmEventObserver::CallBackRunL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsimstatusobserver.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsimstatusobserver.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -185,8 +185,9 @@
 	__UHEAP_MARK;
 	
 	// Delete any existing defines, ignore return value
-	(void) RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimChanged);
-	(void) RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimOwned);
+	TInt err1 = RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimChanged);
+	TInt err2 = RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimOwned);
+	INFO_PRINTF3(_L("Value of err1 & err2 = %d & %d"), err1, err2);
 	TInt err = KErrNone;
 	
 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
@@ -230,6 +231,7 @@
 	
 	INFO_PRINTF1(_L("Initializing SSM SIM status observer without defining SIM changed property"));
 	err = RProperty::Define(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, RProperty::EInt);
+	INFO_PRINTF2(_L("Define returns err = %d") ,err);
 	TEST(err == KErrNone);
 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
 	
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startersession.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startersession.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -335,28 +335,35 @@
 	INFO_PRINTF1(_L("Deleting splash screen property"));
 	ret = RProperty::Delete(KPSUidStartup, KPSSplashShutdown);
 	TEST(ret == KErrNone || ret == KErrNotFound);
+	INFO_PRINTF2(_L("ret val is : %d"), ret);
 		
 	
 	INFO_PRINTF1(_L("Ending splashscreen without defining property"));
 	ret = starterSession.EndSplashScreen();
 	TEST(ret == KErrNotFound);
+	INFO_PRINTF2(_L("ret val is : %d"), ret);
 	
 	INFO_PRINTF1(_L("Defining splash screen property"));
 	// In a test enviroment we don't need to worry about protecting the property
 	// so allow anything to change it
 	_LIT_SECURITY_POLICY_PASS(KAllPass); //lint !e648 Suppress overflow in computing constant for operation
 	ret = RProperty::Define(KPSUidStartup, KPSSplashShutdown, RProperty::EInt, KAllPass, KAllPass);
+	INFO_PRINTF3(_L("KPSUidStartup = %x, KPSSplashShutdown = %x"), KPSUidStartup, KPSSplashShutdown);
 	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("ret val is : %d"), ret);
 	
 	INFO_PRINTF1(_L("Ending splashscreen with property defined"));
 	ret = starterSession.EndSplashScreen();
 	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("ret val is : %d"), ret);
 	
 	INFO_PRINTF1(_L("Reading splash screen property"));
 	TInt value;
 	ret = RProperty::Get(KPSUidStartup, KPSSplashShutdown, value);
 	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("ret val is : %d"), ret);
 	TEST(value == ESplashShutdown);
+	INFO_PRINTF3(_L("Property value is : %d .Expected : %d"), ret, ESplashShutdown);
 	
 	INFO_PRINTF1(_L("Close on connected RStartSession"));
 	starterSession.Close();
--- a/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startupadaptationadapter.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startupadaptationadapter.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -1740,11 +1740,11 @@
 	}
 
 // declare exported functions for test AFSS-CLAYER-0019
-MEmergencyCallRfAdaptation* CreateEmergencyCallRfAdaptationL(void);
-MMiscAdaptation* CreateMiscAdaptationL(void);
-MRtcAdaptation* CreateRtcAdaptationL(void);
-MSimAdaptation* CreateSimAdaptationL(void);
-MStateAdaptation* CreateStateAdaptationL(void);
+IMPORT_C MEmergencyCallRfAdaptation* CreateEmergencyCallRfAdaptationL(void);
+IMPORT_C MMiscAdaptation* CreateMiscAdaptationL(void);
+IMPORT_C MRtcAdaptation* CreateRtcAdaptationL(void);
+IMPORT_C MSimAdaptation* CreateSimAdaptationL(void);
+IMPORT_C MStateAdaptation* CreateStateAdaptationL(void);
 
 /**
 Old Test CaseID 		AFSS-CLAYER-0019
--- a/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/definesecuritystateps.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/definesecuritystateps.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 
 TARGET			definesecuritystateps.exe
 TARGETTYPE		exe
-CAPABILITY  	none
+CAPABILITY  	WriteDeviceData
 
 UID           	0x100039CE 0x2000E664
 VENDORID 		0x70000001
@@ -32,7 +32,7 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+
 
 // Registration file
 SOURCEPATH    	../src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/ssrefpluginstest_tintcustcmd.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,32 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssrefplugins_TIntCustCmd EN"}
+
+; Vendor name
+: "Ssrefplugins_TIntCustCmd"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tintcustcmd\scripts\ssrefpluginstest_custcmd_simsecuritypincheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_simsecuritypincheck.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tintcustcmd\scripts\ssrefpluginstest_custcmd_activateemergencycallcheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_activateemergencycallcheck.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tintcustcmd\scripts\ssrefpluginstest_custcmd_deactivateemergencycallcheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_deactivateemergencycallcheck.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tintcustcmd\scripts\ssrefpluginstest_custcmd_devicesecuritypincheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_devicesecuritypincheck.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tintcustcmd\scripts\ssrefpluginstest_custcmd_int_execute.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_int_execute.script"
+
--- a/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/tcustomcmd_server.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/group/tcustomcmd_server.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -47,6 +47,15 @@
 SOURCE			tcustcmd_step_devicesecuritypincheck.cpp
 SOURCE			tcustcmd_step_int_execute.cpp
 
+USERINCLUDE 	../../../custcmd/inc
+SOURCEPATH		../../../custcmd/src
+SOURCE			ssmsecuritychecknotifier.cpp
+
+#ifndef TEST_CUSTCMD
+#define TEST_CUSTCMD
+MACRO TEST_CUSTCMD_MACRO
+#endif
+
 LIBRARY			euser.lib
 LIBRARY			efsrv.lib
 LIBRARY			testexecuteutils.lib
--- a/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_devicesecuritypincheck.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_devicesecuritypincheck.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -84,17 +84,6 @@
 
 	iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
 	
-	//Start the test exe which defines startup related property keys
-	RProcess processHandle;
-	
-	TInt temp = processHandle.Create(KExeToDefineStartUpPS, KNullDesC);
-	processHandle.Resume();
-	processHandle.Close();
-		
-	processHandle.Create(KExeToDefineStartUpStatePS, KNullDesC);
-	processHandle.Resume();
-	processHandle.Close();
-
 	//For stopping the key simulation
 	iStopSimulatekey = CStopSimulateDevicekey::NewL(this);
  	
--- a/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_simsecuritypincheck.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tintcustcmd/src/tcustcmd_step_simsecuritypincheck.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,6 +20,7 @@
 #include <s32file.h>
 
 const TInt KNumOfTestCases = 8;
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
 
 static TInt CustomCmdTestSecurityCheckCallBackL(TAny* aCustomCmdTestSecurityPinCheck)
 	{
@@ -35,6 +36,8 @@
 */
 void CCustomCmdTestSecurityPinCheck::CallBackForEnterPin()
 	{
+	const TInt okButtonPos1 = 60; //the position of ok button
+	const TInt okButtonPos2 = 600; //the position of ok button
 	iAsyncStopScheduler->CallBack();
 	
 	RWsSession wsSession;
@@ -52,9 +55,9 @@
 		User::After(100000);
 		}
 	
-	eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter);
+	eventDown.Set(TRawEvent::EButton1Down, okButtonPos1,okButtonPos2);
 	UserSvr::AddEvent(eventDown);
-	eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter);
+	eventUp.Set(TRawEvent::EButton1Up, okButtonPos1,okButtonPos2);
 	UserSvr::AddEvent(eventUp);
 	User::After(100000);
 		
@@ -91,6 +94,11 @@
 
 	iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
 	
+	TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+	TEST ((KErrNone == err) || (KErrAlreadyExists == err));
+	err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+	TEST (KErrNone == err);
+	
 	//Start the test exe which defines startup related property keys
 	RProcess processHandle;
 	CleanupClosePushL(processHandle);
@@ -108,23 +116,36 @@
 	User::LeaveIfError(retVal);
 	CleanupStack::PopAndDestroy();
 	
+	//Start the test exe which defines startup state related property keys
 	RProcess processHandle1;
-	TInt err1 = processHandle1.Create(KExeToDefineStartUpStatePS, KNullDesC);
-	INFO_PRINTF2(_L("KExeToDefineStartUpStatePS ret is %d"), err1);
+	CleanupClosePushL(processHandle1);
+	err = processHandle1.Create(KExeToDefineStartUpStatePS, KNullDesC);
+	INFO_PRINTF2(_L("KExeToDefineStartUpStatePS ret is %d"), err);
+	User::LeaveIfError(err);
 	processHandle1.Resume();
-	processHandle1.Close();
+	
+	// wait for the newly created process to rendezvous
+	processHandle1.Rendezvous(status);
+	User::WaitForRequest(status);
+	retVal = status.Int();
+	//leave if the process has not started properly
+	INFO_PRINTF2(_L("KExeToDefineStartUpStatePS rendezvous returns %d"), retVal);
+    User::LeaveIfError(retVal);
+    CleanupStack::PopAndDestroy();
 
 	//there are 8 different scenarios to test the custom command. Check the test spec for the scenarios.
  	//CMiscAdaptationRef::SecurityStateChange() has been changed to simulate the scenarios.
 	//CMiscAdaptationRef::SecurityStateChange() uses KTestCmdSecurityCheckTestFile to get the scenario number
 	//connect to file server
+
     User::LeaveIfError(iFs.Connect());
-	TInt err = iFs.MkDirAll(KDirNameOfTestCasesNumFile);
+	err = iFs.MkDirAll(KDirNameOfTestCasesNumFile);
 	if (KErrAlreadyExists != err && KErrNone != err)
 		{
 		User::Leave(err);
 		}
 	err = iFile.Replace(iFs, KTestCmdSecurityCheckTestFile, EFileWrite | EFileStream);
+	TEST(KErrNone == err);
 	iFile.Close();
 	
 	//For stopping the key simulation when execution behaviour is deferredwaitforsignal and fireandforget
@@ -135,7 +156,8 @@
 	TEST(KErrNone == connect);
 	
 	//RProperty property;
-	iProperty.Define(KCustomcmdServerSID, iSwp.Key(), RProperty::EInt);
+	err = iProperty.Define(KCustomcmdServerSID, iSwp.Key(), RProperty::EInt);
+	TEST ((KErrNone == err) || (KErrAlreadyExists == err));
 	
 	// Register mapping between keys and swp policy DLL (done once per ssmserver)
 	INFO_PRINTF1(_L("Registering swp..."));
@@ -455,6 +477,8 @@
 TVerdict CCustomCmdTestSecurityPinCheck::doTestStepPostambleL()
 	{
 	TEST(KErrNone == iProperty.Delete(KCustomcmdServerSID, iSwp.Key()));
+	TInt err = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
+	TEST (KErrNone == err);
 	iProperty.Close();
 	iClient.Close();
 	//delete the file		
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/defineemergencycallps.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/defineemergencycallps.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 
 TARGET			defineemergencycallps.exe
 TARGETTYPE		exe
-CAPABILITY  	none
+CAPABILITY  	WriteDeviceData
 
 UID           	0x100039CE 0x2001032C
 VENDORID 		0x70000001
@@ -32,7 +32,7 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
+MW_LAYER_SYSTEMINCLUDE
 
 // Registration file
 SOURCEPATH    	../src
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/definestartupps.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/definestartupps.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,7 +15,7 @@
 
 TARGET			definestartupps.exe
 TARGETTYPE		exe
-CAPABILITY  	none
+CAPABILITY  	WriteDeviceData
 
 UID           	0x100039CE 0x2000E65E
 VENDORID 		0x70000001
@@ -30,7 +30,6 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-SYSTEMINCLUDE	/epoc32/include/techview
 
 // Registration file
 SOURCEPATH    	../src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/ssrefpluginstest_tuintcustcmd.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,39 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Ssrefplugins_TUnitCustCmd EN"}
+
+; Vendor name
+: "Ssrefplugins_TUnitCustCmd"
+
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_coopsysperformrestartactions.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_coopsysperformrestartactions.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_coopsysperformrfsactions.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_coopsysperformrfsactions.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_coopsysperformshutdownactions.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_coopsysperformshutdownactions.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_coopsysselftest.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_coopsysselftest.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_activaterfforemergencycall.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_activaterfforemergencycall.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_deactivaterfforemergencycall.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_deactivaterfforemergencycall.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_coopsysstatechange.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_coopsysstatechange.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_publishstartupmode.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_publishstartupmode.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_execute.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_execute.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_publishsimownedandchanged.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_publishsimownedandchanged.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_simsecuritycheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_simsecuritycheck.script"
+"\sf\os\devicesrv\sysstatemgmt\systemstatereferenceplugins\test\tunitcustcmd\scripts\ssrefpluginstest_custcmd_devicesecuritycheck.script"-"c:\devicesrv\ssrefpluginstest\ssrefpluginstest_custcmd_devicesecuritycheck.script"
+
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifier.rss	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifier.rss	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -19,8 +19,13 @@
  @internalComponent - Internal Symbian test code 
 */
 
-#include <techview/eikon.rh>
-#include <techview/eikon.rsg>
+#include <avkon.rh>
+#include <avkon.rsg>
+
+#include <eikon.rh>
+#include <eikon.rsg>
+
+#define qtn_sen_pindlg_auth_title             "Security check"
 
 NAME SPIN
 
@@ -30,21 +35,31 @@
 
 RESOURCE TBUF16 { buf=""; }
 
+
+
 RESOURCE DIALOG r_security_pin
 	{
-	title="Security check";
-	buttons=R_EIK_BUTTONS_CANCEL_OK;
+    flags = EGeneralQueryFlags;
+    title="Security check";
+	buttons=R_AVKON_SOFTKEYS_OK_CANCEL;
 
 	items =
 		{
-		DLG_LINE
-			{
-			type = EEikCtSecretEd; //Control factory id.
-			id = 0;
-			control = SECRETED
-				{
-				num_letters=8;
-				};
-			}
+		DLG_LINE 
+		    {
+		    type = EAknCtQuery;
+		    id = EGeneralQuery;
+		    control = AVERELL_DATA_QUERY 
+		        {
+		        layout = EPinLayout;
+		        label = qtn_sen_pindlg_auth_title;
+		        control = SECRETED 
+		            {
+		            num_letters = 8   ;//KSenMaxPasswordLength
+		            };
+		        };
+		    }
 		};
 	}
+
+RESOURCE TBUF r_pinnotdlg_auth_title                { buf = qtn_sen_pindlg_auth_title; }
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifierplugin.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/testpinnotifierplugin.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -35,7 +35,6 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-SYSTEMINCLUDE 	/epoc32/include/techview
 #ifndef SYMBIAN_OLD_EXPORT_LOCATION
 SYSTEMINCLUDE   /epoc32/include/platform/app
 #endif
@@ -49,7 +48,7 @@
 TARGET testpinnotifierplugin.rsc
 END
 
-SOURCEPATH	    ./../src
+SOURCEPATH	    ../src
 SOURCE  testpinnotifierplugin.cpp
 
 LIBRARY euser.lib
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/tunitcustcmd_server.mmp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/group/tunitcustcmd_server.mmp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -101,6 +101,7 @@
 LIBRARY			centralrepository.lib
 LIBRARY			ssmuiproviderdll.lib
 LIBRARY			ssmadaptationcli.lib
+LIBRARY			ws32.lib
 
 LIBRARY		etelmm.lib //Device security check
 LIBRARY		etel.lib //Device security check
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/inc/testpinnotifierplugin.h	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/inc/testpinnotifierplugin.h	Tue Jul 06 15:43:30 2010 +0300
@@ -26,7 +26,7 @@
 #include <e32std.h>
 #include <e32base.h>
 #include <eiknotapi.h>
-#include <techview/eikdialg.h>
+#include <eikdialg.h>
 #include <e32cmn.h>
 
 
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_activaterfforemergencycall.script	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_activaterfforemergencycall.script	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -13,7 +13,7 @@
 // Description:
 //
 
-PRINT Run CCustomCmdTestDeactivateRfForEmergencyCall tests
+PRINT Run CCustomCmdTestActivateRfForEmergencyCall tests
 
 LOAD_SUITE tunitcustcmd_server
 
@@ -30,5 +30,5 @@
 //! 					2.	Initialize - Initialising the custom cmd
 //! 					3.	Execute - Executing the custom cmd
 //! @SYMTestExpectedResults 	Command should execute normally and should complete with KErrNone.
-RUN_TEST_STEP 100 tunitcustcmd_server CCustomCmdTestDeactivateRfForEmergencyCall
+RUN_TEST_STEP 100 tunitcustcmd_server CCustomCmdTestActivateRfForEmergencyCall
 END_TESTCASE 			DEVSRVS-SSREFPLUGINS-CUSTCMD-0001
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_deactivaterfforemergencycall.script	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/scripts/ssrefpluginstest_custcmd_deactivaterfforemergencycall.script	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -13,7 +13,7 @@
 // Description:
 //
 
-PRINT Run CCustomCmdTestActivateRfForEmergencyCall tests
+PRINT Run CCustomCmdTestDeactivateRfForEmergencyCall tests
 
 LOAD_SUITE tunitcustcmd_server
 
@@ -30,6 +30,6 @@
 //! 					2.	Initialize - Initialising the custom cmd
 //! 					3.	Execute - Executing the custom cmd
 //! @SYMTestExpectedResults Command should execute normally and should complete with KErrNone.
-RUN_TEST_STEP 100 tunitcustcmd_server CCustomCmdTestActivateRfForEmergencyCall
+RUN_TEST_STEP 100 tunitcustcmd_server CCustomCmdTestDeactivateRfForEmergencyCall
 END_TESTCASE 			DEVSRVS-SSREFPLUGINS-CUSTCMD-0008
 
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_activaterfforemergencycall.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_activaterfforemergencycall.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,9 @@
 #include "tcmd_step_activaterfforemergencycall.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdactivaterfforemergencycall.h"
+#include <e32property.h>
+const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestActivateRfForEmergencyCall::~CCustomCmdTestActivateRfForEmergencyCall()
 	{
@@ -41,6 +44,11 @@
 	{
 	_LIT(KTESTLOG, "TestCustomCmdActivateRfForEmergencyCallL");
 	INFO_PRINTF1(KTESTLOG);
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+	TInt err = RProperty::Define(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, RProperty::EInt);
+	TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 
 	//Create Deactivate Rf For Emergency Call custom command
 	MSsmCustomCommand* customCmdActivateRfForEmergencyCall = SsmCustomCmdFactory::CmdActivateRfForEmergencyCallNewL();
@@ -56,12 +64,11 @@
 	//Command parameter is not used inside the Execute. So passing any dummy data should be fine
 	//Execute the command
 	customCmdActivateRfForEmergencyCall->Execute(dummy, status);
-	TEST(KRequestPending == status.Int());
 
 	//Wait for the request to be completed
 	User::WaitForRequest(status);
 	TEST(KErrNone == status.Int());
-
+	
 	//Execute the command once again
 	customCmdActivateRfForEmergencyCall->Execute(dummy, status);
 
@@ -73,12 +80,14 @@
 	//checking the status to KErrNone instead of KErrCancel.
 	User::WaitForRequest(status);
 	TEST(KErrNone == status.Int());
-
+	
 	//Close the command
 	customCmdActivateRfForEmergencyCall->Close();
 
 	//Releasing the comand will delete itself.
 	customCmdActivateRfForEmergencyCall->Release();
+	err = RProperty::Delete(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestActivateRfForEmergencyCall::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,10 @@
 #include "tcmd_step_coopsysperformrestartactions.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdcoopsysperformrestartactions.h"
+#include <e32property.h>
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysPerformRestartActions::~CCustomCmdTestCoopSysPerformRestartActions()
 	{
@@ -39,6 +43,12 @@
 
 void CCustomCmdTestCoopSysPerformRestartActions::TestCustomCmdCoopSysPerformRestartActionsL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
+    
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRestartActionsL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -80,6 +90,9 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysPerformRestartActions->Release();
+	
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+    TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysPerformRestartActions::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrfsactions.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrfsactions.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,10 @@
 #include "tcmd_step_coopsysperformrfsactions.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdcoopsysperformrfsactions.h"
+#include <e32property.h>
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysPerformRfsActions::~CCustomCmdTestCoopSysPerformRfsActions()
 	{
@@ -39,6 +43,11 @@
 
 void CCustomCmdTestCoopSysPerformRfsActions::TestCustomCmdCoopSysPerformRfsActionsL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRfsActionsL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -87,6 +96,8 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysPerformRfsActions->Release();
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysPerformRfsActions::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformshutdownactions.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformshutdownactions.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,10 @@
 #include "tcmd_step_coopsysperformshutdownactions.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdcoopsysperformshutdownactions.h"
+#include <e32property.h>
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysPerformShutdownActions::~CCustomCmdTestCoopSysPerformShutdownActions()
 	{
@@ -39,6 +43,11 @@
 
 void CCustomCmdTestCoopSysPerformShutdownActions::TestCustomCmdCoopSysPerformShutdownActionsL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformShutdownActionsL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -81,6 +90,8 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysPerformShutdownActions->Release();
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+    TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysPerformShutdownActions::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysselftest.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysselftest.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,10 @@
 #include "tcmd_step_coopsysselftest.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdcoopsysselftest.h"
+#include <e32property.h>
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysSelfTest::~CCustomCmdTestCoopSysSelfTest()
 	{
@@ -39,6 +43,11 @@
 
 void CCustomCmdTestCoopSysSelfTest::TestCustomCmdCoopSysSelfTestL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysSelfTestL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -80,6 +89,8 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysSelfTest->Release();
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysSelfTest::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysstatechange.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysstatechange.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,7 +22,10 @@
 #include "tcmd_step_coopsysstatechange.h"
 #include "ssmcustomcmdfactory.h"
 #include <ssm/ssmstate.h>
+#include <e32property.h>
 #include "cmdcoopsysstatechange.h"
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysStateChange::~CCustomCmdTestCoopSysStateChange()
 	{
@@ -40,6 +43,12 @@
 
 void CCustomCmdTestCoopSysStateChange::TestCustomCmdCoopSysStateChangeL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+	TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+	TEST(KErrNone == err || KErrAlreadyExists == err);
+	err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+	TEST(KErrNone == err);
+	
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysStateChangeL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -79,6 +88,8 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysStateChange->Release();
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysStateChange::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_deactivaterfforemergencycall.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_deactivaterfforemergencycall.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -22,6 +22,9 @@
 #include "tcmd_step_deactivaterfforemergencycall.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmddeactivaterfforemergencycall.h"
+#include <e32property.h>
+const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestDeactivateRfForEmergencyCall::~CCustomCmdTestDeactivateRfForEmergencyCall()
 	{
@@ -41,6 +44,11 @@
 	{
 	_LIT(KTESTLOG, "TestCustomCmdDeactivateRfForEmergencyCallL");
 	INFO_PRINTF1(KTESTLOG);
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+	TInt err = RProperty::Define(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, RProperty::EInt);
+	TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
 
 	//Create Deactivate Rf For Emergency Call custom command
 	MSsmCustomCommand* customCmdDeactivateRfForEmergencyCall = CCustomCmdDeactivateRfForEmergencyCall::NewL();
@@ -56,12 +64,12 @@
 	//Command parameter is not used inside the Execute. So passing any dummy data should be fine
 	//Execute the command
 	customCmdDeactivateRfForEmergencyCall->Execute(dummy, status);
-	TEST(KRequestPending == status.Int());
 
+	
 	//Wait for the request to be completed
 	User::WaitForRequest(status);
 	TEST(KErrNone == status.Int());
-
+	
 	//Execute the command once again
 	customCmdDeactivateRfForEmergencyCall->Execute(dummy, status);
 
@@ -72,12 +80,14 @@
 	//is called it might have completed executing Execute() function. Thats is the reason for 
 	//checking the status to KErrNone instead of KErrCancel.
 	TEST(KErrNone == status.Int());
-
+	
 	//Close the command
 	customCmdDeactivateRfForEmergencyCall->Close();
 
 	//Releasing the comand will delete itself.
 	customCmdDeactivateRfForEmergencyCall->Release();
+	err = RProperty::Delete(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey);
+	TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestDeactivateRfForEmergencyCall::doTestStepL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_devicesecuritycheck.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_devicesecuritycheck.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -23,6 +23,11 @@
 #include "ssmsecuritychecknotifier.h"
 #include "ssmuiproviderdll.h"
 #include "ssmcustomcmdfactory.h"
+#include <w32std.h>
+#include <s32file.h>
+
+const TUid KPropertyCategory={0x2000D75B}; 
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
 
 CCustomCmdTestDeviceSecurityCheck::~CCustomCmdTestDeviceSecurityCheck()
 	{
@@ -44,6 +49,10 @@
 	iActiveScheduler = new(ELeave) CActiveScheduler;
 	CActiveScheduler::Install (iActiveScheduler);
 	iActiveSchedulerWait = new(ELeave) CActiveSchedulerWait;
+	TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+	TEST(KErrNone == err || KErrAlreadyExists == err);
+	err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+	TEST(KErrNone == err);
 
 	//Needed for calling calback for stopping active scheduler
 	iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
@@ -52,12 +61,20 @@
 
 TVerdict CCustomCmdTestDeviceSecurityCheck::doTestStepPostambleL()
 	{
+	TInt err = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
+	TEST(KErrNone == err);
 	return CTestStep::doTestStepPostambleL();
 	}
 
 void CCustomCmdTestDeviceSecurityCheck::SimulatePasswordEntry()
 	{
-	//Simulate the key press ,(comma) in to pin notifier dialogue
+    RWsSession wsSession;
+    TInt err = wsSession.Connect();
+    TEST(KErrNone == err);
+    
+    const TInt okButtonPos1 = 60; //the position of ok button
+    const TInt okButtonPos2 = 600; //the position of ok button
+    //Simulate the key press ,(comma) in to pin notifier dialogue
 	TRawEvent eventDown;
 	TRawEvent eventUp;
 
@@ -80,11 +97,14 @@
 		iWrongPwd = EFalse;
 		}
 
-	eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter);
-	UserSvr::AddEvent(eventDown);
-	eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter);
-	UserSvr::AddEvent(eventUp);
-	User::After(100000);
+    eventDown.Set(TRawEvent::EButton1Down, okButtonPos1,okButtonPos2);
+    UserSvr::AddEvent(eventDown);
+    eventUp.Set(TRawEvent::EButton1Up, okButtonPos1,okButtonPos2);
+    UserSvr::AddEvent(eventUp);
+    User::After(100000);
+    
+    wsSession.Flush();
+    wsSession.Close();
 	}
 
 static TInt CallBackL(TAny* aCCustomCmdTestSimSecurityCheck)
@@ -145,13 +165,9 @@
 
 	TestLockPhoneDeviceRespReceivedHelperL();
 
-#ifdef __WINS__
 	INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
 	TEST(KErrNone == iRequest.Int());
-#else
-	INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
-	TEST(KErrNotSupported == iRequest.Int());
-#endif
+
 	}
 
 void CCustomCmdTestDeviceSecurityCheck::TestLockPhoneDeviceRespReceived2L()
@@ -160,14 +176,16 @@
 	iCustomCmdDevSecurityCheck->iLockInfo.iStatus = RMobilePhone::EStatusLockUnknown;
 
 	TestLockPhoneDeviceRespReceivedHelperL();
-	INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
-	TEST(KErrNotSupported == iRequest.Int());
+
 
-/*#ifdef __WINS__
-	TEST(KErrNone == iRequest.Int());
+#ifdef __WINS__
+	INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
+	TEST(KErrNotFound == iRequest.Int());
 #else
-	TEST(KErrNotSupported == iRequest.Int());
-#endif*/
+    INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
+	TEST(KErrNone == iRequest.Int());
+#endif
+    INFO_PRINTF1(_L("TestLockPhoneDeviceRespReceived2L"));
 	}
 
 void CCustomCmdTestDeviceSecurityCheck::TestLockPhoneDeviceRespReceived3L()
@@ -224,8 +242,13 @@
 	iAsyncStopScheduler->CallBack();
 	iActiveSchedulerWait->Start();
 
-	INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
-	TEST(KErrNotSupported == iRequest.Int());
+#ifdef __WINS__
+    INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());
+	TEST(KErrNotFound == iRequest.Int());
+#else
+    INFO_PRINTF3(_L("Result at line %d is %d "),__LINE__ + 1, iRequest.Int());	
+    TEST(KErrNone == iRequest.Int());
+#endif
 	}
 
 void CCustomCmdTestDeviceSecurityCheck::TestLockPhoneToIccRespReceivedHelperL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_execute.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_execute.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// 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"
@@ -21,6 +21,9 @@
 */
 
 #include "tcmd_step_execute.h"
+#include <e32property.h>
+const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C;
+const TUid KPropertyCategory={0x2000D75B};
 
 /**
  This function is wrapped in  Callback and used to stop the CActiveScheduler
@@ -84,19 +87,29 @@
 void CTestCustomCmdExecute::TestCustomCmdValidateRTC()
     {
     INFO_PRINTF1(_L("TestCustomCmdValidateRTC started"));
+    // Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KRtcAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
+    
     //Create ValidateRTC custom command
     MSsmCustomCommand* customCmdValidateRTC = SsmCustomCmdFactory::CmdValidateRTCNewL();
     customCmdValidateRTC->Initialize(iCmdEnv);
     ExecuteCommand(customCmdValidateRTC);
+    // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same
     TEST(KErrNotSupported == iStatus.Int());
     ExecuteCommand(customCmdValidateRTC);
     customCmdValidateRTC->ExecuteCancel();
+    // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same
     TEST(KErrNotSupported == iStatus.Int());
     //Close the command
     customCmdValidateRTC->Close();
     //Releasing the comand will delete itself.
     customCmdValidateRTC->Release();
-    INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNotSupported);
+    INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNone);
+    err = RProperty::Delete(KPropertyCategory, KRtcAdaptationPluginPropertyKey);
+    TEST(KErrNone == err);
     }
 
 /**
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_publishstartupmode.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_publishstartupmode.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -38,6 +38,8 @@
 //Exe name which defines startup PS keys
 _LIT (KExeToDefineStartUpPS, "\\sys\\bin\\definestartupps.exe");
 _LIT(KStartUpPSKeys, "startupkeys");
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestPublishStartupMode::~CCustomCmdTestPublishStartupMode()
 	{
@@ -93,11 +95,17 @@
     
         //Needed for calling callback for stopping active scheduler
         iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
-    
+        
+        // Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+        TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+        TEST(KErrNone == err || KErrAlreadyExists == err);
+        err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+        TEST (KErrNone == err);
+
         INFO_PRINTF1(_L("Define global startup mode property"));
     
         //Start the test exe which defines startup related property keys
-        TInt err = process.Create(KExeToDefineStartUpPS, KStartUpPSKeys());
+        err = process.Create(KExeToDefineStartUpPS, KStartUpPSKeys());
         INFO_PRINTF2(_L("Define global startup mode property process created with %d"), err);
         TEST(KErrNone == err);
         User::LeaveIfError(err);
@@ -116,6 +124,11 @@
 
 TVerdict CCustomCmdTestPublishStartupMode::doTestStepPostambleL()
 	{
+	if (iTestStepName == KTestPublishStartupModeWithCap)
+	    {
+	    TInt err = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
+	    TEST (KErrNone == err);
+	    }
 	return CTestStep::doTestStepPostambleL();
 	}
 
@@ -201,8 +214,8 @@
 	TEST(iRequestStatus == KErrNone);
 	
     err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSGlobalStartupMode, startUpMode);
-    INFO_PRINTF3(_L("Startup mode is %d ; Expected %d"), startUpMode, 0);
-    TEST(startUpMode == 0);
+    INFO_PRINTF3(_L("Startup mode is %d ; Expected %d"), startUpMode, EStartupModeNormal);
+    TEST(startUpMode == EStartupModeNormal);
 	
     // Hidden Reset functionality is not supported in techview\hrp, so the request will be completed with KErrNotSupported
     // And the hidden reset reason would same as we set in the test code, ie., ENormalStartup.
@@ -230,6 +243,7 @@
 void CCustomCmdTestPublishStartupMode::doTestFactoryCreateAndExecuteCancelL()
 	{
 	INFO_PRINTF1(_L("Entering test for factory create, execute cancel and destroy"));
+		
 	__UHEAP_MARK;
 	
 	INFO_PRINTF1(_L("Testing factory create for publish startup mode"));
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_simsecuritycheck.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_simsecuritycheck.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -40,6 +40,9 @@
 // Use to write the PIN Check Security test case nos.
 _LIT(KTestCmdSecurityCheckTestFile, "c:\\cmdsecuritychecktest\\pinchecksecuritycaseno.txt");
 
+const TUid KPropertyCategory={0x2000D75B};
+const TUint32 KMiscPluginPropertyKey = 0x2000E658;
+
 static TInt CallBack2L(TAny* aCCustomCmdTestSecurityCheck);
 
 CCustomCmdTestSimSecurityCheck::~CCustomCmdTestSimSecurityCheck()
@@ -65,6 +68,14 @@
 	
 	//Needed fro calling calback for stopping active scheduler
 	iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
+	
+    TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt);
+	INFO_PRINTF2(_L("Define Test Property returns : %d "), err);
+	TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1);
+	INFO_PRINTF2(_L("Set Test Property returns : %d "), err);
+	TEST(KErrNone == err);
+
 
 	RProcess processHandle;
 	CleanupClosePushL(processHandle);
@@ -98,7 +109,7 @@
 	
 	//connect to file server
 	User::LeaveIfError(iFs.Connect());
-	TInt err = iFs.MkDirAll(KDirNameOfTestCasesNumFile);
+	err = iFs.MkDirAll(KDirNameOfTestCasesNumFile);
 	if (KErrAlreadyExists != err && KErrNone != err)
 		{
 		INFO_PRINTF1(_L("Leaving as it could not create directory"));
@@ -125,6 +136,8 @@
 	{
 	iFs.Delete(KTestCmdSecurityCheckTestFile);
 	iFs.Close();
+	TInt err = RProperty::Delete(KPropertyCategory, KMiscPluginPropertyKey);
+	TEST(KErrNone == err);
 	return CTestStep::doTestStepPostambleL();
 	}
 
@@ -170,9 +183,11 @@
 	
 	TUid uid1 = CSsmUiSpecific::StartupPSUid();
 	TEST(KPSStartupUid == uid1);
+	INFO_PRINTF3(_L("Test GeneralL : KPSStartupUid = %d ; Got from CSsmUiSpecific::StartupPSUid = %d "), KPSStartupUid, uid1);
 
 	TUid uid2 = CSsmUiSpecific::SecurityPinNotifierUid();
 	TEST(KSecurityPinNotifierUid == uid2);
+	INFO_PRINTF3(_L("Test GeneralL : KSecurityPinNotifierUid = %d ; Got from CSsmUiSpecific::SecurityPinNotifierUid = %d "), KPSStartupUid, uid2);
 	
 	TEST( CSsmUiSpecific::IsSimlessOfflineSupported() );
 	
@@ -953,6 +968,8 @@
 
 void CCustomCmdTestSimSecurityCheck::SimulatePasswordEntry()
 	{
+    const TInt okButtonPos1 = 60; //the position of ok button
+    const TInt okButtonPos2 = 600; //the position of ok button
 	TRawEvent eventDown;
 	TRawEvent eventUp;
 
@@ -963,11 +980,11 @@
 	UserSvr::AddEvent(eventUp);
 	User::After(100000);
 
-	eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter);
-	UserSvr::AddEvent(eventDown);
-	eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter);
-	UserSvr::AddEvent(eventUp);
-	User::After(100000);
+    eventDown.Set(TRawEvent::EButton1Down, okButtonPos1,okButtonPos2);
+    UserSvr::AddEvent(eventDown);
+    eventUp.Set(TRawEvent::EButton1Up, okButtonPos1, okButtonPos2);
+    UserSvr::AddEvent(eventUp);
+    User::After(100000);
 	}
 
 void CCustomCmdTestSimSecurityCheck::CallBack3RunL()
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/testpinnotifierplugin.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/testpinnotifierplugin.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -21,13 +21,13 @@
 
 #include "testpinnotifierplugin.h"
 #include <ssm/ssmuiproviderdll.h>
-#include <techview/eikdialg.h>
+#include <eikdialg.h>
 #include <testpinnotifier.rsg>
 #include <bautils.h>
 #include <eikenv.h>
 #include <uikon.hrh>
 #include <ecom/implementationproxy.h>
-#include <techview/eikseced.h>
+#include <eikseced.h>
 #include <e32property.h>
 
 const TUint KCustomcmdServerPropertyKey = 0x0012AC;
@@ -36,8 +36,6 @@
 _LIT(KPinNotifierResFileNameAndPath,"\\resource\\apps\\testpinnotifier.rsc");
 _LIT(KPinNotifierTitle,"Security Check");
 
-//Hardcoding security pin code.
-_LIT(KPinCode,","); 
 
 CArrayPtr<MEikSrvNotifierBase2>* NotifierArrayL()
 	{
@@ -69,8 +67,12 @@
 
 CSecurityPinNotifier::TNotifierInfo CSecurityPinNotifier::RegisterL()
 	{
-	iInfo.iUid = CSsmUiSpecific::SecurityPinNotifierUid();
-	iInfo.iChannel = CSsmUiSpecific::ScreenOutputChannelUid();
+	const TUid KSecurityPinNotifierUid = {0x2000E667};
+	iInfo.iUid = KSecurityPinNotifierUid;
+
+	const TUid KScreenOutputChannel = {0x10009D48};	
+	iInfo.iChannel = KScreenOutputChannel;
+
 	iInfo.iPriority = ENotifierPriorityVHigh;
 	return iInfo;
 	}
@@ -160,19 +162,7 @@
 	securityResultBuffer = KErrGeneral; 
 	if (iMessage != RMessagePtr2())
 		{
-   		TBuf<5> newPINValueVerify;
-
-   		//Get pinter for the secret editor control
-   		CEikSecretEditor* pinEditor = static_cast<CEikSecretEditor*>(Control(0));
-   		pinEditor->GetText(newPINValueVerify);
-
-		//Verify the entered pin number
-		if(0 == newPINValueVerify.Compare(KPinCode))
-			{
-			securityResultBuffer = KErrNone;
-			}
-
-		pinEditor->Reset();	
+   		securityResultBuffer = KErrNone;
 		iMessage.Write(iReplySlot,securityResultBuffer);
 		iMessage.Complete(KErrNone);	
 		// Set this swp to indicate to stop the active schaduler
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemhealthmanagement/layers.sysdef.xml	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset 
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED  
+  span CDATA #IMPLIED
+  level CDATA #IMPLIED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>
+  <!ENTITY layer_real_source_path "sf/os/devicesrv/systemhealthmanagement" >
+]>
+
+<SystemDefinition name="Dvscode" schema="1.4.0">
+  <systemModel>
+    <layer name="os_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="systemhealthmgr" unitID="sos.systemhealthmgr" bldFile="&layer_real_source_path;/systemhealthmgr/group" mrp="&layer_real_source_path;/systemhealthmgr/group/app-framework_shma.mrp"/>
+		</module>
+    </layer>
+	
+	<layer name="api_test_layer">
+		<module name="DeviceSrv_DFS">
+			<unit name="systemhealthmgr" unitID="sos.systemhealthmgr_test" bldFile="&layer_real_source_path;/systemhealthmgr/group" mrp="&layer_real_source_path;/systemhealthmgr/group/app-framework_shma.mrp"/>
+		</module>
+	</layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemhealthmanagement/systemhealthmgr/test/trestartsys/group/shmatest_trestartsys.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Shmatest_TRestartSys EN"}
+
+; Vendor name
+: "Shmatest_TRestartSys"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\trestartsys\scripts\shmatest_restartsyswithmode.script"-"c:\devicesrv\shmatest\shmatest_restartsyswithmode.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\trestartsys\scripts\shmatest_restartsysabort.script"-"c:\devicesrv\shmatest\shmatest_restartsysabort.script"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemhealthmanagement/systemhealthmgr/test/tstartsafe/group/shmatest_tstartsafe.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,43 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Shmatest_TStartSafe EN"}
+
+; Vendor name
+: "Shmatest_TStartSafe"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_appasynchstart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_appasynchstart.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_appretry.script"-"c:\devicesrv\shmatest\shmatest_startsafe_appretry.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_appstart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_appstart.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_appstartapparcinit.script"-"c:\devicesrv\shmatest\shmatest_startsafe_appstartapparcinit.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_apptimeout.script"-"c:\devicesrv\shmatest\shmatest_startsafe_apptimeout.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_apptimesucc.script"-"c:\devicesrv\shmatest\shmatest_startsafe_apptimesucc.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procasynchstart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procasynchstart.script"
+;"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procfailsysrestart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procfailsysrestart.script"
+;"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procmonsysrestart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procmonsysrestart.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procretry.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procretry.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procstart.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procstart.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procstartmon.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procstartmon.script"
+;"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_proctimeout.script"-"c:\devicesrv\shmatest\shmatest_startsafe_proctimeout.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_proctimesucc.script"-"c:\devicesrv\shmatest\shmatest_startsafe_proctimesucc.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_errors.script"-"c:\devicesrv\shmatest\shmatest_startsafe_errors.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_appstartrverror.script"-"c:\devicesrv\shmatest\shmatest_startsafe_appstartrverror.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartsafe\scripts\shmatest_startsafe_procstartrverror.script"-"c:\devicesrv\shmatest\shmatest_startsafe_procstartrverror.script"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemhealthmanagement/systemhealthmgr/test/tstartupproperties/group/shmatest_tstartupproperties.pkg	Tue Jul 06 15:43:30 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Shmatest_TStartupProperties EN"}
+
+; Vendor name
+: "Shmatest_TStartupProperties"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartupproperties\scripts\shmatest_startupproperties_defval.script"-"c:\devicesrv\shmatest\shmatest_startupproperties_defval.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tstartupproperties\scripts\shmatest_startupproperties_internalexternal.script"-"c:\devicesrv\shmatest\shmatest_startupproperties_internalexternal.script"
+
--- a/systemhealthmanagement/systemhealthmgr/test/tsysmon/data/tsysmon.ini	Wed Jun 23 19:38:32 2010 +0300
+++ b/systemhealthmanagement/systemhealthmgr/test/tsysmon/data/tsysmon.ini	Tue Jul 06 15:43:30 2010 +0300
@@ -58,7 +58,7 @@
 Filename=sysmontest_register_protserv+powermgmt.exe
 Policy=ERestartOSWithMode
 Mode=0
-ExpectedResult=0
+ExpectedResult=-5
 TestDereg=true
 DeregExpectedResult=0
 
@@ -82,7 +82,7 @@
 Filename=sysmontest_selfregister_protserv+powermgmt.exe
 Policy=ERestartOSWithMode
 Mode=0
-ExpectedResult=0
+ExpectedResult=-5
 TestDereg=true
 DeregExpectedResult=0
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemhealthmanagement/systemhealthmgr/test/tsysmon/group/shmatest_tsysmon.pkg	Tue Jul 06 15:43:30 2010 +0300
@@ -0,0 +1,63 @@
+;
+; 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: 
+;
+
+;Languages
+&EN
+
+
+;Localised Vendor name
+%{"Shmatest_TSysMon EN"}
+
+; Vendor name
+: "Shmatest_TSysMon"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_procmoninit.script"-"c:\devicesrv\shmatest\shmatest_sysmon_procmoninit.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_multiprocmon.script"-"c:\devicesrv\shmatest\shmatest_sysmon_multiprocmon.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_procrestart.script"-"c:\devicesrv\shmatest\shmatest_sysmon_procrestart.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_restartthrottle.script"-"c:\devicesrv\shmatest\shmatest_sysmon_restartthrottle.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_procmonignore.script"-"c:\devicesrv\shmatest\shmatest_sysmon_procmonignore.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_selfmonignore.script"-"c:\devicesrv\shmatest\shmatest_sysmon_selfmonignore.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_noprocmon.script"-"c:\devicesrv\shmatest\shmatest_sysmon_noprocmon.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_selfmoncancel.script"-"c:\devicesrv\shmatest\shmatest_sysmon_selfmoncancel.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_selfmoncancel2.script"-"c:\devicesrv\shmatest\shmatest_sysmon_selfmoncancel2.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_nomoncancel.script"-"c:\devicesrv\shmatest\shmatest_sysmon_nomoncancel.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_loadsysmon.script"-"c:\devicesrv\shmatest\shmatest_sysmon_loadsysmon.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_oom.script"-"c:\devicesrv\shmatest\shmatest_sysmon_oom.script"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_conndiscon.script"-"c:\devicesrv\shmatest\shmatest_sysmon_conndiscon.script"
+
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_reg1proctwice.script"-"c:\devicesrv\shmatest\shmatest_sysmon_reg1proctwice.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_reg2procs.script"-"c:\devicesrv\shmatest\shmatest_sysmon_reg2procs.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeiofcapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeiofcapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeiofcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeiofcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeroscapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeroscapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeroscapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeroscapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeroswmcapsnopm.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeroswmcapsnopm.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeroswmcapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeroswmcapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regeroswmcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regeroswmcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselfeiofcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselfeiofcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselferoscapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselferoscapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselferoscapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselferoscapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselferoswmcapsnopm.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselferoswmcapsnopm.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselferoswmcapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselferoswmcapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselferoswmcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselferoswmcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regcritical.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regcritical.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regecnorcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regecnorcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regecnorcapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regecnorcapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselfecnorcapsok.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselfecnorcapsok.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_regselfecnorcapsnops.script"-"c:\devicesrv\shmatest\shmatest_sysmon_regselfecnorcapsnops.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_cancelallmonitors.script"-"c:\devicesrv\shmatest\shmatest_sysmon_cancelallmonitors.script"
+"\sf\os\devicesrv\systemhealthmanagement\systemhealthmgr\test\tsysmon\scripts\shmatest_sysmon_cancelallmonwithssmsid.script"-"c:\devicesrv\shmatest\shmatest_sysmon_cancelallmonwithssmsid.script"
--- a/systemhealthmanagement/systemhealthmgr/test/tsysmon/src/tsysmon_stepcancelallmonitors.cpp	Wed Jun 23 19:38:32 2010 +0300
+++ b/systemhealthmanagement/systemhealthmgr/test/tsysmon/src/tsysmon_stepcancelallmonitors.cpp	Tue Jul 06 15:43:30 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 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"
@@ -176,6 +176,7 @@
         iAppStartSignalSem.Wait();
 
         INFO_PRINTF2(_L("Process killed with %d"), err);
+        User::After(2000000);
         TEST(EFalse == Exists(KTestAppGood));
         }