Revision: 201013 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 17:17:45 +0300
branchRCL_3
changeset 11 8d1d8440b626
parent 10 1fc153c72b60
child 15 21e939dd208a
Revision: 201013 Kit: 201015
accessoryservices/accessoryserver/BWINS/AccPolComU.DEF
accessoryservices/accessoryserver/EABI/AccPolComU.DEF
accessoryservices/accessoryserver/inc/Common/AccPolGenericIDArrayAccessor.h
accessoryservices/accessoryserver/src/Policy/AccPolAccessoryPolicy.cpp
accessoryservices/accessoryserver/src/Policy/AccPolGenericIDArrayAccessor.cpp
accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp
accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp
psmservices/psmserver/src/client/psmclientimpl.cpp
sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_cmd.iby
sysstatemgmt/systemstatemgr/test/tcmd/group/tcmd_server.mmp
sysstatemgmt/systemstatemgr/test/tcmd/inc/tcmd_step_resourcereader.h
sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7a.rss
sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7b.rss
sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7c.rss
sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp
sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp
--- a/accessoryservices/accessoryserver/BWINS/AccPolComU.DEF	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/BWINS/AccPolComU.DEF	Wed Apr 14 17:17:45 2010 +0300
@@ -60,4 +60,5 @@
 	?ValueInt@CCapValue@@QBEHAAJ@Z @ 59 NONAME ; int CCapValue::ValueInt(long &) const
 	?CompareCriticalValuesL@CCapabilityStorage@@QAEHABVTAccPolGenericID@@@Z @ 60 NONAME ; int CCapabilityStorage::CompareCriticalValuesL(class TAccPolGenericID const &)
 	?GetGenericID@CCapabilityStorage@@QAEHAAVTAccPolGenericID@@@Z @ 61 NONAME ; int CCapabilityStorage::GetGenericID(class TAccPolGenericID &)
+	?RemoveIndexFromGenericIDArray@TAccPolGenericIDArrayAccessor@@SAXAAVTAccPolGenericIDArray@@H@Z @ 62 NONAME ; void TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray(class TAccPolGenericIDArray &, int)
 
--- a/accessoryservices/accessoryserver/EABI/AccPolComU.DEF	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/EABI/AccPolComU.DEF	Wed Apr 14 17:17:45 2010 +0300
@@ -69,5 +69,5 @@
 	_ZTV22CAccPolAccessoryPolicy @ 68 NONAME ; #<VT>#
 	_ZTV9CCapValue @ 69 NONAME ; #<VT>#
 	_ZTVN18CCapabilityStorage14CListContainerE @ 70 NONAME ; #<VT>#
-	
+	_ZN29TAccPolGenericIDArrayAccessor29RemoveIndexFromGenericIDArrayER21TAccPolGenericIDArrayi @ 71 NONAME
 
--- a/accessoryservices/accessoryserver/inc/Common/AccPolGenericIDArrayAccessor.h	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/inc/Common/AccPolGenericIDArrayAccessor.h	Wed Apr 14 17:17:45 2010 +0300
@@ -72,6 +72,18 @@
                     const TAccPolGenericIDArray& aSource,
                     TAccPolGenericIDArray& aTarget );
         
