201033_01
authorhgs
Mon, 23 Aug 2010 14:47:20 +0300
changeset 59 0f7422b6b602
parent 52 d6b9e89d80a3
child 64 61992147389a
201033_01
accessoryservices/accessoryserver/inc/Server/AccSrvServerModel.h
accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp
accessoryservices/accessoryserver/src/Server/AccSrvServerModel.cpp
accessoryservices/accessoryserver/src/Server/AccSrvSubControl.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp
commonservices/commonengine/conf/ci_commonengine.confml
commonservices/commonengine/conf/commonengine.confml
commonservices/commonengine/config/export.mk
commonservices/commonengine/group/bld.inf
mediator/inc/Server/MediatorServerObjects.h
mediator/src/Client/MediatorServerClient.cpp
mediator/src/Server/MediatorServerObjects.cpp
package_definition.xml
package_definition_v2.xml
package_map.xml
psmservices/psmserver/inc/client/psmclientimpl.h
psmservices/psmserver/inc/engine/psmmanager.h
psmservices/psmserver/inc/server/psmsrvmessage.h
psmservices/psmserver/inc/server/psmsrvsession.h
psmservices/psmserver/inc/util/psmclientserver.h
psmservices/psmserver/src/client/psmclientimpl.cpp
psmservices/psmserver/src/engine/psmbackupstorage.cpp
psmservices/psmserver/src/engine/psmmanager.cpp
psmservices/psmserver/src/engine/psmsettingshandler.cpp
psmservices/psmserver/src/engine/psmstorage.cpp
psmservices/psmserver/src/server/psmsrvmessage.cpp
psmservices/psmserver/src/server/psmsrvsession.cpp
psmservices/psmserver/tsrc/PsmTestModule/conf/PsmTestModule.cfg
psmservices/psmserver/tsrc/PsmTestModule/group/PsmTestModule.mmp
psmservices/psmserver/tsrc/PsmTestModule/inc/PSMTest.h
psmservices/psmserver/tsrc/PsmTestModule/src/PSMTestBlocks.cpp
resourcemgmt/data/bld.inf
resourcemgmt/group/bld.inf
resourcemgmt/hwresourcesmgrconfig/bld.inf
resourcemgmt/hwresourcesmgrconfig/conf/ci_hwresourcesandenhancements.confml
resourcemgmt/hwresourcesmgrconfig/conf/hwresourcesandenhancements.confml
resourcemgmt/hwrmtargetmodifierplugin/group/bld.inf
sensorservices/orientationssy/inc/OrientationCRListener.h
sensorservices/orientationssy/inc/SsyOrientation.h
sensorservices/orientationssy/src/OrientationCRListener.cpp
sensorservices/orientationssy/src/SsyChannel.cpp
sensorservices/orientationssy/src/SsyControlOrientation.cpp
sensorservices/orientationssy/src/SsyOrientation.cpp
sensorservices/orientationssy/src/SsyProperty.cpp
sensorservices/sensorserver/inc/server/senserverchannel.h
sensorservices/sensorserver/src/server/sensrvchannel.cpp
sensorservices/sensorserver/src/server/sensrvpluginproxy.cpp
sensorservices/sensorserver/src/server/sensrvproxymanager.cpp
sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h
sensorservices/tiltcompensationssy/inc/tcstatetiltlistendata.h
sensorservices/tiltcompensationssy/src/tccenrepobserver.cpp
sensorservices/tiltcompensationssy/src/tcchanneltilt.cpp
sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp
sensorservices/tiltcompensationssy/src/tcstatetiltidle.cpp
sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp
sysstatemgmt/systemstarter/group/loadamastart.mmp
sysstatemgmt/systemstarter/inc/loadamastart.h
sysstatemgmt/systemstarter/src/StartupSplashScreen.cpp
sysstatemgmt/systemstarter/test/tamastarter/group/tamastarter_server.mmp
sysstatemgmt/systemstarter/test/tamastarter/resource/emulator/tamastarter_amaadder_ssma.rss
sysstatemgmt/systemstarter/test/tamastarter/resource/hardware/tamastarter_amaadder_ssma.rss
sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistimpl.cpp
sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistresourcereaderimpl.cpp
sysstatemgmt/systemstatemgr/ssm/src/ssmsession.cpp
sysstatemgmt/systemstatemgr/sus/src/susmiscadaptation.cpp
sysstatemgmt/systemstateplugins/conditionevaluator/src/cndsystemwideproperty.cpp
sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyfail.mmp
sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicynormal.mmp
sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyshutdown.mmp
sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicystartup.mmp
sysstatemgmt/systemstateplugins/gsapolicy/group/sspluginsgsa.iby
sysstatemgmt/tsrc/public/basic/group/MT_SysLangUtil.mmp
sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession_DllMain.cpp
--- a/accessoryservices/accessoryserver/inc/Server/AccSrvServerModel.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/accessoryserver/inc/Server/AccSrvServerModel.h	Mon Aug 23 14:47:20 2010 +0300
@@ -187,9 +187,9 @@
         *
         * @since S60 3.1
         * @param aGenericID Generic ID of the detected accessory.
-        * @return void
+        * @return index in the array
         */
-        void RemovePhysicalConnection( const TAccPolGenericID& aGenericID );
+        TInt RemovePhysicalConnection( const TAccPolGenericID& aGenericID );
 
         /**
         * Get current connection status, ie. all active connections.
--- a/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -698,14 +698,16 @@
     {
     COM_TRACE_( "[AccFW:AccServer] CAccSrvConnectionController::PromoteToConnectedL()" );
 
-    iServerModel->RemovePhysicalConnection( aGenericID ); //Move GID from physical connection array
-    iServerModel->AddConnectionL( aGenericID );            //to connection array
+    if( KErrNotFound != iServerModel->RemovePhysicalConnection( aGenericID )) //Move GID from physical connection array
+      {
+	    iServerModel->AddConnectionL( aGenericID );            //to connection array
 
-    iNotificationQueue->CompleteControlMessageL( ENewAccessoryConnected,
-                                                 KErrNone,
-                                                 aGenericID.UniqueID() );
+	    iNotificationQueue->CompleteControlMessageL( ENewAccessoryConnected,
+	                                                 KErrNone,
+	                                                 aGenericID.UniqueID() );
 
-    iConnectionStatusHandler->IssueRequest();
+	    iConnectionStatusHandler->IssueRequest();
+	  }
 
     COM_TRACE_( "[AccFW:AccServer] CAccSrvConnectionController::PromoteToConnectedL - return void" );
     }
--- a/accessoryservices/accessoryserver/src/Server/AccSrvServerModel.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvServerModel.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -316,7 +316,7 @@
 // CAccSrvServerModel::RemovePhysicalConnectionL
 // -----------------------------------------------------------------------------
 //
-void CAccSrvServerModel::RemovePhysicalConnection( const TAccPolGenericID& aGenericID )
+TInt CAccSrvServerModel::RemovePhysicalConnection( const TAccPolGenericID& aGenericID )
     {
     COM_TRACE_( "[AccFW:AccServer] CAccSrvServerModel::RemovePhysicalConnection()" );
 
@@ -329,7 +329,9 @@
         iPhysicalConnectionArray.Remove( index );
         }
 
-    COM_TRACE_( "[AccFW:AccServer] CAccSrvServerModel::RemovePhysicalConnection - return void" );
+    COM_TRACE_1( "[AccFW:AccServer] CAccSrvServerModel::RemovePhysicalConnection - return %d", index );
+
+	return index;
     }
 
 // -----------------------------------------------------------------------------
--- a/accessoryservices/accessoryserver/src/Server/AccSrvSubControl.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvSubControl.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -235,12 +235,18 @@
             }
         else
             {
-            err = notifier.StartNotifier( KAccFwUiNoteNotifierUid, KNullDesC8 );
-            if ( err != KErrNone )
-                {
-                COM_TRACE_1( "[AccFW:AccServer] CAccSrvSubControl::ConnectAccessoryL - Couldn't start notifier: err = %d", err);	
-                }
-            notifier.Close();
+            TPckg<TInt>iReplyPck(0);
+			TRequestStatus iStatus =KRequestPending;
+			notifier.StartNotifierAndGetResponse(iStatus,
+						KAccFwUiNoteNotifierUid,
+						KNullDesC8,iReplyPck);
+			User::WaitForRequest(iStatus);
+			err = iStatus.Int();
+			if(KErrNone != err) 
+				{
+				COM_TRACE_1( "[AccFW:AccServer] CAccSrvSubControl::ConnectAccessoryL - Couldn't start notifier: err = %d", err);				
+				}
+			notifier.Close();
             }
 	    }
     else
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -193,7 +193,7 @@
         {
         hdmiSink = CAccPolHdmiSink::NewL(
             iExtensionParserPtr->BasicAudio(),
-            iTVOutConfigForHDMI.GetTvOutConfig()->CopyProtectionStatus() );
+            ETrue );
         }
     else
         {
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestateconnected.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -829,13 +829,13 @@
             {
             INFO( "Event: EIfAsyCommandHandlerEventSetCopyProtectionOn" );
             TInt retVal = iTVOutConfigForCopyProtect->GetTvOutConfig()->CopyProtection( ETrue );
-            iHDMICableStatusFSM.CopyProtectionSettingDone( retVal );
+            iHDMICableStatusFSM.CopyProtectionSettingDone( retVal, iTVOutConfigForCopyProtect->GetTvOutConfig()->CopyProtectionStatus() );
             }
         else if ( EIfAsyCommandHandlerEventSetCopyProtectionOff == aEvent )
             {
             INFO( "Event: EIfAsyCommandHandlerEventSetCopyProtectionOff" );
             TInt retVal = iTVOutConfigForCopyProtect->GetTvOutConfig()->CopyProtection( EFalse );
-            iHDMICableStatusFSM.CopyProtectionSettingDone( retVal );
+            iHDMICableStatusFSM.CopyProtectionSettingDone( retVal, iTVOutConfigForCopyProtect->GetTvOutConfig()->CopyProtectionStatus() );
             }
         else if ( EIfAsyCommandHandlerEventGetCopyProtectStatus == aEvent )
             {
Binary file commonservices/commonengine/conf/ci_commonengine.confml has changed
Binary file commonservices/commonengine/conf/commonengine.confml has changed
--- a/commonservices/commonengine/config/export.mk	Tue Aug 10 14:46:45 2010 +0300
+++ b/commonservices/commonengine/config/export.mk	Mon Aug 23 14:47:20 2010 +0300
@@ -21,6 +21,7 @@
 $(call push,MAKEFILE_STACK,$(MAKEFILE))
 
 CONFFILES =		$(MAKEFILEDIR)../conf/commonengine.confml              	$(EPOCROOT)/epoc32/rom/config/confml_data/s60/ \
+			$(MAKEFILEDIR)../conf/ci_commonengine.confml            $(EPOCROOT)/epoc32/rom/config/confml_data/s60/ \
 							$(MAKEFILEDIR)../conf/commonengine_1020503B.crml 	     	$(EPOCROOT)/epoc32/rom/config/confml_data/s60/
 		
 commonengine_config					:: commonengine_config-conf
--- a/commonservices/commonengine/group/bld.inf	Tue Aug 10 14:46:45 2010 +0300
+++ b/commonservices/commonengine/group/bld.inf	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2007 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"
@@ -23,6 +23,7 @@
 PRJ_EXPORTS
 //Configuration tool migration
 ../conf/commonengine.confml          	OS_LAYER_CONFML(commonengine.confml)
+../conf/ci_commonengine.confml          	OS_LAYER_CONFML(ci_commonengine.confml)
 ../conf/commonengine_1020503B.crml 	  OS_LAYER_CRML(commonengine_1020503B.crml)
 ../rom/diskspacereserver.iby            CORE_OS_LAYER_IBY_EXPORT_PATH(diskspacereserver.iby)
 
--- a/mediator/inc/Server/MediatorServerObjects.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/mediator/inc/Server/MediatorServerObjects.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005 - 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"
@@ -827,14 +827,7 @@
         */  
         RPointerArray<MMediatorServerEventObserver>& GetObservers();
         
-        /**
-        * Adds an array of observers to event
-        * @since S60 3.1
-        * @param aObservers reference to observer array
-        * @return None.
-        */      
-        void AddObservers( RPointerArray<MMediatorServerEventObserver>& aObservers );
-        
+              
         /**
         * Gets TEvent structure of the current event
         * @since S60 3.1
--- a/mediator/src/Client/MediatorServerClient.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/mediator/src/Client/MediatorServerClient.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
@@ -465,7 +465,7 @@
     command.iCommandId = aCommandId;
     command.iVersion = aVersion;
     //Time out is initiatilized to 0 as its not used on the server side.  
-    //this is just to compress the tool warnings.
+    //this is just to supress the tool warnings.
     command.iTimeout = 0;
     TCommandBuffer commandBuffer( command );
         
@@ -504,6 +504,12 @@
     // And command
     TCommand command;
     command.iCommandId = aCommandId;
+    //All the remaining parameters of TCommand are initiatilized to 0 as its not used on the server side.  
+    //this is just to suppress the tool warnings.
+    command.iVersion = TVersion(0,0,0);
+	command.iCaps.SetEmpty();
+    command.iTimeout = 0;
+
     TCommandBuffer commandBuffer( command );
         
     // Status
@@ -542,6 +548,12 @@
     // And command
     TCommand command;
     command.iCommandId = aCommandId;
+    //All the remaining parameters of TCommand are initiatilized to 0 as its not used on the server side.  
+    //this is just to suppress the tool warnings.
+	command.iVersion = TVersion(0,0,0);
+	command.iCaps.SetEmpty();
+    command.iTimeout = 0;
+
     TCommandBuffer commandBuffer( command );
         
     // Send the command                                 
--- a/mediator/src/Server/MediatorServerObjects.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/mediator/src/Server/MediatorServerObjects.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005 - 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"
@@ -1079,20 +1079,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CEvent::AddObservers
-// 
-// -----------------------------------------------------------------------------
-//
-void CEvent::AddObservers( RPointerArray<MMediatorServerEventObserver>& aObservers )
-    {
-    // Check that observer does not exists already for this event
-    for (TInt index = 0; index < aObservers.Count(); index++ )
-        {
-        iObservers.Append( aObservers[index] );
-        }
-    }
-
-// -----------------------------------------------------------------------------
 // CEvent::Event
 // Returns EItemEvent
 // -----------------------------------------------------------------------------
--- a/package_definition.xml	Tue Aug 10 14:46:45 2010 +0300
+++ b/package_definition.xml	Mon Aug 23 14:47:20 2010 +0300
@@ -1,295 +1,468 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SystemDefinition schema="3.0.0">
-  <package id="devicesrv" name="Device Services" levels="adaptation hw-if plugin framework server app-if">
-    <collection id="accessoryservices" name="Accessory Services" level="framework">
-      <component id="accessorymonitor" filter="s60" name="Accessory Monitor">
-        <unit bldFile="accessoryservices/accessorymonitor/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonconnectionemulator/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonitoringtestmodule/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonitoringtestmodule/tests/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmontesttimer/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/accfwuinotifierstub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/asystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/group"/> -->
-      </component>
-      <component id="accessoryremotecontrol" filter="s60" name="Accessory Remote Control">
-        <unit bldFile="accessoryservices/accessoryremotecontrol/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/remcontestcontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/audio/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/phone/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/remcon/group"/> -->
-      </component>
-      <component id="accessoryserver" filter="s60" name="Accessory Server">
-        <unit bldFile="accessoryservices/accessoryserver/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/accessorytestcontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/accfwuinotifierstub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/asystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/btasystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/group"/> -->
-      </component>
-      <component id="headsetstatusapi" filter="s60" name="Headset Status API">
-        <unit bldFile="accessoryservices/headsetstatusapi/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/headsetstatusapi/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="tspclientmapper" filter="s60" name="TSP Client Mapper">
-        <unit bldFile="accessoryservices/tspclientmapper/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/tspclientmapper/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="remotecontrolfw" name="Remote Control Framework" introduced="9.1" purpose="optional">
-        <unit bldFile="accessoryservices/remotecontrolfw/group" mrp="accessoryservices/remotecontrolfw/group/bluetooth_remotecontrol.mrp"/>
-      </component>
-      <component id="gid_pc_tool" filter="s60" name="Generic ID PC Tool" target="desktop" class="tool">
-	<unit bldFile="accessoryservices/gid_pc_tool/group"/>
-      </component>
-    </collection>
-    <collection id="commonservices" name="Common Services" level="app-if">
-      <component id="commonengine" filter="s60" name="Common Engine">
-        <unit bldFile="commonservices/commonengine/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="commonservices/commonengine/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="commonengineresources" filter="s60" name="Common Engine Resources" class="config">
-        <unit bldFile="commonservices/commonengineresources/group"/>
-      </component>
-      <component id="platformenv" filter="s60" name="Platform Environment">
-        <unit bldFile="commonservices/platformenv/group"/>
-        <!-- <unit bldFile="commonservices/platformenv/disknotifyhandler/group"/> -->
-         <!-- are these bld.infs needed? Can they be included from bld.inf?-->
-        <!-- <unit bldFile="commonservices/platformenv/platformver/group"/> -->
-        <!-- <unit bldFile="commonservices/platformenv/sysversioninfo/group"/> -->
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="commonservices/platformenv/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="sysutil" name="System Utilities" purpose="mandatory" introduced="ER5">
-        <unit bldFile="commonservices/sysutil/group" mrp="commonservices/sysutil/group/sysutil.mrp"/>
-      </component>
-      <component id="activitymanager" name="Activity Manager" purpose="mandatory" introduced="ER5">
-        <unit bldFile="commonservices/activitymanager/group" mrp="commonservices/activitymanager/group/activitymanager.mrp"/>
-      </component>
-    </collection>
-    <collection id="dosservices" name="Domestic Operating System Services" level="hw-if">
-      <component id="dosserver" filter="s60" name="Domestic OS Server">
-        <unit bldFile="dosservices/dosserver/group"/>
-      </component>
-      <component id="commondsy" filter="s60" name="Common DSY" class="plugin">
-        <unit bldFile="dosservices/commondsy/group"/>
-      </component>
-      <component id="dosservices_test" filter="s60" purpose="development" name="DOS Services Test">
-        <!-- is this component needed? If so, can these be #included from a single master test bld.inf?-->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/stubs/dsystub/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/dosservertestplugin/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/group"/> -->
-      </component>
-    </collection>
-    <collection id="resourcemgmt" name="Resource Management" level="hw-if">
-      <component id="serverexe" filter="s60" name="Hardware Resource Manager Server">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/serverexe/group"/> -->
-      </component>
-      <component id="hwrmfmtxwatcherplugin" filter="s60" name="HWRM FM Transmitter Watcher Plugin" class="plugin">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component. Should this be purpose="development" -->
-        <!-- <unit bldFile="resourcemgmt/hwrmfmtxwatcherplugin/group"/> -->
-      </component>
-      <component id="clientdll" filter="s60" name="HWRM Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/clientdll/group"/> -->
-      </component>
-      <component id="commondll" filter="s60" name="HWRM Common">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/commondll/group"/> -->
-      </component>
-      <component id="vibraclientdll" filter="s60" name="Vibra Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/vibraclientdll/group"/> -->
-      </component>
-      <component id="extendedlightclientdll" filter="s60" name="Extended Light Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/extendedlightclientdll/group"/> -->
-      </component>
-      <component id="lightclientdll" filter="s60" name="Light Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/lightclientdll/group"/> -->
-      </component>
-      <component id="fmtxclientdll" filter="s60" name="FM Transmitter Client">
-       <!-- this needs to be resolved with the equivalent in the fmtransmittercontrol component -->
-        <!-- <unit bldFile="resourcemgmt/fmtxclientdll/group"/> -->
-      </component>
-      <component id="hwrmtargetmodifierplugin" filter="s60" name="HWRM Target Modifier Plugin" class="plugin">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component. Should this be purpose="development" -->
-        <!-- <unit bldFile="resourcemgmt/hwrmtargetmodifierplugin/group"/> -->
-        <!-- <unit bldFile="resourcemgmt/hwrmtargetmodifierplugin/tsrc/hwrmtargetmodifierplugintest/group"/> -->
-      </component>
-      <component id="vibractrl" filter="s60" name="Vibra Control" deprecated="9.1">
-        <unit bldFile="resourcemgmt/vibractrl/group"/>
-      </component>
-      <component id="hwresourcesmgr" name="Hardware Resources Manager" introduced="^2" purpose="optional">
-        <unit bldFile="resourcemgmt/hwresourcesmgr/group" mrp="resourcemgmt/hwresourcesmgr/group/telephony_hwrm.mrp"/>
-      </component>
-      <component id="hwresourcesmgrconfig" name="Hardware Resources Manager Config" introduced="^3" purpose="optional" class="config">
-        <unit bldFile="resourcemgmt/hwresourcesmgrconfig" mrp="resourcemgmt/hwresourcesmgrconfig/telephony_hwrm-config.mrp"/>
-      </component>
-      <component id="resourcemgmt_build" filter="s60" name="Resource Management Build">
-         <!-- need to reconcile this with the above components -->
-        <unit bldFile="resourcemgmt/group"/>
-      </component>
-      <component id="resourcemgmt_test" filter="s60" purpose="development" name="Resource Management Test">
-        <!-- is this component needed?-->
-        <!-- <unit bldFile="resourcemgmt/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="powerandmemorynotificationservice" name="Power and Memory Notification Service" introduced="6.0" purpose="mandatory">
-        <unit bldFile="resourcemgmt/powerandmemorynotificationservice/group" mrp="resourcemgmt/powerandmemorynotificationservice/group/syslibs_pwrcli.mrp"/>
-      </component>
-    </collection>
-    <collection id="hwrmhaptics" name="HWRM Haptics" level="plugin">
-      <component id="hapticseffectdatagetterfw" filter="s60" name="Haptics Effect Data Getter Framework">
-        <unit bldFile="hwrmhaptics/hapticseffectdatagetterfw/group"/>
-      </component>
-      <component id="hapticspluginservice" filter="s60" name="Haptics Plugin Service">
-        <unit bldFile="hwrmhaptics/hapticspluginservice/group"/>
-      </component>
-      <component id="hapticspacketizer" filter="s60" name="Haptics Packetizer">
-        <unit bldFile="hwrmhaptics/hapticspacketizer/group"/>
-      </component>
-      <component id="hapticspluginmanager" filter="s60" name="Haptics Plugin Manager">
-        <unit bldFile="hwrmhaptics/hapticspluginmanager/group"/>
-      </component>
-      <component id="hapticsserver" filter="s60" name="Haptics Server">
-        <unit bldFile="hwrmhaptics/hapticsserver/group"/>
-      </component>
-      <component id="hapticsclient" filter="s60" name="Haptics Client">
-        <unit bldFile="hwrmhaptics/hapticsclient/group"/>
-      </component>
-      <component id="hwrmhaptics_build" filter="s60" name="HWRM Haptics Build">
-        <!-- can these exports be put in the appropriate above components? -->
-        <unit bldFile="hwrmhaptics/group"/>
-      </component>
-    </collection>
-    <collection id="mediator" name="Mediator" level="app-if">
-      <component id="mediator_build" filter="s60" name="Mediator Build">
-        <unit bldFile="mediator/group"/>
-      </component>
-      <component id="mediator_test" filter="s60" purpose="development" name="Mediator Test">
-          <!-- need to have a single unit in this component. Either #include one bld.inf from the other or remove the component -->
-        <!-- <unit bldFile="mediator/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="mediator/tsrc/public/basic/stub/group"/> -->
-      </component>
-    </collection>
-    <collection id="psmservices" name="Power Save Mode Services" level="app-if">
-      <component id="psmserver" filter="s60" name="PSM Server">
-        <unit bldFile="psmservices/psmserver/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="psmservices/psmserver/tsrc/public/basic/group"/> -->
-      </component>
-    </collection>
-    <collection id="sensorservices" name="Sensor Services" level="framework">
-      <component id="sensorserver" filter="s60" name="Sensor Server">
-        <unit bldFile="sensorservices/sensorserver/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/condevalstub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/sensrvcondevalplugin/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/ssystub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/stubprocess/group"/> -->
-      </component>
-      <component id="orientationssy" filter="s60" name="Orientation SSY" class="plugin">
-        <unit bldFile="sensorservices/orientationssy/group"/>
-      </component>
-      <component id="tiltcompensationssy" filter="s60" name="Tilt Compensation SSY" class="plugin">
-        <unit bldFile="sensorservices/tiltcompensationssy/group"/>
-      </component>
-      <component id="sensordatacompensator" filter="s60" name="Sensor Data Compensator">
-        <unit bldFile="sensorservices/sensordatacompensator/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sensorservices/sensordatacompensator/tsrc/sensordatacompensatorpluginstub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensordatacompensator/tsrc/sensordatacompensatortest/group"/> -->
-      </component>
-    </collection>
-	<collection id="sysstatemgmt" name="System State Management" level="server">
-      <component id="starter" filter="s60" name="Starter">
-        <unit bldFile="sysstatemgmt/starter/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sysstatemgmt/starter/strtsecnote/group"/> -->
-        <!-- <unit bldFile="sysstatemgmt/starter/strtsecobs/group"/> -->
-      </component>
-      <component id="systemstarter" name="System Starter" introduced="9.1" deprecated="^3" purpose="mandatory">
-        <unit bldFile="sysstatemgmt/systemstarter/group" mrp="sysstatemgmt/systemstarter/group/app-framework_sysstart.mrp"/>
-      </component>
-      <component id="systemstatemgr" name="System State Manager" introduced="^3" purpose="mandatory">
-        <unit bldFile="sysstatemgmt/systemstatemgr/group" mrp="sysstatemgmt/systemstatemgr/group/app-framework_ssma.mrp"/>
-      </component>
-      <component id="systemstateplugins" name="System State Plugins" introduced="^3" purpose="optional" class="plugin">
-        <unit bldFile="sysstatemgmt/systemstateplugins/group" mrp="sysstatemgmt/systemstateplugins/group/app-framework_ssplugins.mrp"/>
-      </component>
-      <component id="systemstatereferenceplugins" name="System State Reference Plugins" introduced="^3" purpose="optional" class="plugin">
-        <unit bldFile="sysstatemgmt/systemstatereferenceplugins/group" mrp="sysstatemgmt/systemstatereferenceplugins/group/app-framework_ssrefplugins.mrp"/>
-      </component>
-      <component id="sysstatemgmt_test" filter="s60" purpose="development" name="System State Management Test">
-        <!-- <unit bldFile="sysstatemgmt/tsrc/public/basic/group"/> -->
-      </component>
-    </collection>
-    <collection id="resourceinterfaces" name="Resource Interfaces" level="hw-if">
-      <component id="fmtransmittercontrol" name="FM Transmitter Control" introduced="^3" purpose="optional">
-        <unit bldFile="resourceinterfaces/fmtransmittercontrol/group" mrp="resourceinterfaces/fmtransmittercontrol/group/telephony_hwrmfmtx.mrp"/>
-      </component>
-    </collection>
-    <collection id="systemhealthmanagement" name="System Health Management" level="server">
-      <component id="systemhealthmgr" name="System Health Manager" introduced="^3" purpose="optional">
-        <unit bldFile="systemhealthmanagement/systemhealthmgr/group" mrp="systemhealthmanagement/systemhealthmgr/group/app-framework_shma.mrp"/>
-      </component>
-    </collection>
-    <collection id="devicesrvapitest" name="Devices Services API Tests" level="app-if">
-      <component id="accessorieshaitest" name="Accessories HAI Tests" introduced="^2" purpose="development" filter="test">
-        <unit mrp="devicesrvapitest/accessorieshaitest/group/accessorieshaitest.mrp" bldFile="devicesrvapitest/accessorieshaitest/group"/>
-      </component>
-      <component id="hwrmhaitest" name="HWRM HAI Tests" introduced="^2" purpose="development" filter="test">
-        <unit mrp="devicesrvapitest/hwrmhaitest/group/hwrmhaitest.mrp" bldFile="devicesrvapitest/hwrmhaitest/group"/>
-      </component>
-    </collection>
-    <collection id="devicesrv_info" name="Device Services Info" level="app-if">
-      <component id="devicesrv_pub" filter="s60" name="Device Services Public Interfaces" class="api">
-        <unit bldFile="devicesrv_pub/group"/>
-        <!-- <unit bldFile="devicesrv_pub/accessory_monitoring_api/tsrc/bc/accmonapibctests/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/feature_discovery_api/tsrc/bc/featurediscovery/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/find_item_api/tsrc/bc/finditem/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/hwrm_power_state_api/tsrc/bc/powerstate/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/light_api/tsrc/bc/light/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/phone_parser_api/tsrc/bc/phoneparser/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/platform_environment_api/tsrc/bc/platformenv/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sensor_channel_api/tsrc/bc/sensor/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sensor_data_compensator_api/tsrc/bc/sensordatacompensatortest/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sysutil_api/tsrc/bc/sysutil/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/text_resolver_api/tsrc/bc/textresolver/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/version_info_api/tsrc/bc/platformvertest/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/vibra_api/tsrc/bc/vibra/group"/> -->
-      </component>
-      <component id="devicesrv_plat" filter="s60" name="Device Services Platform Interfaces" class="api">
-        <unit bldFile="devicesrv_plat/group"/>
-        <!-- <unit bldFile="devicesrv_plat/activity_manager_api/tsrc/group"/> -->
-      </component>
-      <component id="devicesrv_metadata" name="Device Services Metadata" class="config" introduced="^2" purpose="development" target="desktop">
-        <unit mrp="devicesrv_info/devicesrv_metadata/devicesrv_metadata.mrp"/>
-      </component>
-    </collection>
-  </package>
+ <package id="devicesrv" name="Device Services" levels="adaptation hw-if plugin framework server app-if">
+  <collection id="devicesrv_pub" name="Device Services Public Interfaces" level="app-if">
+   <component id="platform_path_definitions_api" name="Platform Path Definitions API" class="api" filter="s60,bldmefirst">
+	<!-- this needs to be moved to deviceplatformrelease -->
+    <meta rel="Api" href="devicesrv_pub/platform_path_definitions_api/platform_path_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/platform_path_definitions_api/group"/>
+   </component>
+   <component id="common_platform_security_definitions_api" name="Common Platform Security Definitions API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/common_platform_security_definitions_api/common_platform_security_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/common_platform_security_definitions_api/group"/>
+   </component>
+   <component id="feature_discovery_api" name="Feature Discovery API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/feature_discovery_api/feature_discovery_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/feature_discovery_api/group"/>
+   </component>
+   <component id="platform_environment_api" name="Platform Environment API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/platform_environment_api/platform_environment_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/platform_environment_api/group"/>
+   </component>
+   <component id="sensor_channel_api" name="Sensor Channel API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/sensor_channel_api/sensor_channel_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/sensor_channel_api/group"/>
+   </component>
+   <component id="sensor_definitions_api" name="Sensor Definitions API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/sensor_definitions_api/sensor_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/sensor_definitions_api/group"/>
+   </component>
+   <component id="version_info_api" name="Version Info API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/version_info_api/version_info_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/version_info_api/group"/>
+   </component>
+   <component id="accessory_monitoring_api" name="Accessory Monitoring API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/accessory_monitoring_api/accessory_monitoring_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/accessory_monitoring_api/group"/>
+   </component>
+   <component id="haptics_api" name="Haptics API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/haptics_api/haptics_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/haptics_api/group"/>
+   </component>
+   <component id="sensor_data_compensator_api" name="Sensor Data Compensator API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_pub/sensor_data_compensator_api/sensor_data_compensator_api.metaxml"/>
+    <unit bldFile="devicesrv_pub/sensor_data_compensator_api/group"/>
+   </component>
+  </collection>
+  <collection id="devicesrv_plat" name="Device Services Platform Interfaces" level="app-if">
+   <component id="configuration_file_parser_api" name="Configuration File Parser API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/configuration_file_parser_api/configuration_file_parser_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/configuration_file_parser_api/group"/>
+   </component>
+   <component id="dos_extension_plugin_api" name="DOS Extension Plug-In API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/dos_extension_plugin_api/dos_extension_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/dos_extension_plugin_api/group"/>
+   </component>
+   <component id="mediator_command_initiator_api" name="Mediator Command Initiator API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_command_initiator_api/mediator_command_initiator_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_command_initiator_api/group"/>
+   </component>
+   <component id="syslangutil_api" name="SysLangUtil API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/syslangutil_api/syslangutil_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/syslangutil_api/group"/>
+   </component>
+   <component id="wakeup_alarm_api" name="Wakeup Alarm API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/wakeup_alarm_api/wakeup_alarm_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/wakeup_alarm_api/group"/>
+   </component>
+   <component id="disk_and_memory_level_keys_api" name="Disk and Memory Level Keys API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/disk_and_memory_level_keys_api/disk_and_memory_level_keys_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/disk_and_memory_level_keys_api/group"/>
+   </component>
+   <component id="mediator_plugin_api" name="Mediator Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_plugin_api/mediator_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_plugin_api/group"/>
+   </component>
+   <component id="headset_status_api" name="Headset Status API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/headset_status_api/headset_status_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/headset_status_api/group"/>
+   </component>
+   <component id="system_startup_extension_plugin_api" name="System Startup Extension Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/system_startup_extension_plugin_api/system_startup_extension_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/system_startup_extension_plugin_api/group"/>
+   </component>
+   <component id="sensor_plugin_api" name="Sensor Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/sensor_plugin_api/sensor_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/sensor_plugin_api/group"/>
+   </component>
+   <component id="accessory_api" name="Accessory API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_api/accessory_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_api/group"/>
+   </component>
+   <component id="display_language_definition_api" name="Display Language Definition API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/display_language_definition_api/display_language_definition_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/display_language_definition_api/group"/>
+   </component>
+   <component id="mediator_command_responder_api" name="Mediator Command Responder API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_command_responder_api/mediator_command_responder_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_command_responder_api/group"/>
+   </component>
+   <component id="accessory_policy_definitions_api" name="Accessory Policy Definitions API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_policy_definitions_api/accessory_policy_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_policy_definitions_api/group"/>
+   </component>
+   <component id="hw_settings_api" name="Hardware Settings API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/hw_settings_api/hw_settings_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/hw_settings_api/group"/>
+   </component>
+   <component id="mediator_domain_definitions_api" name="Mediator Domain Definitions API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_domain_definitions_api/mediator_domain_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_domain_definitions_api/group"/>
+   </component>
+   <component id="sensor_extension_api" name="Sensor Extension API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/sensor_extension_api/sensor_extension_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/sensor_extension_api/group"/>
+   </component>
+   <component id="accessory_plugin_api" name="Accessory Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_plugin_api/accessory_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_plugin_api/group"/>
+   </component>
+   <component id="sae_api" name="SAE API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/sae_api/sae_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/sae_api/group"/>
+   </component>
+   <component id="accessory_control_api" name="Accessory Control API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_control_api/accessory_control_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_control_api/group"/>
+   </component>
+   <component id="mediator_static_registration_api" name="Mediator Static Registration API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_static_registration_api/mediator_static_registration_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_static_registration_api/group"/>
+   </component>
+   <component id="accessory_key_event_handling_api" name="Accessory Key Event Handling API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_key_event_handling_api/accessory_key_event_handling_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_key_event_handling_api/group"/>
+   </component>
+   <component id="mediator_notification_api" name="Mediator Notification API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_notification_api/mediator_notification_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_notification_api/group"/>
+   </component>
+   <component id="accessory_policy_utility_api" name="Accessory Policy Utility API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_policy_utility_api/accessory_policy_utility_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_policy_utility_api/group"/>
+   </component>
+   <component id="common_dsy_plugin_api" name="Common DSY Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/common_dsy_plugin_api/common_dsy_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/common_dsy_plugin_api/group"/>
+   </component>
+   <component id="remote_control_extension_api" name="Remote Control Extension API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/remote_control_extension_api/remote_control_extension_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/remote_control_extension_api/group"/>
+   </component>
+   <component id="sensor_channel_filter_api" name="Sensor Channel Filter API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/sensor_channel_filter_api/sensor_channel_filter_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/sensor_channel_filter_api/group"/>
+   </component>
+   <component id="dos_extension_api" name="DOS Extension API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/dos_extension_api/dos_extension_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/dos_extension_api/group"/>
+   </component>
+   <component id="accessory_audio_control_api" name="Accessory Audio Control API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_audio_control_api/accessory_audio_control_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_audio_control_api/group"/>
+   </component>
+   <component id="mediator_event_consumer_api" name="Mediator Event Consumer API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_event_consumer_api/mediator_event_consumer_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_event_consumer_api/group"/>
+   </component>
+   <component id="shared_data_api" name="Shared Data API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/shared_data_api/shared_data_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/shared_data_api/group"/>
+   </component>
+   <component id="accessory_settings_api" name="Accessory Settings API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_settings_api/accessory_settings_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_settings_api/group"/>
+   </component>
+   <component id="accessory_bluetooth_control_api" name="Accessory Bluetooth Control API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_bluetooth_control_api/accessory_bluetooth_control_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_bluetooth_control_api/group"/>
+   </component>
+   <component id="extended_version_info_api" name="Extended Version Info API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/extended_version_info_api/extended_version_info_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/extended_version_info_api/group"/>
+   </component>
+   <component id="mediator_event_provider_api" name="Mediator Event Provider API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/mediator_event_provider_api/mediator_event_provider_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/mediator_event_provider_api/group"/>
+   </component>
+   <component id="tv_out_config_api" name="TV Out Config API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/tv_out_config_api/tv_out_config_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/tv_out_config_api/group"/>
+   </component>
+   <component id="tspclientmapper_api" name="TSP Client Mapper API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/tspclientmapper_api/tspclientmapper_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/tspclientmapper_api/group"/>
+   </component>
+   <component id="powersave_api" name="Power Save API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/powersave_api/powersave_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/powersave_api/group"/>
+   </component>
+   <component id="powersave_definitions_api" name="Power Save Definitions API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/powersave_definitions_api/powersave_definitions_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/powersave_definitions_api/group"/>
+   </component>
+   <component id="powersave_plugin_api" name="Power Save Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/powersave_plugin_api/powersave_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/powersave_plugin_api/group"/>
+   </component>
+   <component id="extended_version_info_plugin_api" name="Extended Version Info Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/extended_version_info_plugin_api/extended_version_info_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/extended_version_info_plugin_api/group"/>
+   </component>
+   <component id="haptics_plugin_api" name="Haptics Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/haptics_plugin_api/haptics_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/haptics_plugin_api/group"/>
+   </component>
+   <component id="haptics_effect_data_getter_plugin_api" name="Haptics Effect Data Getter Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/haptics_effect_data_getter_plugin_api/haptics_effect_data_getter_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/haptics_effect_data_getter_plugin_api/group"/>
+   </component>
+   <component id="haptics_packetizer_plugin_api" name="Haptics Packetizer Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/haptics_packetizer_plugin_api/haptics_packetizer_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/haptics_packetizer_plugin_api/group"/>
+   </component>
+   <component id="tiltcompensation_api" name="Tilt Compensation API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/tiltcompensation_api/tilt_compensation_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/tiltcompensation_api/group"/>
+   </component>
+   <component id="disk_notification_handler_api" name="Disk Notification Handler API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/disk_notification_handler_api/disk_notification_handler_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/disk_notification_handler_api/group"/>
+   </component>
+   <component id="accessory_policy_usb_audio_api" name="Accessory Policy USB Audio API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_policy_usb_audio_api/accessory_policy_usb_audio_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_policy_usb_audio_api/group"/>
+   </component>
+   <component id="accessory_policy_hdmi_audio_api" name="Accessory Policy HDMI Audio API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/accessory_policy_hdmi_audio_api/accessory_policy_hdmi_audio_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/accessory_policy_hdmi_audio_api/group"/>
+   </component>
+   <component id="sensor_data_compensator_plugin_api" name="Sensor Data Compensator Plugin API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/sensor_data_compensator_plugin_api/sensor_data_compensator_plugin_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/sensor_data_compensator_plugin_api/group"/>
+   </component>
+   <component id="ddc_access_api" name="DDC Access API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/ddc_access_api/ddc_access_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/ddc_access_api/group"/>
+   </component>
+   <component id="tv_out_behaviour_api" name="TV Out Behaviour API" class="api" filter="s60">
+    <meta rel="Api" href="devicesrv_plat/tv_out_behaviour_api/tv_out_behaviour_api.metaxml"/>
+    <unit bldFile="devicesrv_plat/tv_out_behaviour_api/group"/>
+   </component>
+   <component id="autoaudio_plugin_api" name="Auto Audio Plugin API" class="api" filter="s60" introduced="^4">
+    <meta rel="config"> 
+      <defined condition="FF_AUTOMOTIVESTACK"/>
+    </meta>
+    <unit bldFile="devicesrv_plat/autoaudio_plugin_api/group"/>
+   </component>
+  </collection>
+  <collection id="accessoryservices" name="Accessory Services" level="framework">
+   <component id="accessorymonitor" filter="s60" name="Accessory Monitor">
+    <unit bldFile="accessoryservices/accessorymonitor/group"/>
+   </component>
+   <component id="accessoryremotecontrol" filter="s60" name="Accessory Remote Control">
+    <unit bldFile="accessoryservices/accessoryremotecontrol/group"/>
+   </component>
+   <component id="accessoryserver" filter="s60" name="Accessory Server">
+    <unit bldFile="accessoryservices/accessoryserver/group"/>
+   </component>
+   <component id="pluggeddisplay" filter="s60" name="Plugged Display" introduced="^3">
+    <unit bldFile="accessoryservices/pluggeddisplay/group"/>
+   </component>
+   <component id="headsetstatusapi" filter="s60" name="Headset Status API">
+    <unit bldFile="accessoryservices/headsetstatusapi/group"/>
+   </component>
+   <component id="tspclientmapper" filter="s60" name="TSP Client Mapper">
+    <unit bldFile="accessoryservices/tspclientmapper/group"/>
+   </component>
+   <component id="remotecontrolfw" name="Remote Control Framework" introduced="9.1" purpose="optional">
+    <unit bldFile="accessoryservices/remotecontrolfw/group" mrp="accessoryservices/remotecontrolfw/group/bluetooth_remotecontrol.mrp"/>
+   </component>
+   <component id="gid_pc_tool" filter="s60" name="Generic ID PC Tool" target="desktop" class="tool">
+    <unit bldFile="accessoryservices/gid_pc_tool/group"/>
+   </component>
+   <component id="autoaudioasy" filter="s60" name="Auto Audio Plugin" introduced="^4" class="plugin">
+    <meta rel="config"> 
+      <defined condition="FF_AUTOMOTIVESTACK"/>
+    </meta>
+    <unit bldFile="accessoryservices/autoaudioasy/group"/>
+   </component>
+  </collection>
+  <collection id="commonservices" name="Common Services" level="app-if">
+   <component id="commonengine" filter="s60" name="Common Engine">
+    <unit bldFile="commonservices/commonengine/group"/>
+   </component>
+   <component id="commonengineresources" filter="s60" name="Common Engine Resources" class="config">
+    <unit bldFile="commonservices/commonengineresources/group"/>
+   </component>
+   <component id="platformenv" filter="s60" name="Platform Environment">
+    <unit bldFile="commonservices/platformenv/group"/>
+   </component>
+   <component id="sysutil" name="System Utilities" purpose="mandatory" introduced="ER5">
+    <meta rel="config"> 
+      <defined condition="SYMBIAN_BAFL_SYSUTIL"/>
+    </meta>
+    <unit bldFile="commonservices/sysutil/group" mrp="commonservices/sysutil/group/sysutil.mrp"/>
+   </component>
+   <component id="activitymanager" name="Activity Manager" purpose="mandatory" introduced="ER5">
+    <meta rel="config"> 
+      <defined condition="SYMBIAN_BAFL_SYSUTIL"/>
+    </meta>
+    <unit bldFile="commonservices/activitymanager/group" mrp="commonservices/activitymanager/group/activitymanager.mrp"/>
+   </component>
+  </collection>
+  <collection id="dosservices" name="Domestic Operating System Services" level="hw-if">
+   <component id="commondsy" filter="s60" name="Common DSY" class="plugin">
+    <unit bldFile="dosservices/commondsy/group"/>
+   </component>
+   <component id="dosserver" filter="s60" name="Domestic OS Server">
+    <unit bldFile="dosservices/dosserver/group"/>
+   </component>
+  </collection>
+  <collection id="sensorservices" name="Sensor Services" level="framework">
+   <component id="sensorserver" filter="s60" name="Sensor Server">
+    <unit bldFile="sensorservices/sensorserver/group"/>
+   </component>
+   <component id="orientationssy" filter="s60" name="Orientation SSY" class="plugin">
+    <unit bldFile="sensorservices/orientationssy/group"/>
+   </component>
+   <component id="tiltcompensationssy" filter="s60" name="Tilt Compensation SSY" class="plugin">
+    <unit bldFile="sensorservices/tiltcompensationssy/group"/>
+   </component>
+   <component id="sensordatacompensator" filter="s60" name="Sensor Data Compensator">
+    <unit bldFile="sensorservices/sensordatacompensator/group"/>
+   </component>
+  </collection>
+  <collection id="hwrmhaptics" name="HWRM Haptics" level="plugin">
+   <component id="hapticseffectdatagetterfw" filter="s60" name="Haptics Effect Data Getter Framework">
+    <unit bldFile="hwrmhaptics/hapticseffectdatagetterfw/group"/>
+   </component>
+   <component id="hapticspluginservice" filter="s60" name="Haptics Plugin Service">
+    <unit bldFile="hwrmhaptics/hapticspluginservice/group"/>
+   </component>
+   <component id="hapticspacketizer" filter="s60" name="Haptics Packetizer">
+    <unit bldFile="hwrmhaptics/hapticspacketizer/group"/>
+   </component>
+   <component id="hapticspluginmanager" filter="s60" name="Haptics Plugin Manager">
+    <unit bldFile="hwrmhaptics/hapticspluginmanager/group"/>
+   </component>
+   <component id="hapticsserver" filter="s60" name="Haptics Server">
+    <unit bldFile="hwrmhaptics/hapticsserver/group"/>
+   </component>
+   <component id="hapticsclient" filter="s60" name="Haptics Client">
+    <unit bldFile="hwrmhaptics/hapticsclient/group"/>
+   </component>
+   <component id="hwrmhaptics_build" filter="s60" name="HWRM Haptics Build">
+    <!-- move these exports into the appropriate above components and delete this component-->
+    <unit bldFile="hwrmhaptics/group"/>
+   </component>
+  </collection>
+  <collection id="mediator" name="Mediator" level="app-if">
+   <!--collection is really a component. Move it down a directory -->
+   <component id="mediator_build" filter="s60" name="Mediator Build">
+    <unit bldFile="mediator/group"/>
+   </component>
+  </collection>
+  <collection id="psmservices" name="Power Save Mode Services" level="app-if">
+   <component id="psmserver" filter="s60" name="PSM Server">
+    <unit bldFile="psmservices/psmserver/group"/>
+   </component>
+  </collection>
+  <collection id="resourcemgmt" name="Resource Management" level="hw-if">
+   <component id="hwrmfmtxwatcherplugin" filter="s60" name="HWRM FM Transmitter Watcher Plugin" class="plugin">
+    <unit bldFile="resourcemgmt/hwrmfmtxwatcherplugin/group"/>
+   </component>
+   <component id="hwrmtargetmodifierplugin" filter="s60" name="HWRM Target Modifier Plugin" class="plugin">
+    <meta rel="config">
+     <defined condition="__HWRM_TARGET_MODIFIER_PLUGIN"/>
+    </meta>
+    <unit bldFile="resourcemgmt/hwrmtargetmodifierplugin/group"/>
+   </component>
+   <component id="vibractrl" filter="s60" name="Vibra Control" deprecated="9.1">
+    <unit bldFile="resourcemgmt/vibractrl/group"/>
+   </component>
+   <component id="hwresourcesmgr" name="Hardware Resources Manager" introduced="^2" purpose="optional">
+    <unit bldFile="resourcemgmt/hwresourcesmgr/group" mrp="resourcemgmt/hwresourcesmgr/group/telephony_hwrm.mrp"/>
+   </component>
+   <component id="hwresourcesmgrconfig" name="Hardware Resources Manager Config" introduced="^3" purpose="optional" class="config">
+    <unit bldFile="resourcemgmt/hwresourcesmgrconfig" mrp="resourcemgmt/hwresourcesmgrconfig/telephony_hwrm-config.mrp"/>
+   </component>
+   <component id="resourcemgmt_data" filter="s60" name="Resource Management Data" class="config">
+    <unit bldFile="resourcemgmt/data"/>
+   </component>
+   <component id="powerandmemorynotificationservice" name="Power and Memory Notification Service" introduced="6.0" purpose="mandatory">
+    <unit bldFile="resourcemgmt/powerandmemorynotificationservice/group" mrp="resourcemgmt/powerandmemorynotificationservice/group/syslibs_pwrcli.mrp"/>
+   </component>
+  </collection>
+  <collection id="sysstatemgmt" name="System State Management" level="server">
+   <component id="ssmmapperutility" filter="s60" name="SSM Mapper Utility" introduced="^3">
+    <unit bldFile="sysstatemgmt/ssmmapperutility/group"/>
+   </component>
+   <component id="ssmpolicyplugins" filter="s60" name="SSM Policy Plugins" class="plugin" introduced="^3">
+    <unit bldFile="sysstatemgmt/ssmpolicyplugins/group"/>
+   </component>
+   <component id="ssmutilityplugins" filter="s60" name="SSM Utility Plugins" class="plugin" introduced="^3">
+    <unit bldFile="sysstatemgmt/ssmutilityplugins/group"/>
+   </component>
+   <component id="ssmcmdlists" filter="s60" name="SSM Command Lists" introduced="^3">
+    <unit bldFile="sysstatemgmt/ssmcmdlists/group"/>
+   </component>
+   <component id="ssmcustcmds" filter="s60" name="SSM Custom Commands" introduced="^3">
+    <unit bldFile="sysstatemgmt/ssmcustcmds/group"/>
+   </component>
+   <component id="syslangutil" filter="s60" name="System Language Utility" introduced="^3">
+    <unit bldFile="sysstatemgmt/syslangutil/group"/>
+   </component>
+   <component id="sysrestart" filter="s60" name="System Restart" introduced="^3">
+    <unit bldFile="sysstatemgmt/sysrestart/group"/>
+   </component>
+   <component id="sysuiprovider" filter="s60" name="System UI Provider" introduced="^3">
+    <unit bldFile="sysstatemgmt/sysuiprovider/group"/>
+   </component>
+   <component id="systemstarter" name="System Starter" introduced="9.1" deprecated="^3" purpose="mandatory">
+    <unit bldFile="sysstatemgmt/systemstarter/group" mrp="sysstatemgmt/systemstarter/group/app-framework_sysstart.mrp"/>
+   </component>
+   <component id="systemstatemgr" name="System State Manager" introduced="^3" purpose="mandatory">
+    <meta rel="config"> 
+      <defined condition="SYMBIAN_SYSTEM_STATE_MANAGEMENT"/>
+    </meta>
+    <unit bldFile="sysstatemgmt/systemstatemgr/group" mrp="sysstatemgmt/systemstatemgr/group/app-framework_ssma.mrp"/>
+   </component>
+   <component id="systemstateplugins" name="System State Plugins" introduced="^3" purpose="optional" class="plugin">
+    <meta rel="config">
+      <defined condition="SYMBIAN_SYSTEM_STATE_MANAGEMENT"/>
+    </meta>
+    <unit bldFile="sysstatemgmt/systemstateplugins/group" mrp="sysstatemgmt/systemstateplugins/group/app-framework_ssplugins.mrp"/>
+   </component>
+    <meta rel="config">
+      <defined condition="SYMBIAN_SYSTEM_STATE_MANAGEMENT"/>
+    </meta>
+   <component id="systemstatereferenceplugins" name="System State Reference Plugins" introduced="^3" purpose="optional" class="plugin">
+    <unit bldFile="sysstatemgmt/systemstatereferenceplugins/group" mrp="sysstatemgmt/systemstatereferenceplugins/group/app-framework_ssrefplugins.mrp"/>
+   </component>
+  </collection>
+  <collection id="resourceinterfaces" name="Resource Interfaces" level="hw-if">
+   <component id="fmtransmittercontrol" name="FM Transmitter Control" introduced="^3" purpose="optional">
+    <unit bldFile="resourceinterfaces/fmtransmittercontrol/group" mrp="resourceinterfaces/fmtransmittercontrol/group/telephony_hwrmfmtx.mrp"/>
+   </component>
+  </collection>
+  <collection id="systemhealthmanagement" name="System Health Management" level="server">
+   <component id="systemhealthmgr" name="System Health Manager" introduced="^3" purpose="optional">
+    <unit bldFile="systemhealthmanagement/systemhealthmgr/group" mrp="systemhealthmanagement/systemhealthmgr/group/app-framework_shma.mrp"/>
+   </component>
+  </collection>
+  <collection id="devicesrvapitest" name="Devices Services API Tests" level="app-if">
+   <component id="accessorieshaitest" name="Accessories HAI Tests" introduced="^2" purpose="development" filter="test">
+    <unit mrp="devicesrvapitest/accessorieshaitest/group/accessorieshaitest.mrp" bldFile="devicesrvapitest/accessorieshaitest/group"/>
+   </component>
+   <component id="hwrmhaitest" name="HWRM HAI Tests" introduced="^2" purpose="development" filter="test">
+    <unit mrp="devicesrvapitest/hwrmhaitest/group/hwrmhaitest.mrp" bldFile="devicesrvapitest/hwrmhaitest/group"/>
+   </component>
+  </collection>
+  <collection id="devicesrv_info" name="Device Services Info" level="app-if">
+   <component id="devicesrv_metadata" name="Device Services Metadata" class="config" introduced="^2" purpose="development" target="desktop">
+    <unit mrp="devicesrv_info/devicesrv_metadata/devicesrv_metadata.mrp"/>
+   </component>
+  </collection>
+ </package>
 </SystemDefinition>
--- a/package_definition_v2.xml	Tue Aug 10 14:46:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="devicesrv" name="Device Services" levels="adaptation hw-if plugin framework server app-if">
-    <collection id="accessoryservices" name="Accessory Services" level="framework">
-      <component id="accessorymonitor" filter="s60" name="Accessory Monitor">
-        <unit bldFile="accessoryservices/accessorymonitor/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonconnectionemulator/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonitoringtestmodule/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmonitoringtestmodule/tests/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/accmontesttimer/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/accfwuinotifierstub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/asystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessorymonitor/tsrc/public/basic/stubs/group"/> -->
-      </component>
-      <component id="accessoryremotecontrol" filter="s60" name="Accessory Remote Control">
-        <unit bldFile="accessoryservices/accessoryremotecontrol/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/dsytesttool/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/remcontestcontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/audio/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/phone/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryremotecontrol/tsrc/stub/remcon/group"/> -->
-      </component>
-      <component id="accessoryserver" filter="s60" name="Accessory Server">
-        <unit bldFile="accessoryservices/accessoryserver/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/dsytesttool/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/accessorytestcontrol/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/accfwuinotifierstub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/asystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/btasystub/group"/> -->
-        <!-- <unit bldFile="accessoryservices/accessoryserver/tsrc/public/basic/stubs/group"/> -->
-      </component>
-      <component id="headsetstatusapi" filter="s60" name="Headset Status API">
-        <unit bldFile="accessoryservices/headsetstatusapi/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/headsetstatusapi/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="tspclientmapper" filter="s60" name="TSP Client Mapper">
-        <unit bldFile="accessoryservices/tspclientmapper/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="accessoryservices/tspclientmapper/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="remotecontrolfw" name="Remote Control Framework" introduced="9.1" purpose="optional">
-        <unit bldFile="accessoryservices/remotecontrolfw/group" mrp="accessoryservices/remotecontrolfw/group/bluetooth_remotecontrol.mrp"/>
-      </component>
-      <component id="gid_pc_tool" filter="s60" name="Generic ID PC Tool" target="desktop" class="tool">
-	<unit bldFile="accessoryservices/gid_pc_tool/group"/>
-      </component>
-    </collection>
-    <collection id="commonservices" name="Common Services" level="app-if">
-      <component id="commonengine" filter="s60" name="Common Engine">
-        <unit bldFile="commonservices/commonengine/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="commonservices/commonengine/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="commonengineresources" filter="s60" name="Common Engine Resources" class="config">
-        <unit bldFile="commonservices/commonengineresources/group"/>
-      </component>
-      <component id="platformenv" filter="s60" name="Platform Environment">
-        <unit bldFile="commonservices/platformenv/group"/>
-        <!-- <unit bldFile="commonservices/platformenv/disknotifyhandler/group"/> -->
-         <!-- are these bld.infs needed? Can they be included from bld.inf?-->
-        <!-- <unit bldFile="commonservices/platformenv/platformver/group"/> -->
-        <!-- <unit bldFile="commonservices/platformenv/sysversioninfo/group"/> -->
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="commonservices/platformenv/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="sysutil" name="System Utilities" purpose="mandatory" introduced="ER5">
-        <unit bldFile="commonservices/sysutil/group" mrp="commonservices/sysutil/group/sysutil.mrp"/>
-      </component>
-      <component id="activitymanager" name="Activity Manager" purpose="mandatory" introduced="ER5">
-        <unit bldFile="commonservices/activitymanager/group" mrp="commonservices/activitymanager/group/activitymanager.mrp"/>
-      </component>
-    </collection>
-    <collection id="dosservices" name="Domestic Operating System Services" level="hw-if">
-      <component id="dosserver" filter="s60" name="Domestic OS Server">
-        <unit bldFile="dosservices/dosserver/group"/>
-      </component>
-      <component id="commondsy" filter="s60" name="Common DSY" class="plugin">
-        <unit bldFile="dosservices/commondsy/group"/>
-      </component>
-      <component id="dosservices_test" filter="s60" purpose="development" name="DOS Services Test">
-        <!-- is this component needed? If so, can these be #included from a single master test bld.inf?-->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dosservercontrol/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/stubs/dsystub/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dsytfcore/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/public/basic/dosservertestplugin/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/dsytfstifadapter/group"/> -->
-        <!-- <unit bldFile="dosservices/tsrc/dsytesttool/group"/> -->
-      </component>
-    </collection>
-    <collection id="resourcemgmt" name="Resource Management" level="hw-if">
-      <component id="serverexe" filter="s60" name="Hardware Resource Manager Server">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/serverexe/group"/> -->
-      </component>
-      <component id="hwrmfmtxwatcherplugin" filter="s60" name="HWRM FM Transmitter Watcher Plugin" class="plugin">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component. Should this be purpose="development" -->
-        <!-- <unit bldFile="resourcemgmt/hwrmfmtxwatcherplugin/group"/> -->
-      </component>
-      <component id="clientdll" filter="s60" name="HWRM Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/clientdll/group"/> -->
-      </component>
-      <component id="commondll" filter="s60" name="HWRM Common">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/commondll/group"/> -->
-      </component>
-      <component id="vibraclientdll" filter="s60" name="Vibra Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/vibraclientdll/group"/> -->
-      </component>
-      <component id="extendedlightclientdll" filter="s60" name="Extended Light Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/extendedlightclientdll/group"/> -->
-      </component>
-      <component id="lightclientdll" filter="s60" name="Light Client">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component -->
-        <!-- <unit bldFile="resourcemgmt/lightclientdll/group"/> -->
-      </component>
-      <component id="fmtxclientdll" filter="s60" name="FM Transmitter Client">
-       <!-- this needs to be resolved with the equivalent in the fmtransmittercontrol component -->
-        <!-- <unit bldFile="resourcemgmt/fmtxclientdll/group"/> -->
-      </component>
-      <component id="hwrmtargetmodifierplugin" filter="s60" name="HWRM Target Modifier Plugin" class="plugin">
-       <!-- this needs to be resolved with the equivalent in the hwresourcesmgr component. Should this be purpose="development" -->
-        <!-- <unit bldFile="resourcemgmt/hwrmtargetmodifierplugin/group"/> -->
-        <!-- <unit bldFile="resourcemgmt/hwrmtargetmodifierplugin/tsrc/hwrmtargetmodifierplugintest/group"/> -->
-      </component>
-      <component id="vibractrl" filter="s60" name="Vibra Control" deprecated="9.1">
-        <unit bldFile="resourcemgmt/vibractrl/group"/>
-      </component>
-      <component id="hwresourcesmgr" name="Hardware Resources Manager" introduced="^2" purpose="optional">
-        <unit bldFile="resourcemgmt/hwresourcesmgr/group" mrp="resourcemgmt/hwresourcesmgr/group/telephony_hwrm.mrp"/>
-      </component>
-      <component id="hwresourcesmgrconfig" name="Hardware Resources Manager Config" introduced="^3" purpose="optional" class="config">
-        <unit bldFile="resourcemgmt/hwresourcesmgrconfig" mrp="resourcemgmt/hwresourcesmgrconfig/telephony_hwrm-config.mrp"/>
-      </component>
-      <component id="resourcemgmt_build" filter="s60" name="Resource Management Build">
-         <!-- need to reconcile this with the above components -->
-        <unit bldFile="resourcemgmt/group"/>
-      </component>
-      <component id="resourcemgmt_test" filter="s60" purpose="development" name="Resource Management Test">
-        <!-- is this component needed?-->
-        <!-- <unit bldFile="resourcemgmt/tsrc/public/basic/group"/> -->
-      </component>
-      <component id="powerandmemorynotificationservice" name="Power and Memory Notification Service" introduced="6.0" purpose="mandatory">
-        <unit bldFile="resourcemgmt/powerandmemorynotificationservice/group" mrp="resourcemgmt/powerandmemorynotificationservice/group/syslibs_pwrcli.mrp"/>
-      </component>
-    </collection>
-    <collection id="hwrmhaptics" name="HWRM Haptics" level="plugin">
-      <component id="hapticseffectdatagetterfw" filter="s60" name="Haptics Effect Data Getter Framework">
-        <unit bldFile="hwrmhaptics/hapticseffectdatagetterfw/group"/>
-      </component>
-      <component id="hapticspluginservice" filter="s60" name="Haptics Plugin Service">
-        <unit bldFile="hwrmhaptics/hapticspluginservice/group"/>
-      </component>
-      <component id="hapticspacketizer" filter="s60" name="Haptics Packetizer">
-        <unit bldFile="hwrmhaptics/hapticspacketizer/group"/>
-      </component>
-      <component id="hapticspluginmanager" filter="s60" name="Haptics Plugin Manager">
-        <unit bldFile="hwrmhaptics/hapticspluginmanager/group"/>
-      </component>
-      <component id="hapticsserver" filter="s60" name="Haptics Server">
-        <unit bldFile="hwrmhaptics/hapticsserver/group"/>
-      </component>
-      <component id="hapticsclient" filter="s60" name="Haptics Client">
-        <unit bldFile="hwrmhaptics/hapticsclient/group"/>
-      </component>
-      <component id="hwrmhaptics_build" filter="s60" name="HWRM Haptics Build">
-        <!-- can these exports be put in the appropriate above components? -->
-        <unit bldFile="hwrmhaptics/group"/>
-      </component>
-    </collection>
-    <collection id="mediator" name="Mediator" level="app-if">
-      <component id="mediator_build" filter="s60" name="Mediator Build">
-        <unit bldFile="mediator/group"/>
-      </component>
-      <component id="mediator_test" filter="s60" purpose="development" name="Mediator Test">
-          <!-- need to have a single unit in this component. Either #include one bld.inf from the other or remove the component -->
-        <!-- <unit bldFile="mediator/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="mediator/tsrc/public/basic/stub/group"/> -->
-      </component>
-    </collection>
-    <collection id="psmservices" name="Power Save Mode Services" level="app-if">
-      <component id="psmserver" filter="s60" name="PSM Server">
-        <unit bldFile="psmservices/psmserver/group"/>
-         <!-- is this test bld.inf needed for the build? -->
-        <!-- <unit bldFile="psmservices/psmserver/tsrc/public/basic/group"/> -->
-      </component>
-    </collection>
-    <collection id="sensorservices" name="Sensor Services" level="framework">
-      <component id="sensorserver" filter="s60" name="Sensor Server">
-        <unit bldFile="sensorservices/sensorserver/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/condevalstub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/sensrvcondevalplugin/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/ssystub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensorserver/tsrc/public/basic/sensortestmodule/stubprocess/group"/> -->
-      </component>
-      <component id="orientationssy" filter="s60" name="Orientation SSY" class="plugin">
-        <unit bldFile="sensorservices/orientationssy/group"/>
-      </component>
-      <component id="tiltcompensationssy" filter="s60" name="Tilt Compensation SSY" class="plugin">
-        <unit bldFile="sensorservices/tiltcompensationssy/group"/>
-      </component>
-      <component id="sensordatacompensator" filter="s60" name="Sensor Data Compensator">
-        <unit bldFile="sensorservices/sensordatacompensator/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sensorservices/sensordatacompensator/tsrc/sensordatacompensatorpluginstub/group"/> -->
-        <!-- <unit bldFile="sensorservices/sensordatacompensator/tsrc/sensordatacompensatortest/group"/> -->
-      </component>
-    </collection>
-	<collection id="sysstatemgmt" name="System State Management" level="server">
-      <component id="starter" filter="s60" name="Starter">
-        <unit bldFile="sysstatemgmt/starter/group"/>
-         <!-- are these test bld.infs needed for the build? -->
-        <!-- <unit bldFile="sysstatemgmt/starter/strtsecnote/group"/> -->
-        <!-- <unit bldFile="sysstatemgmt/starter/strtsecobs/group"/> -->
-      </component>
-      <component id="systemstarter" name="System Starter" introduced="9.1" deprecated="^3" purpose="mandatory">
-        <unit bldFile="sysstatemgmt/systemstarter/group" mrp="sysstatemgmt/systemstarter/group/app-framework_sysstart.mrp"/>
-      </component>
-      <component id="systemstatemgr" name="System State Manager" introduced="^3" purpose="mandatory">
-        <unit bldFile="sysstatemgmt/systemstatemgr/group" mrp="sysstatemgmt/systemstatemgr/group/app-framework_ssma.mrp"/>
-      </component>
-      <component id="systemstateplugins" name="System State Plugins" introduced="^3" purpose="optional" class="plugin">
-        <unit bldFile="sysstatemgmt/systemstateplugins/group" mrp="sysstatemgmt/systemstateplugins/group/app-framework_ssplugins.mrp"/>
-      </component>
-      <component id="systemstatereferenceplugins" name="System State Reference Plugins" introduced="^3" purpose="optional" class="plugin">
-        <unit bldFile="sysstatemgmt/systemstatereferenceplugins/group" mrp="sysstatemgmt/systemstatereferenceplugins/group/app-framework_ssrefplugins.mrp"/>
-      </component>
-      <component id="sysstatemgmt_test" filter="s60" purpose="development" name="System State Management Test">
-        <!-- <unit bldFile="sysstatemgmt/tsrc/public/basic/group"/> -->
-      </component>
-    </collection>
-    <collection id="resourceinterfaces" name="Resource Interfaces" level="hw-if">
-      <component id="fmtransmittercontrol" name="FM Transmitter Control" introduced="^3" purpose="optional">
-        <unit bldFile="resourceinterfaces/fmtransmittercontrol/group" mrp="resourceinterfaces/fmtransmittercontrol/group/telephony_hwrmfmtx.mrp"/>
-      </component>
-    </collection>
-    <collection id="systemhealthmanagement" name="System Health Management" level="server">
-      <component id="systemhealthmgr" name="System Health Manager" introduced="^3" purpose="optional">
-        <unit bldFile="systemhealthmanagement/systemhealthmgr/group" mrp="systemhealthmanagement/systemhealthmgr/group/app-framework_shma.mrp"/>
-      </component>
-    </collection>
-    <collection id="devicesrvapitest" name="Devices Services API Tests" level="app-if">
-      <component id="accessorieshaitest" name="Accessories HAI Tests" introduced="^2" purpose="development" filter="test">
-        <unit mrp="devicesrvapitest/accessorieshaitest/group/accessorieshaitest.mrp" bldFile="devicesrvapitest/accessorieshaitest/group"/>
-      </component>
-      <component id="hwrmhaitest" name="HWRM HAI Tests" introduced="^2" purpose="development" filter="test">
-        <unit mrp="devicesrvapitest/hwrmhaitest/group/hwrmhaitest.mrp" bldFile="devicesrvapitest/hwrmhaitest/group"/>
-      </component>
-    </collection>
-    <collection id="devicesrv_info" name="Device Services Info" level="app-if">
-      <component id="devicesrv_pub" filter="s60" name="Device Services Public Interfaces" class="api">
-        <unit bldFile="devicesrv_pub/group"/>
-        <!-- <unit bldFile="devicesrv_pub/accessory_monitoring_api/tsrc/bc/accmonapibctests/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/feature_discovery_api/tsrc/bc/featurediscovery/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/find_item_api/tsrc/bc/finditem/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/hwrm_power_state_api/tsrc/bc/powerstate/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/light_api/tsrc/bc/light/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/phone_parser_api/tsrc/bc/phoneparser/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/platform_environment_api/tsrc/bc/platformenv/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sensor_channel_api/tsrc/bc/sensor/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sensor_data_compensator_api/tsrc/bc/sensordatacompensatortest/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/sysutil_api/tsrc/bc/sysutil/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/text_resolver_api/tsrc/bc/textresolver/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/version_info_api/tsrc/bc/platformvertest/group"/> -->
-        <!-- <unit bldFile="devicesrv_pub/vibra_api/tsrc/bc/vibra/group"/> -->
-      </component>
-      <component id="devicesrv_plat" filter="s60" name="Device Services Platform Interfaces" class="api">
-        <unit bldFile="devicesrv_plat/group"/>
-        <!-- <unit bldFile="devicesrv_plat/activity_manager_api/tsrc/group"/> -->
-      </component>
-      <component id="devicesrv_metadata" name="Device Services Metadata" class="config" introduced="^2" purpose="development" target="desktop">
-        <unit mrp="devicesrv_info/devicesrv_metadata/devicesrv_metadata.mrp"/>
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Mon Aug 23 14:47:20 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="os"/>
--- a/psmservices/psmserver/inc/client/psmclientimpl.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/inc/client/psmclientimpl.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -74,6 +74,14 @@
          */
         CPsmSettings& PsmSettings() const;
 