+       /** 
+        * Remove an index entry from Generic ID array. 
+        * 
+        * @since S60 3.1 
+        * @param aGenericIDArray Source Generic ID array. 
+        * @param aIndex Index entry to be removed from aGenericIDArray. 
+        * @return ?description 
+        */ 
+        IMPORT_C static void RemoveIndexFromGenericIDArray( 
+                    TAccPolGenericIDArray& aGenericIDArray, 
+                    TInt  aIndex );
+
         /**
         * Find Generic ID from array based on Device ID.
         *
--- a/accessoryservices/accessoryserver/src/Policy/AccPolAccessoryPolicy.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Policy/AccPolAccessoryPolicy.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -35,7 +35,7 @@
 
 // CONSTANTS
 
-const TInt KAccMaxRules = 6;
+const TInt KAccMaxRules = 7;
 
 const TInt  KAccConfigMaxCapabilityGroups = 64;
 const TInt  KAccGidIntBuf                 = 100;
@@ -295,6 +295,10 @@
                     {
                     // Audio is routed to current GID, so resolve mode because this can be accessory settings case.
                     SetAccessoryModeL( aGenericIDArray.GetGenericIDL( index ), accMode );
+                    if( accMode.iAccessoryMode == aCurrentAccessoryMode.iAccessoryMode )
+                        {
+                        accMode.iAudioOutputStatus = aCurrentAccessoryMode.iAudioOutputStatus;
+                        }
                     COM_TRACE_2( "[AccFW: ACCPOLICY] CAccPolAccessoryPolicy::ResolveAccessoryModeL - set mode according to current audio output status UniqueID, (UniqueID=%d, mode=%d) ", aCurrentAudioOutputStatusUniqueID, accMode.iAccessoryMode );
                     }
                 else
@@ -378,6 +382,7 @@
     // This should allocated from heap in future
     TAccPolMultibleConnectionRules aAccPolConnRules[KAccMaxRules] =
     {
+     {KPCHDMI,      0}, 
      {KPCWired,     KAccStereoAudio},
      {KPCWired,     KAccMonoAudio},
      {KPCBluetooth, KAccStereoAudio},
--- a/accessoryservices/accessoryserver/src/Policy/AccPolGenericIDArrayAccessor.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Policy/AccPolGenericIDArrayAccessor.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -108,6 +108,27 @@
     COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolGenericIDArrayAccessor::CopyGenericIDArrayL() - return void" );
     }
     
+
+EXPORT_C void TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray( 
+    TAccPolGenericIDArray& aGenericIDArray, 
+    TInt  aIndex) 
+    { 
+    COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray()" ); 
+    
+    TInt iArrayCount( aGenericIDArray.Count() );    
+    TInt i(aIndex); 
+    for ( ; i < (iArrayCount-1); ++i ) 
+        { 
+        aGenericIDArray.iGenericIDArray[i] = aGenericIDArray.iGenericIDArray[i+1]; 
+        } 
+    TAccPolGenericID emptyID; 
+    aGenericIDArray.iGenericIDArray[i] = emptyID; 
+
+    COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray() - return void" ); 
+    } 
+
+
+
 // -----------------------------------------------------------------------------
 // TAccPolGenericIDArrayAccessor::FindWithHWDeviceIDL
 // Look for a Generic ID from the array with device ID.
--- a/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -762,6 +762,13 @@
 
     iServerModel->CurrentConnectionStatusL( genericIDArray );
 
+    if( (EFalse == aAudioOutputStatus) && (KErrUnknown != aDbId) ) 
+        { 
+        TInt index( TAccPolGenericIDArrayAccessor::FindWithUniqueIDL( 
+                genericIDArray, aDbId) ); 
+        TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray(genericIDArray, index); 
+        }
+
     accMode = iPolicy->ResolveAccessoryModeL( genericIDArray, 
                                               aDbId, 
                                               aAudioOutputStatus, 
@@ -801,27 +808,30 @@
 				  TAccPolGenericID genericID;
 				  iServerModel->GetLastConnectedAccessoryL( genericID );
 				  TUint32 num = genericID.SubblockCaps();
-				  if( num & KSBAudioSubblock )
+				  if ( genericID.PhysicalConnectionCaps() != KPCHDMI ) // No info note for HDMI
 				      {
-					    CCapValue* capValue = iServerModel->CapabilityStorage().GetCapability( genericID, KAccIntegratedAudioInput );
-					    if( iInformationNoteDefault )
-						      {
-						      noteValue = iInformationNoteDefault;
-						      showNote = ETrue;
-						      }
-					    if( !capValue && !iInformationNoteDefault )
-						      {
-						      showNote = ETrue;
-						      }
-					    }
-				    else
-					    {
-					    if( iInformationNoteDefault )
-						      {
-						      noteValue = iInformationNoteDefault;
-						      showNote = ETrue;
-						      }
-					    }
+                      if( num & KSBAudioSubblock )
+                          {
+                            CCapValue* capValue = iServerModel->CapabilityStorage().GetCapability( genericID, KAccIntegratedAudioInput );
+                            if( iInformationNoteDefault )
+                                  {
+                                  noteValue = iInformationNoteDefault;
+                                  showNote = ETrue;
+                                  }
+                            if( !capValue && !iInformationNoteDefault )
+                                  {
+                                  showNote = ETrue;
+                                  }
+                            }
+                        else
+                            {
+                            if( iInformationNoteDefault )
+                                  {
+                                  noteValue = iInformationNoteDefault;
+                                  showNote = ETrue;
+                                  }
+                            }
+				      }
 				  }
 			    break;			  
 			    default:
--- a/accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -292,30 +292,36 @@
     HBufC8 *asyData = NULL;    
     CBufFlat* objectBuf = NULL;    
     
-    //
-    // Allocated the buffer which is really needed!
-    // 
-    if ( EProcessResponseTDes == aResponseType && 
-         ECmdGetSupportedBTProfiles != iOutstandingProcessCmdId )
-        {
-    	asyDataSize = aMessage.GetDesLengthL( KAccServParamPosSecond );
-        asyData = HBufC8::NewL( asyDataSize );
-        CleanupStack::PushL( asyData );        
-        }
-	else if ( EProcessResponseObject == aResponseType )
-		{
-        objectBuf = CBufFlat::NewL( KAccSrvObjectBaseStreamBufGranularity );
-	    CleanupStack::PushL( objectBuf );
-	    TInt bufLength( aMessage.GetDesLength( KAccServParamPosSecond ) );
-	    objectBuf->ResizeL( bufLength );	      
-		}
-	else
-	   {
-	   COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - Buffer is not needed!" );
-	   }
-		    		    
+        		    
     if ( !aTimeOut )
         {
+       	//
+	    	// Allocated the buffer which is really needed!
+    		//     
+  	  	if ( EProcessResponseTDes == aResponseType && 
+        	ECmdGetSupportedBTProfiles != iOutstandingProcessCmdId )
+	        {
+					COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - Before RMessage with EProcessResponse" );
+	    		asyDataSize = aMessage.GetDesLengthL( KAccServParamPosSecond );
+	        asyData = HBufC8::NewL( asyDataSize );
+	        CleanupStack::PushL( asyData );        
+					COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - After RMessage with EProcessResponse" );
+	        }		
+		  	else if ( EProcessResponseObject == aResponseType )
+					{
+					COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - Before RMessage with EProcessResponseObject" );
+					TInt bufLength = ( aMessage.GetDesLengthL( KAccServParamPosSecond ) );
+			    objectBuf = CBufFlat::NewL( KAccSrvObjectBaseStreamBufGranularity );
+				  CleanupStack::PushL( objectBuf );
+				  objectBuf->ResizeL( bufLength );
+					COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - After RMessage with EProcessResponseObject" );		
+					}
+				else
+				  {
+				  COM_TRACE_( "[AccFW:AccServer] CAccSrvSubAsyComms::ProcessResponseL() - Buffer is not needed!" );
+				  }
+			
+        	        	
         aMessage.ReadL( KAccServParamPosFirst, tridPckgBuf );
         if ( iOutstandingTrId != tridPckgBuf() )
             {
@@ -445,24 +451,42 @@
                     }
                 else
                     {
-                    TPtr8 asyDataPtr = asyData->Des();		
+                    TPtr8 asyDataPtr ( NULL, 0, 0 );                    
+                    if ( NULL != asyData )
+                    	{
+                    	asyDataPtr.Set ( asyData->Des() );
+                    	}
                     iConnectionController->NotificationQueue().CompleteValueMessageL(
                                                    messageId,
                                                    asyDataPtr,
                                                    errPckgBuf(),
-                                                   iOutstandingTrId );                    
-                    CleanupStack::PopAndDestroy( asyData );                               
+                                                   iOutstandingTrId );
+                    
+                    if ( NULL != asyData )
+                    	{                            
+                    	CleanupStack::PopAndDestroy( asyData );                               
+                    	}	
                     }
                 break;
             case EProcessResponseObject :
-                {
-                TPtr8 objectBufPtr( objectBuf->Ptr(0) );
-                iConnectionController->NotificationQueue().CompleteValueMessageL( 
-                                                   messageId,
-                                                   iOutstandingTrId,
-                                                   &objectBufPtr,
-                                                   errPckgBuf() );
-                CleanupStack::PopAndDestroy( objectBuf );
+                {                
+                TPtr8 objectBufPtr ( NULL, 0, 0 ); 
+                
+                if(	NULL != objectBuf )
+                	{
+                	objectBufPtr.Set ( objectBuf->Ptr(0) );
+                	}	      
+                	          
+	                iConnectionController->NotificationQueue().CompleteValueMessageL( 
+                                   messageId,
+                                   iOutstandingTrId,
+                                   &objectBufPtr,
+                                   errPckgBuf() );                	                	
+
+                if( NULL != objectBuf )
+                	{                                   
+                	CleanupStack::PopAndDestroy( objectBuf );
+                  }
                 }                                                   
             break;
                 
--- a/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -1266,7 +1266,7 @@
     // No need to calculate if the screen size is zero
     if( aBRCorner.iX > 0 && aBRCorner.iY > 0 )
         {
-        // hOverscanPixels = ( ( Width * hOverscan ) + 50 ) / 20000
+        // hOverscanPixels = ( ( Width * hOverscan ) + 50 ) / 10000
         //
         //  hOverscanPixels:
         //      pixels which are needed to be added to top left X
@@ -1277,14 +1277,14 @@
         //      Horizontal overscan in percents (1% == 100)
         //  50:
         //      Used to round up possible decimals
-        //  20000:
+        //  10000:
         //      Used to get rid of percentage multiplier and to get the overscan value
         //      for one side
-        TInt hOverscanPixels = ( aBRCorner.iX * iHOverscan + 50 ) / 20000;
+        TInt hOverscanPixels = ( aBRCorner.iX * iHOverscan + 50 ) / 10000;
         aTLCorner.iX = hOverscanPixels;
         aBRCorner.iX = ( aBRCorner.iX - hOverscanPixels );
         
-        // vOverscanPixels = ( ( Height * vOverscan ) + 50 ) / 20000
+        // vOverscanPixels = ( ( Height * vOverscan ) + 50 ) / 10000
         //
         //  vOverscanPixels:
         //      pixels which are needed to be added to top left Y
@@ -1295,10 +1295,10 @@
         //      Vertical overscan in percents (1% == 100)
         //  50:
         //      Used to round up possible decimals
-        //  20000:
+        //  10000:
         //      Used to get rid of percentage multiplier and to get the overscan value
         //      for one side
-        TInt vOverscanPixels = ( aBRCorner.iY * iVOverscan + 50 ) / 20000;
+        TInt vOverscanPixels = ( aBRCorner.iY * iVOverscan + 50 ) / 10000;
         aTLCorner.iY = vOverscanPixels;
         aBRCorner.iY = ( aBRCorner.iY - vOverscanPixels );
         }
--- a/psmservices/psmserver/src/client/psmclientimpl.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/psmservices/psmserver/src/client/psmclientimpl.cpp	Wed Apr 14 17:17:45 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"
@@ -64,22 +64,10 @@
     {
     COMPONENT_TRACE( ( _L( "PSM Client - CPsmClientImpl::~CPsmClientImpl()" ) ) );
 
-    if ( iActive->IsActive() )
-        {
-        CancelPowerSaveModeChange();
-        }
+    CancelPowerSaveModeChange();
 
-    if ( iActive )
-        {
-        delete iActive;
-        iActive = NULL;
-        }
-
-    if ( iSettings )
-        {
-        delete iSettings;
-        iSettings = NULL;
-        }
+    delete iActive;
+    delete iSettings;
 
     iPsmServer.Close();
 
--- a/sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_cmd.iby	Wed Mar 31 23:31:40 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_cmd.iby	Wed Apr 14 17:17:45 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"
@@ -55,7 +55,9 @@
 data=EPOCROOT##epoc32\data\Z\resource\ssmatest\cmdlists5\cmdlists5.rsc				resource\ssmatest\cmdlists5\cmdlists5.rsc
 data=EPOCROOT##epoc32\data\Z\resource\ssmatest\cmdlists6\cmdlists6.rsc				resource\ssmatest\cmdlists6\cmdlists6.rsc
 data=EPOCROOT##epoc32\data\Z\resource\ssmatest\bic\tcmd_cmdlist_swp_builtincmd.rsc          resource\ssmatest\bic\tcmd_cmdlist_swp_builtincmd.rsc
-
+data=EPOCROOT##epoc32\data\Z\resource\ssmatest\cmdlists7\cmdlists7a.rsc				resource\ssmatest\cmdlists7\cmdlists7a.rsc
+data=EPOCROOT##epoc32\data\Z\resource\ssmatest\cmdlists7\cmdlists7b.rsc				resource\ssmatest\cmdlists7\cmdlists7b.rsc
+data=EPOCROOT##epoc32\data\Z\resource\ssmatest\cmdlists7\cmdlists7c.rsc				resource\ssmatest\cmdlists7\cmdlists7c.rsc
 // policy files for reqswpchange
 data=ABI_DIR\BUILD_DIR\ssm.state.policy.createswp.dll		sys\bin\ssm.state.policy.createswp.dll
 data=ABI_DIR\BUILD_DIR\ssm.swp.policy.test.cmdreqswp.dll	sys\bin\ssm.swp.policy.test.cmdreqswp.dll
--- a/sysstatemgmt/systemstatemgr/test/tcmd/group/tcmd_server.mmp	Wed Mar 31 23:31:40 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/group/tcmd_server.mmp	Wed Apr 14 17:17:45 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"
@@ -257,5 +257,18 @@
 TARGETPATH	/resource/ssmatest/bic
 END
 
+SOURCEPATH		../resource
+START RESOURCE	cmdlists7a.rss
+TARGETPATH	/resource/ssmatest/cmdlists7
+END
 
+SOURCEPATH		../resource
+START RESOURCE	cmdlists7b.rss
+TARGETPATH	/resource/ssmatest/cmdlists7
+END
+
+SOURCEPATH		../resource
+START RESOURCE	cmdlists7c.rss
+TARGETPATH	/resource/ssmatest/cmdlists7
+END
 SMPSAFE
--- a/sysstatemgmt/systemstatemgr/test/tcmd/inc/tcmd_step_resourcereader.h	Wed Mar 31 23:31:40 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/inc/tcmd_step_resourcereader.h	Wed Apr 14 17:17:45 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"
@@ -159,6 +159,7 @@
 	void TestGet3L();
 	void ThreadGet3L();
 	void TestGet4L();
+	void TestGet5L();
 	void ConfTestL();
 	void TestGeneral1L();
 	void TestCommandType1L();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7a.rss	Wed Apr 14 17:17:45 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Provides no command
+// 
+//
+
+#include <ssm/ssmcmd.rh>
+#include "testcmdlistids.hrh"
+
+UID2 KUidSsmCommandListResourceFile
+
+// SSM_COMMAND_LIST_ROOT must be the first resource in a command list resource file.
+// The SSM relies on this having a resource ID of 1.
+RESOURCE SSM_COMMAND_LIST_ROOT
+	{
+	command_list_mapping = r_command_list_mapping;
+	}
+
+RESOURCE SSM_COMMAND_LIST_MAPPING r_command_list_mapping
+	{
+	mappings =
+		{
+		SSM_COMMANDLISTID_TO_RESOURCEID
+			{
+			command_list_id = ETestCommandListId1;
+			resource_id = r_command_list_1;
+			}
+		};
+	}
+
+RESOURCE SSM_COMMAND_LIST r_command_list_1
+   	{
+	commands =
+		{
+		};
+	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7b.rss	Wed Apr 14 17:17:45 2010 +0300
@@ -0,0 +1,66 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Provides commands with conditional info
+// 
+//
+
+#include <ssm/ssmcmd.rh>
+#include "testcmd.rh"
+#include "testcmdlistids.hrh"
+
+UID2 KUidSsmCommandListResourceFile
+
+// SSM_COMMAND_LIST_ROOT must be the first resource in a command list resource file.
+// The SSM relies on this having a resource ID of 1.
+RESOURCE SSM_COMMAND_LIST_ROOT
+	{
+	command_list_mapping = r_command_list_mapping;
+	}
+
+RESOURCE SSM_COMMAND_LIST_MAPPING r_command_list_mapping
+	{
+	mappings =
+		{
+		SSM_COMMANDLISTID_TO_RESOURCEID
+			{
+			command_list_id = ETestCommandListId1;
+			resource_id = r_command_list_1;
+			}
+		};
+	}
+
+
+RESOURCE SSM_COMMAND_LIST r_command_list_1
+   	{
+	commands =
+		{
+		r_command_state_include_no,
+		r_command_state_include_yes
+		};
+	}
+
+RESOURCE SSM_TEST_PUBLISH_SYSTEM_STATE r_command_state_include_no
+	{
+	}
+
+RESOURCE SSM_TEST_PUBLISH_SYSTEM_STATE r_command_state_include_yes
+	{
+	conditional_information = r_conditional_information_yes;
+	}
+
+RESOURCE SSM_SYMBIAN_CONDITIONAL_INFORMATION r_conditional_information_yes
+	{
+	software_reason = ESoftwareNormal;
+   	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/resource/cmdlists7c.rss	Wed Apr 14 17:17:45 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Provides no command
+// 
+//
+
+#include <ssm/ssmcmd.rh>
+#include "testcmdlistids.hrh"
+
+UID2 KUidSsmCommandListResourceFile
+
+// SSM_COMMAND_LIST_ROOT must be the first resource in a command list resource file.
+// The SSM relies on this having a resource ID of 1.
+RESOURCE SSM_COMMAND_LIST_ROOT
+	{
+	command_list_mapping = r_command_list_mapping;
+	}
+
+RESOURCE SSM_COMMAND_LIST_MAPPING r_command_list_mapping
+	{
+	mappings =
+		{
+		SSM_COMMANDLISTID_TO_RESOURCEID
+			{
+			command_list_id = ETestCommandListId1;
+			resource_id = r_command_list_1;
+			}
+		};
+	}
+
+RESOURCE SSM_COMMAND_LIST r_command_list_1
+   	{
+	commands =
+		{
+		};
+	}
\ No newline at end of file
--- a/sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp	Wed Apr 14 17:17:45 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"
@@ -452,6 +452,11 @@
 	__UHEAP_MARKEND;
 
 	__UHEAP_MARK;
+	TRAP(err, TestGet5L());
+	TEST(err == KErrNone);
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
 	TRAP(err, TestGeneral1L());
 	TEST(err == KErrNone);
 	__UHEAP_MARKEND;
@@ -2020,3 +2025,39 @@
 	CleanupStack::PushL(cmd);
 	return NULL;
 	}
+
+/*
+It tests for the scenario where first file have no commands(i.e. cmdlists7a) and second file cmdlists7b have two commands and
+third file have no commands(i.e cmdlists7c)
+
+CommandList should be created and iCommandConstructCount should be two.
+*/
+void CResourceReaderTest::TestGet5L()
+	{
+	INFO_PRINTF1(_L("*** Starting TestGet5L"));
+	_LIT(KCommandListPath, "z:\\resource\\ssmatest\\cmdlists7\\");
+	CSsmCommandListResourceReaderImpl* reader = CSsmCommandListResourceReaderImpl::NewL(iFs, KCommandListPath, *this);
+
+	// init
+	TRequestStatus status;
+	reader->Initialise(status);
+	TEST(status == KRequestPending);
+	Run();
+	User::WaitForRequest(status); // mop up the completed initialisation request
+	TEST(status == KErrNone);
+
+	// prepare
+	TSsmState state(0,23);
+	reader->PrepareCommandList(*this, ETestCommandListId1, state, status);
+	iWhichPrepare = EConditional;
+	iCommandConstructCount = 0;
+	Run();
+	User::WaitForRequest(status);
+		
+	TBool commandListReady =  reader->IsCommandListReady();
+	
+	TEST((status == KErrNone) && (commandListReady == TRUE) && (iCommandConstructCount == 2));
+		
+	iWhichPrepare = EPrepareNoCheck;
+	delete reader;
+	}
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp	Wed Mar 31 23:31:40 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp	Wed Apr 14 17:17:45 2010 +0300
@@ -202,8 +202,15 @@
 	TBool isDlgCancellable;
 
 	//Is system in start up state
-	
-	iAfterStartup = (currentState.MainState() == ESsmStartup) ? EFalse : ETrue;
+	if ( currentState.MainState() == ESsmStartup )
+		{
+		//TSsmStartupSubStateExt::ESsmStateNonCritical
+		iAfterStartup = ( 0x34 == currentState.SubState() ) ? ETrue : EFalse;
+		}
+	else
+		{
+		iAfterStartup = ETrue;
+		}
 	
 	//Close the state aware session
 	ssmStateAwareSession.Close();