+#ifdef _DEBUG  
+        // these functions are used only for testing   
+        virtual TInt HeapMark();
+        virtual TInt HeapMarkEnd();
+        virtual TInt HeapReset();
+        virtual TInt SetHeapFailure(TInt aFailureRate);		
+#endif //_DEBUG     
+
     private:
 
         /**
--- a/psmservices/psmserver/inc/engine/psmmanager.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/inc/engine/psmmanager.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -72,7 +72,7 @@
         /**
          * Register new PSM observer. Adds observer to the list of registered observers
          */
-        void RegisterObserver( MPsmModeChangeObserver* aObserver );
+        void RegisterObserverL( MPsmModeChangeObserver* aObserver );
 
         /**
          * Unreqister observer. Removes observer from the list of registered observers
@@ -89,6 +89,19 @@
          */
         void IssueRequest();
 
+#ifdef _DEBUG        
+        /**
+         * Delete plugin loader. Used only for testing purpose
+         */         
+        void ClosePluginLoader();
+
+        /**
+         * Compress ModeObservers Array. Used only for testing purpose
+         */        
+        void CompressModeObserversArray();
+
+#endif //_DEBUG     
+
     protected: // From CActive
 
         /**
--- a/psmservices/psmserver/inc/server/psmsrvmessage.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/inc/server/psmsrvmessage.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -74,6 +74,11 @@
          * Observes the mode change completion
          */
         void NotifyPsmModeChangeComplete( const TInt aError );
+		
+		/**
+         * Returns the message handle
+         */
+		TInt MessageHandle( ) const;
 
     private:
 
--- a/psmservices/psmserver/inc/server/psmsrvsession.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/inc/server/psmsrvsession.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -61,6 +61,11 @@
          * Service requests
          */
         void ServiceL( const RMessage2& aMessage );
+		
+		/**
+         * ServiceError handling
+         */
+		void ServiceError(const RMessage2 &aMessage, TInt aError);
 
     private:
 
@@ -74,10 +79,6 @@
          */
         void ConstructL();
 
-        /**
-         * Handles client requests
-         */
-        void DispatchL( const RMessage2& aMessage );
 
         /**
          * Handles settings related requests
@@ -106,11 +107,6 @@
          */
         CPsmMessage* iNotifyModeMessage;
 
-        /**
-         * Config array for Settings handling
-         */
-        RConfigInfoArray iConfigArray;
-
     };
 
 #endif // PSMSRVSESSION_H 
--- a/psmservices/psmserver/inc/util/psmclientserver.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/inc/util/psmclientserver.h	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
@@ -66,6 +66,16 @@
      */
     EPsmServerCancelModeChangeNotificationRequest,
 
+    /**
+     * Used only for testing purpose and in debug builds only. 
+     * Not declared under _DEBUG because command ids will be 
+     * different in udeb and urel version, will lead to confusion
+     */
+    EDebugHeapMark,
+    EDebugHeapMarkEnd,
+    EDebugSetHeapFailure,
+    EDebugHeapReset,   
+
 // ---------------------------------------------------------------
 // End of enum
 // ---------------------------------------------------------------
--- a/psmservices/psmserver/src/client/psmclientimpl.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/client/psmclientimpl.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -63,12 +63,10 @@
 CPsmClientImpl::~CPsmClientImpl()
     {
     COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::~CPsmClientImpl()" ) ) );
-
+    
     CancelPowerSaveModeChange();
-
     delete iActive;
     delete iSettings;
-
     iPsmServer.Close();
 
     COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::~CPsmClientImpl - return" ) ) );
@@ -169,4 +167,39 @@
     return *iSettings;
     }
 
+#ifdef _DEBUG     
+TInt CPsmClientImpl::HeapMark()
+    {
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapMark()" ) ) );
+    TInt err = iPsmServer.SendReceiveSync( EDebugHeapMark, TIpcArgs() );
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapMark - return" ) ) );   
+    return err;
+    }
+
+TInt CPsmClientImpl::HeapMarkEnd()
+    {
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapMarkEnd()" ) ) );
+    TInt err = iPsmServer.SendReceiveSync( EDebugHeapMarkEnd, TIpcArgs() );   
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapMarkEnd - return" ) ) );   
+    return err;    
+    }
+
+TInt CPsmClientImpl::SetHeapFailure(TInt aFailureRate)
+    {
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::SetHeapFailure()" ) ) );
+    TInt err = iPsmServer.SendReceiveSync( EDebugSetHeapFailure, TIpcArgs(aFailureRate) );
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::SetHeapFailure - return" ) ) );   
+    return err; 
+    }
+
+TInt CPsmClientImpl::HeapReset()
+    {
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapReset()" ) ) );
+    TInt err = iPsmServer.SendReceiveSync( EDebugHeapReset, TIpcArgs() );
+    COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::HeapReset - return" ) ) );   
+    return err; 
+    }
+
+#endif //_DEBUG     
+
 // End of file
--- a/psmservices/psmserver/src/engine/psmbackupstorage.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/engine/psmbackupstorage.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -274,7 +274,10 @@
         // reset error value
         trapErr = KErrNone;
         }
-
+    else if ( KErrNoMemory == trapErr )
+        {
+        User::Leave(trapErr);
+        }    
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmBackupStorage::UpdateBackupL() - Config count: %i" ), aConfigArray.Count() ) );
 
     // Loop config array and update storage
@@ -287,9 +290,19 @@
         // Search set element from config and create new if not found
         TXmlEngElement setItem;
         TRAP( trapErr, setItem = FindSetItemL( settings, configInfo.iConfigId ) );
-
-        // If not found, create new
-        if ( KErrNotFound == trapErr && setItem.IsNull() )
+        
+        COMPONENT_TRACE( ( _L( "PSM Server - FindSetItemL() TRAP error -  %d" ), trapErr ) );
+        
+        if ( KErrNoMemory == trapErr && setItem.IsNull() )
+            {
+            User::Leave(trapErr);
+            }
+        else if (KErrNoMemory == trapErr)
+            {
+            setItem.RemoveAttributeL( KPsmSetItemValue );
+            User::Leave(trapErr);
+            }
+        else if ( KErrNotFound == trapErr && setItem.IsNull() )
             {
             // First param indicates that cannot have childs, 
             // second is the owner document and last is tag
--- a/psmservices/psmserver/src/engine/psmmanager.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/engine/psmmanager.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -113,8 +113,8 @@
     if ( iPluginLoader )
         {
         delete iPluginLoader;
-        }
-
+        }    
+    
     // Close mode observers array
     iModeObservers.Close();
 
@@ -286,14 +286,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// CPsmManager::RegisterObserver
+// CPsmManager::RegisterObserverL
 // -----------------------------------------------------------------------------
 //
-void CPsmManager::RegisterObserver( MPsmModeChangeObserver* aObserver )
+void CPsmManager::RegisterObserverL( MPsmModeChangeObserver* aObserver )
     {
-    COMPONENT_TRACE( ( _L( "PSM Server - CPsmManager::RegisterObserver()" ) ) );
-    iModeObservers.Append( aObserver );
-    COMPONENT_TRACE( ( _L( "PSM Server - CPsmManager::RegisterObserver - return" ) ) );
+    COMPONENT_TRACE( ( _L( "PSM Server - CPsmManager::RegisterObserverL()" ) ) );
+    iModeObservers.AppendL( aObserver );    
+    COMPONENT_TRACE( ( _L( "PSM Server - CPsmManager::RegisterObserverL() return" ) ) );
     }
 
 // -----------------------------------------------------------------------------
@@ -326,4 +326,27 @@
     return *iSettingsHandler; 
     }
 
+#ifdef _DEBUG 
+// -----------------------------------------------------------------------------
+// CPsmManager::ClosePluginLoader
+// For testing purpose 
+// -----------------------------------------------------------------------------
+void CPsmManager::ClosePluginLoader()
+    {
+    if(iPluginLoader)
+        {
+        delete iPluginLoader;
+        iPluginLoader=NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPsmManager::CompressModeObserversArray
+// For testing purpose 
+// -----------------------------------------------------------------------------
+void CPsmManager::CompressModeObserversArray()
+    {
+    iModeObservers.Compress();
+    }
+#endif // _DEBUG 
 // End of file
--- a/psmservices/psmserver/src/engine/psmsettingshandler.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/engine/psmsettingshandler.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -25,6 +25,29 @@
 #include "psmtrace.h"
 
 // -----------------------------------------------------------------------------
+// CloseHandler
+// closes the storage handler
+// -----------------------------------------------------------------------------
+//
+void CleanupStorage(TAny* aPtr)
+    {
+    CPsmStorage* self = static_cast<CPsmStorage*> (aPtr);
+    //Ignore the Trap as Cleanup can't leave.
+    TRAP_IGNORE(self->CloseStorageL());
+    }
+
+// -----------------------------------------------------------------------------
+// CloseHandler
+// closes the backup storage handler
+// -----------------------------------------------------------------------------
+//
+void CleanupBackupStorage(TAny* aPtr)
+    {
+    CPsmBackupStorage* self = static_cast<CPsmBackupStorage*> (aPtr);
+    //Ignore the Trap as Cleanup can't leave.
+    TRAP_IGNORE(self->CloseStorageL());
+    }
+	
 // CPsmSettingsHandler::NewL
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
@@ -114,10 +137,13 @@
     RConfigInfoArray& aPsmConfigArray, TUint32 aRepository )
     {
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSettingsHandler::BackupAndGetSettingsL()" ) ) );
+    //Close config handle in case of any error
+    CleanupStack::PushL(TCleanupItem(CleanupStorage, iConfigStorage));
     // Change settings from normal config storage
     iConfigStorage->InitStorageL( aRepository );
     ChangeSettingsL( aPsmConfigArray, aRepository, *iConfigStorage );
     iConfigStorage->CloseStorageL();
+    CleanupStack::Pop(iConfigStorage);
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSettingsHandler::BackupAndGetSettingsL() - return" ) ) );
     }
 
@@ -226,7 +252,9 @@
     // First, get current settings
     RConfigInfoArray currentSettings;
     CleanupClosePushL( currentSettings );
-
+    
+    //Close backup handler in case of any error
+    CleanupStack::PushL(TCleanupItem(CleanupBackupStorage, iBackupStorage));
     iBackupStorage->InitStorageL( aRepository );
     iBackupStorage->ListCurrentSettingSetL( currentSettings );
 
@@ -245,8 +273,8 @@
         if ( !found )
             {
             // Add new settings to backup
-            settingsToBackUp.Append( aPsmConfigArray[ i ] );
-            currentSettings.Append( aPsmConfigArray[ i ] );
+            settingsToBackUp.AppendL( aPsmConfigArray[ i ] );
+            currentSettings.AppendL( aPsmConfigArray[ i ] );
             }
         }
 
@@ -272,7 +300,7 @@
     RConfigInfoArray settingsFromBackUp;
     CleanupClosePushL( settingsFromBackUp );
 
-    for ( TInt i = 0; currentSettings.Count() != i; i++ )
+    for ( TInt i = 0; currentSettings.Count() != i; ++i )
         {
         TPsmsrvConfigInfo& currentInfo = currentSettings[ i ];
         TBool found = EFalse;
@@ -287,9 +315,9 @@
         if ( !found )
             {
             // not found, get setting from backup
-            settingsFromBackUp.Append( currentInfo );
+            settingsFromBackUp.AppendL( currentInfo );
             currentSettings.Remove( i );
-            i--;
+            --i;
             }
         else
             {
@@ -312,12 +340,14 @@
     // add settings from backup to settings
     for ( TInt i = 0; i < settingsFromBackUp.Count(); i++ )
         {
-        aPsmConfigArray.Append( settingsFromBackUp[ i ] );
+        //Ignore the error returned by Append  
+        aPsmConfigArray.Append( settingsFromBackUp[ i ]);
         }
 
     // Cleanup config arrays
     CleanupStack::PopAndDestroy( &settingsFromBackUp );
     CleanupStack::PopAndDestroy( &settingsToBackUp );
+    CleanupStack::Pop( iBackupStorage );
     CleanupStack::PopAndDestroy( &currentSettings );
 
     User::LeaveIfError( err );
@@ -348,15 +378,19 @@
         CleanupClosePushL( psmConfigArray );
 
         const TUint32 repository = passiveConfigs[i];
-
+        //Close Cenrep handler in case of any error
+        CleanupStack::PushL(TCleanupItem(CleanupStorage, iCenRepStorage));
         iCenRepStorage->InitStorageL( repository );
 
         if ( EPsmsrvModeNormal == iMode )
             {
+            //Close Cenrep handler in case of any error
+    		CleanupStack::PushL(TCleanupItem(CleanupBackupStorage, iBackupStorage));	
             // Moving to normal mode, get passive config set from baskup storage
             iBackupStorage->InitStorageL( repository );
             iBackupStorage->ListPassiveConfigSetL( psmConfigArray );
             iBackupStorage->CloseStorageL();
+            CleanupStack::Pop( iBackupStorage );
             }
         else
             {
@@ -369,6 +403,7 @@
 
         // close storage
         iCenRepStorage->CloseStorageL();
+        CleanupStack::Pop( iCenRepStorage );
         CleanupStack::PopAndDestroy( &psmConfigArray );
         }
 
--- a/psmservices/psmserver/src/engine/psmstorage.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/engine/psmstorage.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -204,7 +204,7 @@
             }
 
         // Add info to list
-        aPsmConfigArray.Append( configInfo );
+        aPsmConfigArray.AppendL( configInfo );
 
         // handle next element set
         setElement = nodeList.Next().AsElement();
--- a/psmservices/psmserver/src/server/psmsrvmessage.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/server/psmsrvmessage.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -154,4 +154,13 @@
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmMessage::NotifyPsmModeChangeComplete - return" ) ) );
     }
 
+// -----------------------------------------------------------------------------
+// CPsmMessage::MessageHandle
+// -----------------------------------------------------------------------------
+//
+TInt CPsmMessage::MessageHandle() const
+        {
+        return iMessage.Handle();
+        }
+
 // End of file
--- a/psmservices/psmserver/src/server/psmsrvsession.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/src/server/psmsrvsession.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -14,7 +14,8 @@
 * Description:  PSM Server session
 *
 */
-
+#include <centralrepository.h>
+#include <psmsrvdomaincrkeys.h>
 #include <e32property.h>
 #include <connect/sbdefs.h>
 #include <psmsettingsprovider.h>
@@ -111,9 +112,6 @@
         COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::~CPsmSession - No pending requests") ) );
         }
 
-    // Reset and close config array
-    iConfigArray.Reset();
-    iConfigArray.Close();
 
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::~CPsmSession - return") ) );
     }
@@ -125,41 +123,28 @@
 void CPsmSession::ServiceL( const RMessage2& aMessage )
     {
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceL()" ) ) );
-
-    TRAPD( error, DispatchL( aMessage ) );
-
-    // Complete message with error code if there were errors
-    if ( KErrNone != error )
-        {
-        COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceL() - Error: %i" ), error ) );
-        aMessage.Complete( error );
-        }
-
-    COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceL - return" ) ) );
-    }
-
-// -----------------------------------------------------------------------------
-// CPsmSession::DispatchL
-// -----------------------------------------------------------------------------
-//
-void CPsmSession::DispatchL( const RMessage2& aMessage )
-    {
-    COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::DispatchL()" ) ) );
-
     switch ( aMessage.Function() )
         {
         case EPsmServerNotifyModeChange: // For power save mode change
             {
             TInt mode = aMessage.Int0();
-            if ( !iNotifyModeMessage )
-                {
-                // Create message wrapper if not yet created
-                iNotifyModeMessage = CPsmMessage::NewL( iPsmManager );
-                iPsmManager.RegisterObserver( iNotifyModeMessage );
-                }
-
-            // Check that mode to be set is valid, otherwise error code.
-            if( mode == iPsmManager.SettingsProvider().Mode() )
+			if ( !iNotifyModeMessage )
+				{
+				// Create message wrapper if not yet created
+				CPsmMessage* notifyModeMessage = CPsmMessage::NewL( iPsmManager );
+				CleanupStack::PushL(notifyModeMessage);
+				iPsmManager.RegisterObserverL( notifyModeMessage );
+				CleanupStack::Pop(notifyModeMessage);
+				iNotifyModeMessage = notifyModeMessage;
+				}
+				
+			//Check whether the mode is already set .
+			TInt cenrepMode( 0 );
+			CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+			User::LeaveIfError(cenrep->Get( KPsmCurrentMode, cenrepMode ));
+			CleanupStack::PopAndDestroy( cenrep );
+			// Check that mode to be set is valid, otherwise error code.
+            if( mode == cenrepMode )
                 {
                 User::Leave( KErrAlreadyExists );
                 }
@@ -188,12 +173,6 @@
         case EPsmServerGetSettings: // For PSM settings
         case EPsmServerBackupSettings: // For PSM settings
             {
-            // Check previous config
-            if ( iConfigArray.Count() > 0 )
-                {
-                iConfigArray.Reset();
-                }
-
             // Handle settings requests in different function
             HandleSettingsRequestL( aMessage );
             break;
@@ -224,8 +203,11 @@
             if ( !iNotifyModeMessage )
                 {
                 // Create message wrapper if not yet created
-                iNotifyModeMessage = CPsmMessage::NewL( iPsmManager );
-                iPsmManager.RegisterObserver( iNotifyModeMessage );
+                CPsmMessage* notifyModeMessage = CPsmMessage::NewL( iPsmManager );
+				CleanupStack::PushL(notifyModeMessage);
+				iPsmManager.RegisterObserverL( notifyModeMessage );
+				CleanupStack::Pop(notifyModeMessage);
+				iNotifyModeMessage = notifyModeMessage;
                 }
             iNotifyModeMessage->Initialize( aMessage );
             break;
@@ -247,16 +229,78 @@
             aMessage.Complete( KErrNone );
             break;
             }
+#ifdef _DEBUG    
+        case EDebugHeapMark:
+            {        
+            COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession - EDebugMarkHeap: Alloc Cells: %d."), User::CountAllocCells()));            
+            __UHEAP_MARK;
+            aMessage.Complete(KErrNone);
+            break;
+            }
+            
+        case EDebugHeapMarkEnd:
+            {
+            COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession - EDebugMarkHeapEnd: Alloc Cells: %d."), User::CountAllocCells()));
+            if ( iNotifyModeMessage )
+                {
+                // Unregister observer from manager
+                iPsmManager.UnregisterObserver( iNotifyModeMessage );
+                // Compress the observer array
+                iPsmManager.CompressModeObserversArray();
+                // Finally delete message
+                delete iNotifyModeMessage;
+                iNotifyModeMessage = NULL;
+                }
+            iPsmManager.ClosePluginLoader();
+            __UHEAP_MARKEND;
+            aMessage.Complete(KErrNone);
+            break;
+            }
+            
+        case EDebugSetHeapFailure:
+            {
+            COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession - EDebugSetHeapFailure: Value of Failure Rate: %d."), aMessage.Int0()));            
+            __UHEAP_SETFAIL(RAllocator::EFailNext,aMessage.Int0());
+            aMessage.Complete(KErrNone);
+            break;
+            }
+            
+        case EDebugHeapReset:
+            {
+            COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession - EDebugHeapReset ")));            
+            __UHEAP_RESET;
+            aMessage.Complete(KErrNone);
+            break;
+            }            
+#endif
         default:
             {
             COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceL() - unknown request: %i - ERROR" ), aMessage.Function() ) );
             User::Leave( KErrUnknown );
             }
         }
+    COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceL - return" ) ) );
+    }
 
-    COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::DispatchL - return" ) ) );
+// -----------------------------------------------------------------------------
+// CPsmSession::ServiceError
+// -----------------------------------------------------------------------------
+//
+void CPsmSession::ServiceError(const RMessage2 &aMessage, TInt aError)
+    {
+    // Complete message with error code if there were errors
+    COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::ServiceError() - Error: %i" ), aError ) );
+    if (iNotifyModeMessage && (aMessage.Handle() == iNotifyModeMessage->MessageHandle()) )
+        {
+        iNotifyModeMessage->Complete( aError );           
+        }
+    else
+        {
+        aMessage.Complete( aError );
+        }
     }
 
+
 // -----------------------------------------------------------------------------
 // CPsmSession::HandleSettingsRequestL
 // -----------------------------------------------------------------------------
@@ -265,37 +309,62 @@
     {
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL()" ) ) );
 
+    RConfigInfoArray configArray;
+    CleanupClosePushL(configArray);
     // read config array from message
-    ReadConfigArrayL( iConfigArray, aMessage );
+    ReadConfigArrayL( configArray, aMessage );
     // Get storage UID
     TUint32 storage = aMessage.Int2();
 
     TInt err( KErrNone );
 
-    if ( aMessage.Function() == EPsmServerBackupSettings )
+    switch ( aMessage.Function() )
         {
-        iPsmManager.SettingsProvider().BackupSettingsL( iConfigArray, storage );
-        }
-    else 
-        {
-        if ( aMessage.Function() == EPsmServerGetSettings )
+        case EPsmServerBackupSettings: // For server backup settings
             {
-            iPsmManager.SettingsProvider().GetSettingsL( iConfigArray, storage );
+            iPsmManager.SettingsProvider().BackupSettingsL( configArray, storage );
+            break;
             }
-        else
+        case EPsmServerGetSettings: // For getting server settingspower save mode change
             {
-            // EPsmServerChangeSettings
-            iPsmManager.SettingsProvider().BackupAndGetSettingsL( iConfigArray, storage );
+            iPsmManager.SettingsProvider().GetSettingsL( configArray, storage );
+            // check whether the configArray is empty before writing the value back to message.
+            if(configArray.Count() > 0)
+                {
+                // write changed values back to message
+                TInt arraySize( configArray.Count() * sizeof( TPsmsrvConfigInfo ) );
+                TPtr8 arrayPtr( reinterpret_cast<TUint8*>(&configArray[0]), arraySize, arraySize );
+                err = aMessage.Write( 0, arrayPtr );
+                COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL - New data wrote to message: %i" ), err ) );
+                }
+            else
+                {
+                ERROR_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL - Config Array is Empty" )) );
+                }
+            break;
             }
-
-        // We have to write changed values back to message
-        TInt arraySize( iConfigArray.Count() * sizeof( TPsmsrvConfigInfo ) );
-        TPtr8 arrayPtr( reinterpret_cast<TUint8*>(&iConfigArray[0]), arraySize, arraySize );
-        err = aMessage.Write( 0, arrayPtr );
-        ERROR_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL - New data wrote to message: %i" ), err ) );
+        case EPsmServerChangeSettings: // For changing the settings
+            {
+            // We have to write changed values back to message
+            iPsmManager.SettingsProvider().BackupAndGetSettingsL( configArray, storage );
+            // We have to write changed values back to message
+            TInt arraySize( configArray.Count() * sizeof( TPsmsrvConfigInfo ) );
+            TPtr8 arrayPtr( reinterpret_cast<TUint8*>(&configArray[0]), arraySize, arraySize );
+            err = aMessage.Write( 0, arrayPtr );
+            ERROR_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL - New data wrote to message: %i" ), err ) );
+            break;
+            }
+        default:
+            {
+            COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL() - unknown request: %i - ERROR" ), aMessage.Function() ) );
+            User::Leave( KErrUnknown );
+            }
         }
     // Complete message before destroying local config array
     aMessage.Complete( err );
+			
+    CleanupStack::PopAndDestroy(&configArray);
+
     COMPONENT_TRACE( ( _L( "PSM Server - CPsmSession::HandleSettingsRequestL - return" ) ) );
     }
 
@@ -310,10 +379,8 @@
     const TInt configCount( aMessage.Int1() );
     TInt arrayLength( configCount * sizeof( TPsmsrvConfigInfo ) );
 
-    // There is no ResizeL() for RArray
-    // ReserveL() does not change iCount, which will
-    // result array[0] failure (access beyond array index)
-    // That is why we fill the array with dummy items
+    aArray.ReserveL(configCount);    
+    //Fill the array with dummy items
     for(TInt x = 0; x < configCount; ++x )
     	{
         // Append empty config infos to array
--- a/psmservices/psmserver/tsrc/PsmTestModule/conf/PsmTestModule.cfg	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/tsrc/PsmTestModule/conf/PsmTestModule.cfg	Mon Aug 23 14:47:20 2010 +0300
@@ -648,3 +648,51 @@
 delete test
 [Endtest]
 
+[Test]
+title OOM_PSM to power save mode
+create PsmTestModule test
+test OOMChangePsmInit FullPsm
+test ChangePsmEnd
+delete test
+[Endtest]
+
+[Test]
+title OOM_Cancel PSM change
+create PsmTestModule test
+test OOMCancelPsm
+pause 1000
+test ChangePsmEnd
+delete test
+[Endtest]
+
+[Test]
+title OOM_BackupAndGetSettings
+create PsmTestModule test
+test ChangeSettingsInit Normal
+test OOMBackupAndGetSettings
+pause 1000
+test ChangePsmEnd
+delete test
+[Endtest]
+
+[Test]
+title OOM_GetSettings
+create PsmTestModule test
+test ChangeSettingsInit Normal
+test OOMGetSettings
+pause 1000
+test ChangePsmEnd
+delete test
+[Endtest]
+
+[Test]
+title OOM_BackupSettings
+create PsmTestModule test
+test ChangeSettingsInit Normal
+test OOMBackupSettings
+pause 1000
+test ChangePsmEnd
+delete test
+[Endtest]
+
+
--- a/psmservices/psmserver/tsrc/PsmTestModule/group/PsmTestModule.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/tsrc/PsmTestModule/group/PsmTestModule.mmp	Mon Aug 23 14:47:20 2010 +0300
@@ -37,6 +37,8 @@
 //RESOURCE        resource_file2
 
 USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc/client
+USERINCLUDE     ../../../inc/util
 
 OS_LAYER_SYSTEMINCLUDE
 
--- a/psmservices/psmserver/tsrc/PsmTestModule/inc/PSMTest.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/tsrc/PsmTestModule/inc/PSMTest.h	Mon Aug 23 14:47:20 2010 +0300
@@ -266,6 +266,13 @@
         // From MPsmChangeCompleteObserver
         virtual void PowerSaveModeChangeError( const TInt aError );
 
+#ifdef _DEBUG
+        TInt OOMNotifyPowerSaveModeChangeInitL( CStifItemParser& aItem );
+        TInt OOMCancelPowerSaveModeChangeL( CStifItemParser& aItem );
+        TInt OOMPsmBackupAndGetSettingsL( CStifItemParser& /*aItem*/ );
+        TInt OOMPsmGetSettingsL( CStifItemParser& /*aItem*/ );
+        TInt OOMPsmBackupSettingsL( CStifItemParser& /*aItem*/ );      
+#endif //_DEBUG     
 
     public:     // Data
         // ?one_line_short_description_of_data
--- a/psmservices/psmserver/tsrc/PsmTestModule/src/PSMTestBlocks.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/psmservices/psmserver/tsrc/PsmTestModule/src/PSMTestBlocks.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -28,7 +28,7 @@
 
 #include <psmsrvdomaincrkeys.h>
 #include <centralrepository.h>
-
+#include "psmclientimpl.h"
 #include "PSMTest.h"
 
 
@@ -126,7 +126,16 @@
         ENTRY( "OpenClosePerformanceChange", CPSMTest::OpenClosePerformanceChange ),
         ENTRY( "OpenClosePerformanceEnd", CPSMTest::OpenClosePerformanceEnd ),
         ENTRY( "ChangePsmPerformance", CPSMTest::ChangePsmPerformance ),
-        ENTRY( "ChangeSettingsPerformance", CPSMTest::ChangeSettingsPerformance )
+
+#ifdef _DEBUG 
+        //OOM tests for psm server
+        ENTRY( "OOMChangePsmInit", CPSMTest::OOMNotifyPowerSaveModeChangeInitL ),
+        ENTRY( "OOMCancelPsm", CPSMTest::OOMCancelPowerSaveModeChangeL ),
+        ENTRY( "OOMBackupAndGetSettings", CPSMTest::OOMPsmBackupAndGetSettingsL ),
+        ENTRY( "OOMGetSettings", CPSMTest::OOMPsmGetSettingsL ),
+        ENTRY( "OOMBackupSettings", CPSMTest::OOMPsmBackupSettingsL ),
+#endif  //_DEBUG       
+        ENTRY( "ChangeSettingsPerformance", CPSMTest::ChangeSettingsPerformance )    
         };
 
     const TInt count = sizeof( KFunctions ) / 
@@ -1242,6 +1251,160 @@
 //
 CPSMTestObserver::~CPSMTestObserver()
     {
-    }
+    }   
 */
+#ifdef _DEBUG 
+// -----------------------------------------------------------------------------
+// CPSMTest::OOMNotifyPowerSaveModeChangeInit
+// -----------------------------------------------------------------------------
+//
+TInt CPSMTest::OOMNotifyPowerSaveModeChangeInitL(CStifItemParser& /*aItem*/)
+    {    
+    CPsmClient* psmClient = CPsmClient::NewL( *this );
+    CleanupStack::PushL(psmClient);
+    CPsmClientImpl* psmImpl = static_cast<CPsmClientImpl*> (psmClient);
+	psmImpl->HeapReset();
+	psmImpl->HeapMark();
+    for (TInt allocFailRate = 1;; allocFailRate++)
+        {        
+        psmImpl->SetHeapFailure( allocFailRate );                
+        psmImpl->ChangePowerSaveMode(1);
+        // Wait for mode to change
+        iSchedulerWait.Start();
+        
+        if (iErrorCode == KErrNone)
+            {
+            iErrorCode = KErrNone;            
+            break;            
+            }     
+        }
+	psmImpl->HeapMarkEnd();
+	psmImpl->HeapReset();   
+    CleanupStack::PopAndDestroy(psmClient);
+    return KErrNone;  
+    }
+
+// -----------------------------------------------------------------------------
+// CPSMTest::OOMCancelPowerSaveModeChange
+// -----------------------------------------------------------------------------
+//
+TInt CPSMTest::OOMCancelPowerSaveModeChangeL( CStifItemParser& /*aItem*/ )
+    {
+    CPsmClient* psmClient = CPsmClient::NewL( *this );
+    CleanupStack::PushL(psmClient);
+    CPsmClientImpl* psmImpl = static_cast<CPsmClientImpl*> (psmClient);
+    psmImpl->ChangePowerSaveMode(0);
+    for (TInt allocFailRate = 1;; allocFailRate++)
+        {
+        psmImpl->HeapReset();
+        psmImpl->SetHeapFailure( allocFailRate );
+        psmImpl->HeapMark();        
+        psmImpl->CancelPowerSaveModeChange();        
+        // Wait for mode to change
+        iSchedulerWait.Start();
+        psmImpl->HeapMarkEnd();
+        if (iErrorCode == KErrNone )
+            {
+            iErrorCode = KErrNone;
+            psmImpl->HeapReset();  
+            break;            
+            }       
+        }
+    CleanupStack::PopAndDestroy(psmClient); 
+    return KErrNone;  
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPSMTest::OOMPsmBackupAndGetSettings
+// -----------------------------------------------------------------------------
+//
+TInt CPSMTest::OOMPsmBackupAndGetSettingsL( CStifItemParser& /*aItem*/ )
+    {
+    CPsmClient* psmClient = CPsmClient::NewL( *this );
+    CleanupStack::PushL(psmClient);
+   
+    CPsmClientImpl* psmImpl = static_cast<CPsmClientImpl*> (psmClient);
+    psmImpl->HeapReset();
+    psmImpl->HeapMark(); 
+    for (TInt allocFailRate = 1;; allocFailRate++)
+        {
+        
+        psmImpl->SetHeapFailure( allocFailRate );
+              
+        TInt err = psmImpl->PsmSettings().BackupAndGetSettings( iPsmConfigArray, KCenRepUid2 );
+       
+        if (err == KErrNone)
+            {
+            
+            break;            
+            }         
+        }
+    psmImpl->HeapMarkEnd();
+    psmImpl->HeapReset();  
+    CleanupStack::PopAndDestroy(psmClient);
+    return KErrNone;  
+    }
+
+// -----------------------------------------------------------------------------
+// CPSMTest::OOMPsmGetSettings
+// -----------------------------------------------------------------------------
+//
+TInt CPSMTest::OOMPsmGetSettingsL( CStifItemParser& /*aItem*/ )
+    {
+    CPsmClient* psmClient = CPsmClient::NewL( *this );
+    CleanupStack::PushL(psmClient);
+    CPsmClientImpl* psmImpl = static_cast<CPsmClientImpl*> (psmClient);
+
+    for (TInt allocFailRate = 1;; allocFailRate++)
+        {
+        psmImpl->HeapReset();
+        psmImpl->SetHeapFailure( allocFailRate );
+        psmImpl->HeapMark();       
+        TInt err = psmImpl->PsmSettings().GetSettings( iPsmConfigArray, KCenRepUid2 );
+        psmImpl->HeapMarkEnd();
+        if (err == KErrNone)
+            {
+            psmImpl->HeapReset();  
+            break;            
+            }         
+        }
+    CleanupStack::PopAndDestroy(psmClient);
+    return KErrNone;  
+    }
+
+// -----------------------------------------------------------------------------
+// CPSMTest::OOMPsmBackupSettings
+// -----------------------------------------------------------------------------
+//
+TInt CPSMTest::OOMPsmBackupSettingsL( CStifItemParser& /*aItem*/ )
+    {
+    CPsmClient* psmClient = CPsmClient::NewL( *this );
+    CleanupStack::PushL(psmClient);
+    CPsmClientImpl* psmImpl = static_cast<CPsmClientImpl*> (psmClient);
+	//IGNORE the error of Powersave mode request. If Powersave mode is not enabled the Backupsettings will fail with KErrWrite.
+    psmImpl->ChangePowerSaveMode(1);
+    iSchedulerWait.Start();    
+    RConfigInfoArray psmConfigArray;
+    GenerateConfigArray( psmConfigArray, EPsmsrvModePowerSave, 0 ); 
+    psmImpl->HeapReset();
+    psmImpl->HeapMark();
+    for (TInt allocFailRate = 1;; allocFailRate++)
+        {       
+        psmImpl->SetHeapFailure( allocFailRate );
+        TInt err = psmImpl->PsmSettings().BackupSettings( psmConfigArray, KCenRepUid2 );
+        iLog->Log( _L("PSMTest: BackupSettings- iPsmConfigArray.Count(): %d"), psmConfigArray.Count() );
+        if (err == KErrNone)
+            {            
+            break;            
+            }      
+        }
+    psmImpl->HeapMarkEnd();
+    psmImpl->HeapReset(); 
+    psmConfigArray.Close();   
+    CleanupStack::PopAndDestroy(psmClient);
+    return KErrNone; 
+    }
+
+#endif //_DEBUG     
 //  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/data/bld.inf	Mon Aug 23 14:47:20 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Hardware Resource Manager data files
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+InternalHWRMLightsPolicy.ini           z:/private/101f7a02/customerhwrmlightspolicy.ini
+InternalHWRMVibraPolicy.ini            z:/private/101f7a02/customerhwrmvibrapolicy.ini
+InternalHWRMFmTxPolicy.ini             z:/private/101f7a02/customerhwrmfmtxpolicy.ini
+
+
+//  End of File  
--- a/resourcemgmt/group/bld.inf	Tue Aug 10 14:46:45 2010 +0300
+++ b/resourcemgmt/group/bld.inf	Mon Aug 23 14:47:20 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"
@@ -21,22 +21,13 @@
 DEFAULT
 
 PRJ_EXPORTS
-../data/InternalHWRMLightsPolicy.ini           z:/private/101f7a02/customerhwrmlightspolicy.ini
-../data/InternalHWRMVibraPolicy.ini            z:/private/101f7a02/customerhwrmvibrapolicy.ini
-../data/InternalHWRMFmTxPolicy.ini             z:/private/101f7a02/customerhwrmfmtxpolicy.ini
 
-
+#include "../data/bld.inf"
 #include "../hwresourcesmgr/group/bld.inf"
 #include "../hwresourcesmgrconfig/bld.inf"
 #include "../powerandmemorynotificationservice/group/bld.inf"
 #include "../hwrmfmtxwatcherplugin/group/bld.inf"
-
-#if  defined(WINSCW) && !defined(__HWRM_TARGET_MODIFIER_PLUGIN)
-// Do nothing
-#else
 #include "../hwrmtargetmodifierplugin/group/bld.inf"
-#endif
-
 #include "../vibractrl/group/bld.inf"
 
 //  End of File  
--- a/resourcemgmt/hwresourcesmgrconfig/bld.inf	Tue Aug 10 14:46:45 2010 +0300
+++ b/resourcemgmt/hwresourcesmgrconfig/bld.inf	Mon Aug 23 14:47:20 2010 +0300
@@ -34,3 +34,5 @@
 ./conf/hwresourcesandenhancements_1020506A.crml OS_LAYER_EXPORTS_CRML(hwresourcesandenhancements_1020506a.crml)
 ./conf/hwresourcesandenhancements_10200C8D.crml OS_LAYER_EXPORTS_CRML(hwresourcesandenhancements_10200c8d.crml)
 
+// Customization interface confml file
+./conf/ci_hwresourcesandenhancements.confml 		OS_LAYER_EXPORTS_CONFML(ci_hwresourcesandenhancements.confml)
Binary file resourcemgmt/hwresourcesmgrconfig/conf/ci_hwresourcesandenhancements.confml has changed
Binary file resourcemgmt/hwresourcesmgrconfig/conf/hwresourcesandenhancements.confml has changed
--- a/resourcemgmt/hwrmtargetmodifierplugin/group/bld.inf	Tue Aug 10 14:46:45 2010 +0300
+++ b/resourcemgmt/hwrmtargetmodifierplugin/group/bld.inf	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 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,6 +15,10 @@
 *                build information file
 *
 */
+#if  defined(WINSCW) && !defined(__HWRM_TARGET_MODIFIER_PLUGIN)
+// Do nothing
+#else
+
 #include <platform_paths.hrh>
 
 PRJ_PLATFORMS
@@ -26,5 +30,5 @@
 PRJ_MMPFILES
 ../group/hwrmdefaultlighttargetmodifierplugin.mmp
 
-
+#endif
 //  End of File  
--- a/sensorservices/orientationssy/inc/OrientationCRListener.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/inc/OrientationCRListener.h	Mon Aug 23 14:47:20 2010 +0300
@@ -87,7 +87,7 @@
 class MCenRepCallBack
     {
 public:
-    virtual void CreateConfigurations() = 0;
+    virtual TInt CreateConfigurations() = 0;
     };
 
 #endif // ORIENTATIONCRLISTENER_H
--- a/sensorservices/orientationssy/inc/SsyOrientation.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/inc/SsyOrientation.h	Mon Aug 23 14:47:20 2010 +0300
@@ -104,14 +104,14 @@
         /**
         * Create configurations for angles and timers
         */
-        void CreateConfigurations();
+        TInt CreateConfigurations();
         
         /**
         * Used for creating configuration for angle definitions
         *
         * @param aConfigurationForState the configuration to set.
         */
-        void SetConfigurationForState( 
+        TInt SetConfigurationForState( 
         const TOrientationConfiguration&
               aConfigurationForState );
         
--- a/sensorservices/orientationssy/src/OrientationCRListener.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/src/OrientationCRListener.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -91,7 +91,7 @@
 	SSY_TRACE( EExtended, "ORIENTATIONSSY:RunL::Key %d changed", iStatus.Int() );
     iRepository->NotifyRequest( iStatus.Int(), iStatus );
 
-	iCallBack.CreateConfigurations();
+        User::LeaveIfError(iCallBack.CreateConfigurations());
 
     if( !IsActive() )
         {
--- a/sensorservices/orientationssy/src/SsyChannel.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyChannel.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -208,7 +208,12 @@
 // CSSYChannel::RunError()
 // ----------------------------------------------------------------------------------
 // 
+#ifdef _DEBUG
 TInt CSSYChannel::RunError( TInt aError )
+#else
+// not used in UREL builds
+TInt CSSYChannel::RunError( TInt /*aError*/ )
+#endif
     {
     SSY_TRACE( EMust, "ORIENTATIONSSY:RunError %d", aError );
     
--- a/sensorservices/orientationssy/src/SsyControlOrientation.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyControlOrientation.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -224,8 +224,8 @@
 
         if ( channel )
             {
-            iChannelArray.Append( channel );
-            channelInfoList.Append( channelInfo );
+            User::LeaveIfError(iChannelArray.Append( channel ));
+            User::LeaveIfError(channelInfoList.Append( channelInfo));
             }
         }
 
--- a/sensorservices/orientationssy/src/SsyOrientation.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyOrientation.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -186,7 +186,7 @@
 void CSSYOrientation::ConstructL()
     {
     iRepository = CRepository::NewL( KCRUidOrientationSsySettings );
-    CreateConfigurations();
+     User::LeaveIfError(CreateConfigurations());
     
 #ifdef AUTO_ORIENTAION_TEST
     iCRListener = CSsyOrientationCRListener::NewL( *this, iRepository );
@@ -1090,11 +1090,13 @@
 // CSSYOrientation::SetConfigurationForState()
 // ----------------------------------------------------------------------------------
 //
-void CSSYOrientation::SetConfigurationForState(
+TInt CSSYOrientation::SetConfigurationForState(
  const TOrientationConfiguration& aConfigurationForState )
     {
     SSY_TRACE_IN();
     TBool wasFound( EFalse );
+    TInt retVal( KErrNone );
+    
     // Check if is in array
     for( TInt i = 0; i != iConfigArray.Count(); i++ )
         {
@@ -1102,15 +1104,17 @@
         if( aConfigurationForState.iOrientationState == iConfigArray[ i ].iOrientationState )
             {
             iConfigArray.Remove( i );
-            iConfigArray.Insert( aConfigurationForState, i );
+            retVal = iConfigArray.Insert( aConfigurationForState, i );
             wasFound = ETrue;
             }
         }
     if( !wasFound )
         {
-        iConfigArray.Append( aConfigurationForState );
+        retVal = iConfigArray.Append( aConfigurationForState );
         }
+	
     SSY_TRACE_OUT();
+    return retVal;
     }
 
 // ----------------------------------------------------------------------------------
@@ -1139,11 +1143,12 @@
 // CSSYOrientation::CreteConfigurations()
 // ----------------------------------------------------------------------------------
 //
-void CSSYOrientation::CreateConfigurations()
+TInt CSSYOrientation::CreateConfigurations()
     {
     SSY_TRACE_IN();
     
     TInt repValue( 0 );
+    TInt retVal( KErrNone );
     
     // This is used in initialisation
     if( iConfigForCurrentState.iOrientationState == TSensrvOrientationData::EOrientationUndefined )
@@ -1208,7 +1213,13 @@
     SSY_TRACE( EExtended, "ORIENTATIONSSY:CreteConfigurations::EOrientationDisplayUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds=%d", repValue );
     configForDisplayUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds = repValue;
     
-    SetConfigurationForState( configForDisplayUp );
+    retVal = SetConfigurationForState( configForDisplayUp );
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState(configForDisplayUp)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+         }
     
     // Configuration for display down
     TOrientationConfiguration configForDisplayDown;
@@ -1256,7 +1267,14 @@
     iRepository->Get( KOriStateDisplayDownToDisplayDownwardsTimerKey, repValue );
     SSY_TRACE( EExtended, "ORIENTATIONSSY:CreteConfigurations::EOrientationDisplayDown.iOrientationDisplayDownwards.iTimerValueInMilSeconds=%d", repValue );
     configForDisplayDown.iOrientationDisplayDownwards.iTimerValueInMilSeconds = repValue;
-    SetConfigurationForState( configForDisplayDown );
+
+    retVal = SetConfigurationForState( configForDisplayDown);
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState(configForDisplayDown)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+         }
     
     // Configuration for left up
     TOrientationConfiguration configForDisplayLeftUp;
@@ -1304,7 +1322,14 @@
     iRepository->Get( KOriStateDisplayLeftUpToDisplayDownwardsTimerKey, repValue );
     SSY_TRACE( EExtended, "ORIENTATIONSSY:CreteConfigurations::EOrientationDisplayLeftUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds=%d", repValue );
     configForDisplayLeftUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds = repValue;
-    SetConfigurationForState( configForDisplayLeftUp );
+
+    retVal = SetConfigurationForState( configForDisplayLeftUp );
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState(configForDisplayLeftUp)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+         }
     
     // Configuration for right up
     TOrientationConfiguration configForDisplayRightUp;
@@ -1352,7 +1377,14 @@
     iRepository->Get( KOriStateDisplayRightUpToDisplayDownwardsTimerKey, repValue );
     SSY_TRACE( EExtended, "ORIENTATIONSSY:CreteConfigurations::EOrientationDisplayRightUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds=%d", repValue );
     configForDisplayRightUp.iOrientationDisplayDownwards.iTimerValueInMilSeconds = repValue;
-    SetConfigurationForState( configForDisplayRightUp );
+
+    retVal = SetConfigurationForState( configForDisplayRightUp );
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState( configForDisplayRightUp)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+         }
     
     // Configuration for upwards
     TOrientationConfiguration configForDisplayUpwards;
@@ -1400,7 +1432,14 @@
     iRepository->Get( KOriStateDisplayUpwardsToDisplayDownwardsTimerKey, repValue );
     SSY_TRACE( EExtended, "ORIENTATIONSSY:CreteConfigurations::EOrientationDisplayUpwards.iOrientationDisplayDownwards.iTimerValueInMilSeconds=%d", repValue );
     configForDisplayUpwards.iOrientationDisplayDownwards.iTimerValueInMilSeconds = repValue;
-    SetConfigurationForState( configForDisplayUpwards );
+
+    retVal = SetConfigurationForState( configForDisplayUpwards);
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState( configForDisplayUpwards)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+         }
     
     // Configuration for downwards
     TOrientationConfiguration configForDisplayDownwards;
@@ -1450,7 +1489,14 @@
     configForDisplayDownwards.iOrientationDisplayDownwards.iAngle = 0;
     configForDisplayDownwards.iOrientationDisplayDownwards.iTimerValueInMilSeconds = 0;
     
-    SetConfigurationForState( configForDisplayDownwards );
+
+    retVal = SetConfigurationForState( configForDisplayDownwards);
+    if( retVal != KErrNone)
+        {
+        SSY_TRACE( EExtended, "ORIENTATIONSSY:SetConfigurationForState( configForDisplayDownwards)=%d", retVal);
+        SSY_TRACE_OUT();
+	return retVal;
+        }
     
     if( iConfigForCurrentState.iOrientationState != TSensrvOrientationData::EOrientationUndefined )
         {
@@ -1459,6 +1505,7 @@
         }
     
     SSY_TRACE_OUT();
+    return retVal;
     }
 
 // ----------------------------------------------------------------------------------
--- a/sensorservices/orientationssy/src/SsyProperty.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/orientationssy/src/SsyProperty.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -52,7 +52,11 @@
 
     for ( TInt index = 0; index < aNumberOfProperties ; index++ )
         {
-        iChannelProperties.Append( aProperties[ index ] );
+        if(iChannelProperties.Append( aProperties[ index ])!= KErrNone )
+        {
+         iChannelProperties.Reset();
+         break;
+        }
         }
 
     SSY_TRACE_OUT();
--- a/sensorservices/sensorserver/inc/server/senserverchannel.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/sensorserver/inc/server/senserverchannel.h	Mon Aug 23 14:47:20 2010 +0300
@@ -281,18 +281,6 @@
         CSensrvConditionEvaluator* ConditionEvaluatorL();
 
         /**
-        * Get clients of this channel. The client identified by aCallerSecureId
-        * is not added to the affected clients list.
-        *
-        * @since S60 5.0
-        * @param[in,out] aAffectedClients On return contains client
-        *                 processes priorities for this channel.
-        * @param[in]     aCallerSecureId Identifies the listener which is filtered away.
-        */
-        void GetAffectedClients( RArray<TInt>& aAffectedClients,
-                                 TSecureId aCallerSecureId );
-
-        /**
         * Gets listener for session.
         *
         * @since S60 5.0
--- a/sensorservices/sensorserver/src/server/sensrvchannel.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/sensorserver/src/server/sensrvchannel.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -82,6 +82,7 @@
     {
     COMPONENT_TRACE( ( _L( "Sensor Server - CSensrvChannel::ConstructL()" ) ) );
 
+		// coverity[SIZECHECK]
     iChannelQueue = CSensrvTransactionQueue::NewL( ETrue );
 
     iChannelInfo.iChannelGroup = TSensrvResourceChannelInfo::ESensrvChannelGroupNotSolved;
@@ -979,34 +980,7 @@
     return previousLow;
     }
 
-// ---------------------------------------------------------------------------
-// CSensrvChannel::GetAffectedClients
-//
-// Client is considered as "affected" if the channel is opened by the client.
-// When the channel is open, channel listener also exists.
-// Priorities are queried from ChannelListener.
-// ---------------------------------------------------------------------------
-//
-void CSensrvChannel::GetAffectedClients( RArray<TInt>& aAffectedClients,
-                                         TSecureId aCallerSecureId  )
-    {
-    COMPONENT_TRACE( ( _L( "Sensor Server - CSensrvChannel::GetAffectedClients()" ) ) );
 
-    TInt count(iListenerList.Count());
-    for (TInt i=0; i < count; i++)
-        {
-        if (aCallerSecureId == iListenerList[i]->Session().SecureId() )
-            {
-            //Filter away
-            }
-        else
-            {
-            aAffectedClients.Append( iListenerList[i]->Priority() );
-            }
-        }
-
-    COMPONENT_TRACE( ( _L( "Sensor Server - CSensrvChannel::GetAffectedClients - %d client(s) found - return" ), count ) );
-    }
 
 // ---------------------------------------------------------------------------
 // Creates a new condition evaluator or returns an existing one.
--- a/sensorservices/sensorserver/src/server/sensrvpluginproxy.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/sensorserver/src/server/sensrvpluginproxy.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -80,7 +80,8 @@
     User::LeaveIfError(iMutex.CreateLocal());
 
     iMutex.Wait();
-
+    
+		// coverity[SIZECHECK]
     iLoadWaitQueue = CSensrvTransactionQueue::NewL(ETrue);
 
     iTransactionMonitor = CSensrvTransactionMonitor::NewL(*this);
--- a/sensorservices/sensorserver/src/server/sensrvproxymanager.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/sensorserver/src/server/sensrvproxymanager.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -90,7 +90,10 @@
 
     iServerShutdown = CSensrvShutdown::NewL( *this );
 
+		// coverity[SIZECHECK]
     iWaitQueueQueryChannels = CSensrvTransactionQueue::NewL(ETrue);
+    	
+    // coverity[SIZECHECK]	
     iWaitQueueOpenChannel   = CSensrvTransactionQueue::NewL(ETrue);
 
     // Create ecom changelistener, which will make the initial check for plugins
--- a/sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h	Mon Aug 23 14:47:20 2010 +0300
@@ -72,8 +72,7 @@
         // @see CActive
         TInt RunError( TInt aError );
 	public:
-		void Start( );
-        
+		void Start(TInt aHrz );
     private: // Private data for base channel
     
     // The timer object
--- a/sensorservices/tiltcompensationssy/inc/tcstatetiltlistendata.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/inc/tcstatetiltlistendata.h	Mon Aug 23 14:47:20 2010 +0300
@@ -173,9 +173,6 @@
         // Pointer to the timer
         CTCSendEventTimer* iTimerToSend;
         
-        // Flag that states if the property has changed
-        TBool iHasChanged;
-        
         // The requested amount of data
         TInt iRequestedDataCount;
         
--- a/sensorservices/tiltcompensationssy/src/tccenrepobserver.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tccenrepobserver.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -110,8 +110,13 @@
 // CTCCenrepObserver::HandleNotifyError
 // -----------------------------------------------------------------------------
 //
+#ifdef _DEBUG
 void CTCCenrepObserver::HandleNotifyError(
     TUint32 /*aKey*/, TInt aError, CCenRepNotifyHandler* aHandler)
+#else
+void CTCCenrepObserver::HandleNotifyError(
+    TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* aHandler)
+#endif
     {
     ERROR_1( aError, "CTCCenrepObserver::HandleNotifyError - aError: %d ", aError ); 
     
--- a/sensorservices/tiltcompensationssy/src/tcchanneltilt.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcchanneltilt.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -898,8 +898,14 @@
 // CTCChannelTilt::DataError
 // ----------------------------------------------------------------------------------
 //
+#ifdef _DEBUG
 void CTCChannelTilt::DataError( CSensrvChannel& /*aChannel*/, 
     TSensrvErrorSeverity aError )
+
+#else
+void CTCChannelTilt::DataError( CSensrvChannel& /*aChannel*/, 
+    TSensrvErrorSeverity /*aError*/ )
+#endif
     {
     FUNC_LOG;
     
@@ -1150,8 +1156,14 @@
 // CTCChannelTilt::PropertyChanged
 // ----------------------------------------------------------------------------------
 //
+#ifdef _DEBUG
 void CTCChannelTilt::PropertyError( CSensrvChannel& /*aChannel*/, 
     TSensrvErrorSeverity aError )
+#else
+// not used in UREL builds
+void CTCChannelTilt::PropertyError( CSensrvChannel& /*aChannel*/, 
+    TSensrvErrorSeverity /*aError*/ )
+#endif
     {
     FUNC_LOG;
     INFO_1( "Property error [%d]", aError );
@@ -1161,7 +1173,12 @@
 // CTCChannelTilt::SetPropertySuccessIndicationChanged
 // -----------------------------------------------------------------------------
 //
+#ifdef _DEBUG
 void CTCChannelTilt::SetPropertySuccessIndicationChanged( TSetPropertySuccessIndicator aIndication )
+#else
+// not used in UREL builds
+void CTCChannelTilt::SetPropertySuccessIndicationChanged( TSetPropertySuccessIndicator /*aIndication*/ )
+#endif
     {
     FUNC_LOG;
     
--- a/sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcsendeventtimer.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -75,8 +75,9 @@
 	User::LeaveIfError( ret );
 	iTimerToHzLevel = aSetTimerToHzLevel;
 	}
-void CTCSendEventTimer::Start()
+void CTCSendEventTimer::Start(TInt aHrz)
 	{
+	iTimerToHzLevel = aHrz;
 	TTimeIntervalMicroSeconds32 interval( KOneSecondInMicroSeconds / iTimerToHzLevel );
 		
 	if( !IsActive() )
--- a/sensorservices/tiltcompensationssy/src/tcstatetiltidle.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcstatetiltidle.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -75,6 +75,7 @@
         case EEventIdHandleOpenChannel:
             {
             iTransactionHandler.ProcessTransactionL( ETCTransactionIdOpenChannel );
+            break;
             }
         default:
             {
--- a/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sensorservices/tiltcompensationssy/src/tcstatetiltlistendata.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -280,7 +280,6 @@
                 {
                 property.iProperty.GetValue( iHzSamplingRate );
                 INFO_1( "Sampling rate changed to: %d", iHzSamplingRate );
-                iHasChanged = ETrue;
                 HandleStateEntryL();
                 }
             break;
@@ -355,19 +354,8 @@
     if( !iTimerToSend )
         {
         iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
-		iTimerToSend->Start();
         }
-    else if( iHasChanged )
-        {
-        delete iTimerToSend;
-        iTimerToSend = NULL;
-        iTimerToSend = CTCSendEventTimer::NewL( iHzSamplingRate, *this );
-        iHasChanged = EFalse;
-        }
-	else
-		{
-		iTimerToSend->Start();
-		}
+	iTimerToSend->Start(iHzSamplingRate);
     }
 
 // ----------------------------------------------------------------------------------
@@ -474,7 +462,7 @@
     else
     	{
     	if( iTimerToSend )
-    		iTimerToSend->Start();
+    		iTimerToSend->Start(iHzSamplingRate);
     	}
     }
 
@@ -512,7 +500,11 @@
 // CTCStateTiltListenData::CenrepValueChanged
 // -----------------------------------------------------------------------------
 //
+#ifdef _DEBUG
 void CTCStateTiltListenData::CenrepValueChanged( TUint32 aKey, CRepository& aRepository )
+#else
+void CTCStateTiltListenData::CenrepValueChanged( TUint32 /*aKey*/, CRepository& aRepository )
+#endif
     {
     FUNC_LOG;
 
--- a/sysstatemgmt/systemstarter/group/loadamastart.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/group/loadamastart.mmp	Mon Aug 23 14:47:20 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,7 @@
 
 userinclude		../inc
 
-systeminclude  	/epoc32/include
-systeminclude  	/epoc32/include/ssm
+OS_LAYER_SYSTEMINCLUDE
 
 sourcepath		../amastartsrc
 
--- a/sysstatemgmt/systemstarter/inc/loadamastart.h	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/inc/loadamastart.h	Mon Aug 23 14:47:20 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"
@@ -16,7 +16,7 @@
 #ifndef __LOADAMASTART_H__
 #define __LOADAMASTART_H__
 
-#include <ssmloadamastart.h>
+#include <ssm/ssmloadamastart.h>
 
 class CAmaStart;
 
--- a/sysstatemgmt/systemstarter/src/StartupSplashScreen.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/src/StartupSplashScreen.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -93,12 +93,14 @@
    
   	// Define a splash property to control display and removal of
   	// the splash screen on system start up.    
- 	RProperty::Define(KSplashPropertyKey, RProperty::EInt, 
+ 	// Ignoring the error value.
+	TInt err = RProperty::Define(KSplashPropertyKey, RProperty::EInt, 
  							KSplashReadPolicy, KSplashWritePolicy);
-  
+	DEBUGPRINT2(_L("Defining the KSplashPropertyKey completed with %d"), err);
+
  	// Create and set off the splash screen process.
 	RProcess splash;	 
-	TInt err = splash.Create(*iSplashPath, KNullDesC);
+	err = splash.Create(*iSplashPath, KNullDesC);
 	if (err == KErrNone)
 		{
 		splash.Resume();
--- a/sysstatemgmt/systemstarter/test/tamastarter/group/tamastarter_server.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/test/tamastarter/group/tamastarter_server.mmp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -30,9 +30,6 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 MW_LAYER_SYSTEMINCLUDE_SYMBIAN 
-#ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT
-SYSTEMINCLUDE     /epoc32/include/ssm
-#endif // SYMBIAN_SYSTEM_STATE_MANAGEMENT
 
 USERINCLUDE	  ../inc
 USERINCLUDE	  ../../../inc
--- a/sysstatemgmt/systemstarter/test/tamastarter/resource/emulator/tamastarter_amaadder_ssma.rss	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/test/tamastarter/resource/emulator/tamastarter_amaadder_ssma.rss	Mon Aug 23 14:47:20 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"
@@ -16,9 +16,9 @@
 //
 
 #include <ssm/ssmcmd.rh>
-#include <ssmsubstates.hrh>
-#include <cmdpersistreboots.rh>
-#include <cmdpersistreboots.hrh>
+#include <ssm/ssmsubstates.hrh>
+#include <ssm/cmdpersistreboots.rh>
+#include <ssm/cmdpersistreboots.hrh>
 
 UID2 KUidSsmCommandListResourceFile
 
--- a/sysstatemgmt/systemstarter/test/tamastarter/resource/hardware/tamastarter_amaadder_ssma.rss	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstarter/test/tamastarter/resource/hardware/tamastarter_amaadder_ssma.rss	Mon Aug 23 14:47:20 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"
@@ -16,9 +16,9 @@
 //
 
 #include <ssm/ssmcmd.rh>
-#include <ssmsubstates.hrh>
-#include <cmdpersistreboots.rh>
-#include <cmdpersistreboots.hrh>
+#include <ssm/ssmsubstates.hrh>
+#include <ssm/cmdpersistreboots.rh>
+#include <ssm/cmdpersistreboots.hrh>
 
 UID2 KUidSsmCommandListResourceFile
 
--- a/sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistimpl.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistimpl.cpp	Mon Aug 23 14:47:20 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"
@@ -430,7 +430,7 @@
 		User::LeaveIfError(file.Open(rfs, iResourceFileName, EFileRead | EFileShareReadersOnly));
 		CleanupClosePushL(file);
 		// read entire resource file into a buffer
-		TInt fileSize;
+		TInt fileSize(0);
 		User::LeaveIfError(file.Size(fileSize));
 		RBuf8 buf;
 		buf.CreateL(fileSize);
--- a/sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistresourcereaderimpl.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/cmd/src/ssmcommandlistresourcereaderimpl.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -567,7 +567,7 @@
 	User::LeaveIfError(file.Open(iFs, aFileName, EFileRead | EFileShareReadersOnly));
 
 	// read entire resource file into a buffer
-	TInt fileSize;
+	TInt fileSize(0);
 	User::LeaveIfError(file.Size(fileSize));
 	RBuf8 buf;
 	buf.CreateL(fileSize);
--- a/sysstatemgmt/systemstatemgr/ssm/src/ssmsession.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/ssm/src/ssmsession.cpp	Mon Aug 23 14:47:20 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"
@@ -79,7 +79,7 @@
 			const TUint swpKey = {aMessage.Int0()};
 			const TInt deslen = aMessage.GetDesLengthL(1);
 			RBuf filename;
-			filename.Create(deslen);
+			filename.CreateL(deslen);
 			filename.CleanupClosePushL();
 			aMessage.ReadL(1, filename);
 			SsmServer()->RequestRegisterSwpMappingL(swpKey, filename);
@@ -150,7 +150,7 @@
 			const TUint swpKey = {aMessage.Int0()};
 			const TInt length = aMessage.GetDesLengthL(1);
 			RBuf filename;
-			filename.Create(length);
+			filename.CreateL(length);
 			filename.CleanupClosePushL();
 			aMessage.ReadL(1, filename);
 			SsmServer()->RequestDeRegisterSwpMappingL(swpKey, filename);
--- a/sysstatemgmt/systemstatemgr/sus/src/susmiscadaptation.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/sus/src/susmiscadaptation.cpp	Mon Aug 23 14:47:20 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"
@@ -128,7 +128,7 @@
 void CMiscAdaptation::DoGetSimLanguagesArrayL(const RMessage2& aMessage)
 	{
 	const TInt simLanguageCount = aMessage.Int1();
-	CBufFlat* const buf=CBufFlat::NewL(simLanguageCount * sizeof(TInt32));
+	CBufFlat* const buf=CBufFlat::NewL(simLanguageCount * sizeof(TInt));
 	CleanupStack::PushL(buf);
 
 	iMiscAdaptation.GetSimLanguagesL(buf, simLanguageCount);
--- a/sysstatemgmt/systemstateplugins/conditionevaluator/src/cndsystemwideproperty.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/conditionevaluator/src/cndsystemwideproperty.cpp	Mon Aug 23 14:47:20 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"
@@ -19,6 +19,7 @@
  @internalComponent
 */
 
+#include "ssmdebug.h"
 #include "cndsystemwideproperty.h"
 #include <ssm/ssmsystemwideproperty.h>
 
@@ -48,8 +49,9 @@
   
     RSsmSystemWideProperty property;
 	User::LeaveIfError(property.Connect(iKey));
-	User::LeaveIfError(property.GetValue(value));
-	property.Close();
+	CleanupClosePushL(property);
+
+	SSMLOGLEAVEIFERROR(property.GetValue(value));
 	
     TBool retVal = EFalse;
     if (iConditionCheckType == ECompareValue)
@@ -60,5 +62,7 @@
         {
         retVal = ((value & iCndValue) == iCndValue);
         }
+
+	CleanupStack::PopAndDestroy(&property);
     return retVal;
     }
--- a/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyfail.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyfail.mmp	Mon Aug 23 14:47:20 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,7 +16,7 @@
 #ifdef WINS
 TARGET			ssm.state.policy.0003.dll
 #else
-TARGET			ssm.state.policy.hw.0003.dll
+TARGET			ssm.refrence.state.policy.hw.0003.dll
 #endif
 TARGETTYPE		dll
 UID				0x2000D75D 0x20010330
--- a/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicynormal.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicynormal.mmp	Mon Aug 23 14:47:20 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"
--- a/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyshutdown.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicyshutdown.mmp	Mon Aug 23 14:47:20 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,7 +16,7 @@
 #ifdef WINS
 TARGET			ssm.state.policy.0002.dll
 #else
-TARGET			ssm.state.policy.hw.0002.dll
+TARGET			ssm.refrence.state.policy.hw.0002.dll
 #endif
 TARGETTYPE		dll
 UID				0x2000D75D 0x2001032D
--- a/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicystartup.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/gsapolicy/group/gsastatepolicystartup.mmp	Mon Aug 23 14:47:20 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,7 +16,7 @@
 #ifdef WINS
 TARGET			ssm.state.policy.0000.dll
 #else
-TARGET			ssm.state.policy.hw.0000.dll
+TARGET			ssm.refrence.state.policy.hw.0000.dll
 #endif
 TARGETTYPE		dll
 UID				0x2000D75D 0x2000D75F
@@ -58,14 +58,6 @@
 TARGETPATH		/private/2000d75b/startup/8
 END
 
-// Launch 'sysstart.exe' if startup resource is not found. If 'sysstart.exe' fails, launch 'sysagt2svr.exe' and 'wserv.exe'
-// resource file to fallback to 'sysstart.exe'
-// resource file path format : "z:/private/<SID of SSM>/startup/fallback/"
-SOURCEPATH		../resource/wins
-START RESOURCE	fallbacktosysstart.rss
-TARGETPATH		/private/2000d75b/startup/fallback
-END
-
 #else	//for hardware//
 
 SOURCEPATH		../resource/armv5
--- a/sysstatemgmt/systemstateplugins/gsapolicy/group/sspluginsgsa.iby	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/gsapolicy/group/sspluginsgsa.iby	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -17,45 +17,27 @@
 #ifndef __SSPLUGINSGSA_IBY__
 #define __SSPLUGINSGSA_IBY__
 
-file=ABI_DIR\BUILD_DIR\ssm.state.policy.hw.0000.dll		sys\bin\ssm.state.policy.0000.dll
 file=ABI_DIR\BUILD_DIR\ssm.state.policy.0001.dll		sys\bin\ssm.state.policy.0001.dll
-file=ABI_DIR\BUILD_DIR\ssm.state.policy.hw.0002.dll		sys\bin\ssm.state.policy.0002.dll
-file=ABI_DIR\BUILD_DIR\ssm.state.policy.hw.0003.dll		sys\bin\ssm.state.policy.0003.dll
 
-// rsc files for the rom
-data=EPOCROOT##epoc32\data\z\private\2000d75b\startup\fallback\fallbacktosysstart_target.rsc		private\2000d75b\startup\fallback\fallbacktosysstart.rsc
 
 data=EPOCROOT##epoc32\data\z\private\2000d75b\normal\gsanormalcmdlist.rsc		private\2000d75b\normal\gsanormalcmdlist.rsc
+
+// If it is NCP image that is being made (_IMAGE_TYPE_NCP defined)then NCP ssm.state.policy is used. which 
+// is used for textshell mode only.
+#if defined(_IMAGE_TYPE_NCP)
+file=ABI_DIR\BUILD_DIR\ssm.refrence.state.policy.hw.0000.dll		sys\bin\ssm.state.policy.0000.dll
+file=ABI_DIR\BUILD_DIR\ssm.refrence.state.policy.hw.0002.dll		sys\bin\ssm.state.policy.0002.dll
+file=ABI_DIR\BUILD_DIR\ssm.refrence.state.policy.hw.0003.dll		sys\bin\ssm.state.policy.0003.dll
+
 data=EPOCROOT##epoc32\data\z\private\2000d75b\shutdown\gsashutdowncmdlist.rsc		private\2000d75b\shutdown\gsashutdowncmdlist.rsc
 data=EPOCROOT##epoc32\data\z\private\2000d75b\fail\gsafailcmdlist.rsc			private\2000d75b\fail\gsafailcmdlist.rsc
 
+#endif //_IMAGE_TYPE_NCP
 REM Simple startup configuration - install a single resource file 
 REM as the default "mode 0" file.
-REM Note this is a Techview specific way of including just the 
-REM SCL required in the ROM. Licensees are expected to include more 
-REM than one SCL in their devices.
 
-REM If _STARTUPMODE, _STARTUPMODE1, _STARTUPMODE2 etc. are defined
-REM then SysStart fallback should be used so no SCL rss files will be included
-REM thus forcing the startup policy to use 
 REM The macro for selecting SCL lists is _SSMSTARTUPMODE
 
-#if (defined(_STARTUPMODE) || \
-	defined(_STARTUPMODE0) || \
-	defined(_STARTUPMODE1) || \
-	defined(_STARTUPMODE2) || \
-	defined(_STARTUPMODE3) || \
-	defined(_STARTUPMODE4) || \
-	defined(_STARTUPMODE5) || \
-	defined(_STARTUPMODE8))
-
-REM SysStart startup mode defines found, using SysStart startup
-WARNING "Use _SSMSTARTUPMODE instead of _STARTUPMODE as it is deprecated."
-WARNING "_STARTUPMODE can only be used for testing fallback on SysStart by including sysstart.iby and sysstartconfig.iby in buildrom command " 
-
-#else
-
-REM No legacy SysStart startup mode defines found, using SSM startup
 #ifdef _SSMSTARTUPMODE
 
 define _2000D75B_MODE _SSMSTARTUPMODE
@@ -83,6 +65,4 @@
 
 #endif // SSMA_MINIMAL_BOOT
 
-#endif // Legacy SysStart mode defines not found
-
 #endif // __SSPLUGINSGSA_IBY__
--- a/sysstatemgmt/tsrc/public/basic/group/MT_SysLangUtil.mmp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/group/MT_SysLangUtil.mmp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002 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"
@@ -32,7 +32,6 @@
 USERINCLUDE             ../MT_SysLangUtil
 
 OS_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
 
 LIBRARY                 EUnit.lib
 LIBRARY                 EUnitUtil.lib
--- a/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession_DllMain.cpp	Tue Aug 10 14:46:45 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession_DllMain.cpp	Mon Aug 23 14:47:20 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
@@ -20,7 +20,7 @@
 #include "MT_RStarterSession.h"
 
 //  EXTERNAL INCLUDES
-#include <CEUnitTestSuite.h>
+#include <digia/eunit/CEUnitTestSuite.h>
 
 EXPORT_C MEUnitTest* CreateTestSuiteL()
     {