Revision: 201018
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 13:42:22 +0300
changeset 16 ef634fd8dac3
parent 13 cef4ff1e6c4f
child 17 c3ddd27f139f
child 22 effbe8362efc
Revision: 201018 Kit: 201018
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/AccSrvSettingsHandler.cpp
accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp
accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp
accessoryservices/remotecontrolfw/client/coreapi/public/remconcoreapicontrollerobserver.h
psmservices/psmserver/src/client/psmclientimpl.cpp
resourcemgmt/hwrmfmtxwatcherplugin/src/hwrmfmtxusbobserver.cpp
sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss
sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss
sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss
sysstatemgmt/ssmcmdlists/data/uiservicescmdlist_ext.rss
sysstatemgmt/ssmcustcmds/ssmsystemcmds/src/ssminitpskeys.cpp
sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/group/ssmshutdownpolicy.mmp
sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/src/ssmshutdownpolicy.cpp
sysstatemgmt/systemstatemgr/ssm/group/ssmserver.mmp
sysstatemgmt/systemstatemgr/ssm/inc/ssmserver.h
sysstatemgmt/systemstatemgr/ssm/src/ssmserver.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/systemstatemgr/test/tssm/group/tssm_server.mmp
sysstatemgmt/systemstatereferenceplugins/clayer/inc/startupdomainpskeys.h
sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecurityeventobserver.cpp
sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllswitchu.def
sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllu.def
sysstatemgmt/systemstatereferenceplugins/custcmd/eabi/ssmuiproviderdllu.def
sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp
sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h
sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdllswitch_stubs.h
sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp
sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp
sysstatemgmt/sysuiprovider/inc/ssmuispecific.h
sysstatemgmt/sysuiprovider/src/ssmuispecific.cpp
--- a/accessoryservices/accessoryserver/BWINS/AccPolComU.DEF	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/BWINS/AccPolComU.DEF	Mon May 03 13:42:22 2010 +0300
@@ -61,4 +61,5 @@
 	?CompareCriticalValuesL@CCapabilityStorage@@QAEHABVTAccPolGenericID@@@Z @ 60 NONAME ; int CCapabilityStorage::CompareCriticalValuesL(class TAccPolGenericID const &)
 	?GetGenericID@CCapabilityStorage@@QAEHAAVTAccPolGenericID@@@Z @ 61 NONAME ; int CCapabilityStorage::GetGenericID(class TAccPolGenericID &)
 	?IsCapabilityDefinedL@CAccPolAccessoryPolicy@@QAEHABVTAccPolGenericID@@ABK@Z @ 62 NONAME ; int CAccPolAccessoryPolicy::IsCapabilityDefinedL(class TAccPolGenericID const &, unsigned long const &)
+	?RemoveIndexFromGenericIDArray@TAccPolGenericIDArrayAccessor@@SAXAAVTAccPolGenericIDArray@@H@Z @ 63 NONAME ; void TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray(class TAccPolGenericIDArray &, int)
 
--- a/accessoryservices/accessoryserver/EABI/AccPolComU.DEF	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/EABI/AccPolComU.DEF	Mon May 03 13:42:22 2010 +0300
@@ -73,4 +73,5 @@
 	_ZN22CAccPolAccessoryPolicyD0Ev @ 72 NONAME
 	_ZN22CAccPolAccessoryPolicyD1Ev @ 73 NONAME
 	_ZN22CAccPolAccessoryPolicyD2Ev @ 74 NONAME
+	_ZN29TAccPolGenericIDArrayAccessor29RemoveIndexFromGenericIDArrayER21TAccPolGenericIDArrayi @ 75 NONAME
 
--- a/accessoryservices/accessoryserver/inc/Common/AccPolGenericIDArrayAccessor.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/inc/Common/AccPolGenericIDArrayAccessor.h	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Policy/AccPolAccessoryPolicy.cpp	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Policy/AccPolGenericIDArrayAccessor.cpp	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp	Mon May 03 13:42:22 2010 +0300
@@ -851,6 +851,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, 
@@ -890,27 +897,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/AccSrvSettingsHandler.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvSettingsHandler.cpp	Mon May 03 13:42:22 2010 +0300
@@ -258,17 +258,18 @@
 
     TPtr8 ptrBuf( buf->Des() );
     User::LeaveIfError( session.Connect() );
+	CleanupClosePushL ( session );
     User::LeaveIfError( file.Open( session, KHWDevicesFile, EFileRead ) );
     file.Read( ptrBuf );
     file.Close();
-    session.Close();
 
     TLex8 l( ptrBuf );
     TInt32 temp;
     l.Val( temp );
     settings = static_cast< TUint32 >( temp );
 
-    CleanupStack::Pop( buf );
+    CleanupStack::PopAndDestroy ( &session );
+    CleanupStack::PopAndDestroy ( buf );
 
     COM_TRACE_1( "[AccFW:AccServer] CAccSrvSettingsHandler::GetSupportedHWDevicesL() - return %d", settings );
 
--- a/accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/accessoryserver/src/Server/AccSrvSubAsyComms.cpp	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/pluggeddisplay/pluggeddisplayengine/src/edidhandler.cpp	Mon May 03 13:42:22 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/accessoryservices/remotecontrolfw/client/coreapi/public/remconcoreapicontrollerobserver.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/accessoryservices/remotecontrolfw/client/coreapi/public/remconcoreapicontrollerobserver.h	Mon May 03 13:42:22 2010 +0300
@@ -41,7 +41,7 @@
 	command of this type.
 	@param The response error.
 	*/
-	virtual void MrccacoResponse(TRemConCoreApiOperationId aOperationId, TInt aError);
+	IMPORT_C virtual void MrccacoResponse(TRemConCoreApiOperationId aOperationId, TInt aError);
 	};
 
 #endif // REMCONCOREAPICONTROLLEROBSERVER_H
--- a/psmservices/psmserver/src/client/psmclientimpl.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/psmservices/psmserver/src/client/psmclientimpl.cpp	Mon May 03 13:42:22 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/resourcemgmt/hwrmfmtxwatcherplugin/src/hwrmfmtxusbobserver.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/resourcemgmt/hwrmfmtxwatcherplugin/src/hwrmfmtxusbobserver.cpp	Mon May 03 13:42:22 2010 +0300
@@ -33,7 +33,7 @@
     INFO_LOG1( "UsbConnected - %d",  aDeviceState);
 
     if ( aDeviceState == EUsbDeviceStateAttached || aDeviceState == EUsbDeviceStatePowered ||
-    		aDeviceState == EUsbDeviceStateUndefined)
+    		aDeviceState == EUsbDeviceStateUndefined || aDeviceState == EUsbDeviceStateSuspended )
     	{
     	RDebug::Print(_L("return false "));
     	return EFalse;
--- a/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/noncriticalcmdlist_ext.rss	Mon May 03 13:42:22 2010 +0300
@@ -75,7 +75,6 @@
         r_cmd_watcher,
         r_cmd_dmutilsrv,
         // prio 0xFFA7
-        r_cmd_contentharvester,
         r_cmd_mdswatchdog,
         r_cmd_satsrv,
         r_cmd_cbssrv,
@@ -90,7 +89,6 @@
 #ifdef FF_LBT_ENGINE
         r_cmd_lbtsrv,
 #endif // FF_LBT_ENGINE
-        r_cmd_taskswitcher,
         //prio 0xFFA6
         r_cmd_dmfirstbootreason,
         r_cmd_fota,
@@ -141,6 +139,18 @@
         //prio 0x7EE5
         r_cmd_aab
 #endif
+#ifdef FF_SEARCH_SW
+       //prio 0x7EE4
+       ,r_cmd_activitymonitor13,
+       //prio 0x7EE3
+       r_cmd_searchsw 		//SLAR-832C9T
+#endif //FF_SEARCH_SW
+#ifdef FF_EMAIL_FRAMEWORK
+		//prio 0x7EE2
+       ,r_cmd_activitymonitor14,
+       //prio 0x7EE1
+       r_cmd_nmailagent 	//MBEN-83CFQE
+#endif //FF_EMAIL_FRAMEWORK
         };
     }
 
@@ -345,7 +355,40 @@
     dll_data = r_dlldata_activitymonitor_timeout;
     }
 #endif
-	
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor13
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_SEARCH_SW
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor13
+    {
+    priority = 0x7EE4;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+#endif //FF_SEARCH_SW
+
+// ---------------------------------------------------------------------------
+// r_cmd_activitymonitor14
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_EMAIL_FRAMEWORK
+RESOURCE SSM_START_CUSTOM_COMMAND r_cmd_activitymonitor14
+    {
+    priority = 0x7EE2;
+    severity = ECmdCriticalSeverity;
+    execution_behaviour = ESsmWaitForSignal;
+    dllname = "ssmactivitycmd.dll";
+    ordinal = 1; // SsmActivityCmdNewL
+    retries = 2;
+    dll_data = r_dlldata_activitymonitor_timeout;
+    }
+#endif //FF_EMAIL_FRAMEWORK
 // ---------------------------------------------------------------------------
 // r_cmd_amastart
 // ---------------------------------------------------------------------------
@@ -416,21 +459,8 @@
     {
     priority = 0x7EE9;
     name = "csserver.exe";
-    execution_behaviour = ESsmFireAndForget;
+    execution_behaviour = ESsmWaitForSignal;
     }
-    
-// ---------------------------------------------------------------------------
-// r_cmd_contentharvester
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_PROCESS_INFO r_cmd_contentharvester
-    {
-    priority = 0xFFA7;
-    name = "z:\\sys\\bin\\contentharvester.exe";
-    execution_behaviour = ESsmFireAndForget;	//behavior changed from ESsmWaitForSignal as part of SCB CR MSOI-7XARNT
-    monitor_info = r_mon_3_restarts_ignore;
-    }
-
 // ---------------------------------------------------------------------------
 // r_cmd_dcmo
 // ---------------------------------------------------------------------------
@@ -566,7 +596,7 @@
 // r_cmd_msgnotifier
 // ---------------------------------------------------------------------------
 //
-RESOURCE SSM_START_PROCESS_INFO r_cmd_msgnotifier
+RESOURCE SSM_START_APP_INFO r_cmd_msgnotifier
     {
     priority = 0x7EE7;
     name = "msgnotifier.exe";
@@ -625,6 +655,52 @@
     execution_behaviour = ESsmWaitForSignal;
     timeout = 10000;
     }
+	
+//---------------------------------------------------------------------------
+// r_cmd_searchsw
+// ---------------------------------------------------------------------------
+//
+#ifdef	FF_SEARCH_SW
+RESOURCE SSM_START_PROCESS_INFO r_cmd_searchsw
+	{
+	priority = 0x7EE3;
+	name = "z:\\sys\\bin\\cpixwatchdog.exe";
+	execution_behaviour = ESsmFireAndForget;
+	conditional_information = r_cond_feat_searchsw;
+	}
+
+// ---------------------------------------------------------------------------
+// r_cond_feat_searchsw
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_searchsw
+    {
+    feature_id = KFeatureIdFfSearchSw;
+    }
+#endif //FF_SEARCH_SW
+
+// ---------------------------------------------------------------------------
+// r_cmd_nmailagent
+// ---------------------------------------------------------------------------
+//
+#ifdef FF_EMAIL_FRAMEWORK
+RESOURCE SSM_START_PROCESS_INFO r_cmd_nmailagent
+    {
+    priority = 0x7EE1;
+    name = "z:\\sys\\bin\\nmailagent.exe";
+    execution_behaviour = ESsmFireAndForget;
+    conditional_information = r_cond_feat_emailfw;
+    }
+    
+// ---------------------------------------------------------------------------
+// r_cond_feat_emailfw
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_CND_FEATURE_VALUE r_cond_feat_emailfw
+    {
+    feature_id = KFeatureIdFfEmailFramework;
+    }
+#endif //FF_EMAIL_FRAMEWORK
 
 // ---------------------------------------------------------------------------
 // r_cmd_supllistener
@@ -641,18 +717,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// r_cmd_taskswitcher
-// ---------------------------------------------------------------------------  
-RESOURCE SSM_START_APP_INFO r_cmd_taskswitcher
-     {
-     priority = 0xFFA7;
-     name = "z:\\sys\\bin\\tsapplication.exe";
-     execution_behaviour = ESsmDeferredWaitForSignal;
-     background = 1; // To background
-     monitor_info = r_mon_3_restarts_ignore;
-     }
-
-// ---------------------------------------------------------------------------
 // r_cmd_multiple_wait
 // ---------------------------------------------------------------------------
 //
--- a/sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/securitycheckcmdlist.rss	Mon May 03 13:42:22 2010 +0300
@@ -138,7 +138,7 @@
     priority = 0xFFDF;
     name = "z:\\sys\\bin\\hsapplication.exe";
     execution_behaviour = ESsmDeferredWaitForSignal;
-    
+    monitor_info = r_mon_max_restarts_ignore;
     }
 
 // ---------------------------------------------------------------------------
--- a/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist.rss	Mon May 03 13:42:22 2010 +0300
@@ -78,8 +78,6 @@
         // prio 0xFFC7
         r_cmd_initclkeys,
         r_cmd_initramdrive,
-        // prio 0xFFA7
-        r_cmd_splash,
         r_cmd_rtc,              // prio 0xFF97
         // prio 0xFF96 -  rtc (tzsrv, mediator & hwrmsrv have been moved to extended startuplist but uses the same multiplewait command )
         r_cmd_multiwaitforever1,
@@ -366,16 +364,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// r_cmd_splash
-// ---------------------------------------------------------------------------
-//
-RESOURCE SSM_START_PROCESS_INFO r_cmd_splash
-    {
-    priority = 0xFFA7;
-    name = "Z:\\sys\\bin\\splashscreen.exe";
-    }
-
-// ---------------------------------------------------------------------------
 // r_cmd_startupmode
 // ---------------------------------------------------------------------------
 //
--- a/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist_ext.rss	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmcmdlists/data/uiservicescmdlist_ext.rss	Mon May 03 13:42:22 2010 +0300
@@ -65,6 +65,8 @@
     {
     commands =
         {
+		//prio 0xFFA7
+		r_cmd_splash,
         // prio 0xFF99
         r_cmd_tzsrv,
         r_cmd_mediator,
@@ -117,6 +119,15 @@
     conditional_information = r_cond_feat_mediator;
     }
 
+// ---------------------------------------------------------------------------
+// r_cmd_splash
+// ---------------------------------------------------------------------------
+//
+RESOURCE SSM_START_PROCESS_INFO r_cmd_splash
+    {
+    priority = 0xFFA7;
+    name = "Z:\\sys\\bin\\splashscreen.exe";
+    }
 
 // ---------------------------------------------------------------------------
 // r_cmd_tzsrv
--- a/sysstatemgmt/ssmcustcmds/ssmsystemcmds/src/ssminitpskeys.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmcustcmds/ssmsystemcmds/src/ssminitpskeys.cpp	Mon May 03 13:42:22 2010 +0300
@@ -299,7 +299,15 @@
              KWriteDeviceDataPolicy );
     SetL( KPSStarterUid, KSSMUILanguagePSKey , 0 );
 
-
+    INFO( "KPSUidStartup::KIgnoreSecurityEvent" );
+    DefineL( KPSUidStartup,
+             KIgnoreSecurityEvent,
+             KReadDeviceDataPolicy,
+             KWriteDeviceDataPolicy );
+    SetL( KPSUidStartup,
+          KIgnoreSecurityEvent,
+          EPSIgnoreSecurityEventUninitialized );
+    
 // Store FirstBoot Value from cenrep
 TInt csVal( 0 );
 TInt psVal( 0 );
--- a/sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/group/ssmshutdownpolicy.mmp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/group/ssmshutdownpolicy.mmp	Mon May 03 13:42:22 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"
@@ -45,6 +45,7 @@
 LIBRARY         ssmpolicybase.lib
 LIBRARY         ssmstatepolicybase.lib
 LIBRARY         ssmmapperutility.lib
+LIBRARY         ssmuiproviderdll.lib
 
 // >>> uncomment to enable function-level tracing
 // MACRO        __SSM_FUNC_TRACE__
--- a/sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/src/ssmshutdownpolicy.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/src/ssmshutdownpolicy.cpp	Mon May 03 13:42:22 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"
@@ -21,6 +21,7 @@
 #include <ssm/ssmstatetransition.h>
 #include <ssm/starterclient.h>
 #include <ssm/starterdomaincrkeys.h>
+#include <ssm/ssmuiproviderdll.h>
 
 #include "ssmsubstateext.hrh"
 #include "ssmmapperutility.h"
@@ -215,6 +216,22 @@
         CRepository::NewLC( iUtil->CrUid( KCRUidStartup ) );
     TInt errorCode = repository->Set( KStartupReason, aReasonCode );
     ERROR( errorCode, "Failed to set KStartupReason CenRep key" );
+
+	if( KErrDiskFull == errorCode )
+		{
+		//Need not to put on CleanupStack, it's not calling any leaving function and
+		//it's handled by reference count
+		CSsmUiSpecific* ssmUiSpecific = CSsmUiSpecific::InstanceL();
+		//Free complete reserve space
+		errorCode = ssmUiSpecific->FreeReservedPhoneMemorySpace( 0 );
+		if( KErrNone == errorCode )
+			{
+			errorCode = repository->Set( KStartupReason, aReasonCode );
+			ERROR( errorCode, "Failed to set KStartupReason CenRep key after freeing the memory" );
+			}
+		CSsmUiSpecific::Release();
+		}
+    
     CleanupStack::PopAndDestroy( repository );
     User::LeaveIfError( errorCode );
     }
--- a/sysstatemgmt/systemstatemgr/ssm/group/ssmserver.mmp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/ssm/group/ssmserver.mmp	Mon May 03 13:42:22 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -59,6 +59,7 @@
 LIBRARY			estor.lib		//used by ssmclecli.lib
 LIBRARY			ssmcmd.lib 		//used by ssmclecli.lib
 LIBRARY			ssmcmn.lib
+LIBRARY			ssmuiproviderdll.lib
 
 STATICLIBRARY	ssmclecli.lib
 STATICLIBRARY	ssmclesrv.lib	//used by ssmclecli.lib
--- a/sysstatemgmt/systemstatemgr/ssm/inc/ssmserver.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/ssm/inc/ssmserver.h	Mon May 03 13:42:22 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"
@@ -25,6 +25,7 @@
 class CSsmSwpRequestHandler;
 class CSsmSwpPolicyResolver;
 class CCleSessionProxy;
+class CSsmUiSpecific;
 
 /**
  Implements the API used to request changes to the
@@ -78,6 +79,7 @@
 	CSsmSwpRequestHandler* iSwpRequestHandler;
 	CSsmSwpPolicyResolver* iSwpResolver;
 	CCleSessionProxy* iSwpCleSession;
+	CSsmUiSpecific* iSsmUiSpecific;
 	};
 
 #endif
--- a/sysstatemgmt/systemstatemgr/ssm/src/ssmserver.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/ssm/src/ssmserver.cpp	Mon May 03 13:42:22 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,6 +16,7 @@
 #include <ssm/ssmstates.hrh>
 #include <ssm/ssmstatetransition.h>
 #include <ssm/ssmstatepolicy.h>
+#include <ssm/ssmuiproviderdll.h>
 
 #include "ssmserverpanic.h"
 #include "ssmserver.h"
@@ -29,6 +30,7 @@
 #include "ssmstatepolicyframe.h"
 #include "ssmswppolicyresolver.h"
 #include "ssmswprequesthandler.h"
+#include "ssmdebug.h"
 
 // ------------------- Policy Server Security Setup ----------------------
 
@@ -86,7 +88,11 @@
 		{
 		iSwpCleSession->ReleaseCle();
 		}
-
+	
+	if(iSsmUiSpecific)
+        {
+        iSsmUiSpecific->Release();
+        }
 	} //lint !e529 not subsequently referenced
 
 /**
@@ -134,6 +140,10 @@
 	__ASSERT_ALWAYS( KErrNone == User::SetCritical(User::ESystemCritical), PanicNow(KPanicSysStateMgr,ESsmServerError1));
 	__ASSERT_ALWAYS( KErrNone == User::RenameThread(KSsmServerName), PanicNow(KPanicSysStateMgr,ESsmServerError2));
 
+	iSsmUiSpecific = CSsmUiSpecific::InstanceL();
+	//Reserve memory for critical operation especially when phone memory will be full
+    TInt err = iSsmUiSpecific->ReservePhoneMemorySpace();
+	DEBUGPRINT2(_L("CSsmUiSpecific::ReservePhoneMemorySpace returned with = %d"), err);
 	// --- Instantiate the "System State" handling classes ---
 	// Create a state policy resolver and load the initial policy
 	CSsmStatePolicyResolver* stateResolver = CSsmStatePolicyResolver::NewLC();
--- a/sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_cmd.iby	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/group/ssmatest_cmd.iby	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/group/tcmd_server.mmp	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/inc/tcmd_step_resourcereader.h	Mon May 03 13:42:22 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	Mon May 03 13:42:22 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	Mon May 03 13:42:22 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	Mon May 03 13:42:22 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	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tcmd/src/tcmd_step_resourcereader.cpp	Mon May 03 13:42:22 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/systemstatemgr/test/tssm/group/tssm_server.mmp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tssm/group/tssm_server.mmp	Mon May 03 13:42:22 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"
@@ -138,6 +138,7 @@
 LIBRARY			featmgr.lib
 LIBRARY			centralrepository.lib 
 LIBRARY			conditionevaluator.lib
+LIBRARY			ssmuiproviderdll.lib
 
 STATICLIBRARY	ssmclecli.lib
 STATICLIBRARY	ssmclesrv.lib	//used by ssmclecli.lib
--- a/sysstatemgmt/systemstatereferenceplugins/clayer/inc/startupdomainpskeys.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/clayer/inc/startupdomainpskeys.h	Mon May 03 13:42:22 2010 +0300
@@ -34,6 +34,21 @@
 
 static const TUid KPSUidStartup = { 0x101F8766 };
 
+
+// =============================================================================
+// SIM Utils API
+// =============================================================================
+
+// Use TUid KPSUidStartup = { 0x101F8766 };
+
+/**
+* Note: Refer simutils.h for actual definitions.
+*/
+//const TUint32 KPSSimStatus = 0x00000031;
+//const TUint32 KPSSimOwned = 0x00000032;
+//const TUint32 KPSSimChanged = 0x00000033;
+
+
 // =============================================================================
 // System State API
 // =============================================================================
@@ -259,6 +274,22 @@
     };
 
 // =============================================================================
+// Security Event SUP
+// =============================================================================
+/**
+* To be used by security event SUP to decide whether an event to be ignored or not
+*/
+
+// Use TUid KPSUidStartup = { 0x101F8766 };
+const TUint32 KIgnoreSecurityEvent = 0x00000302;
+enum TPSIgnoreSecurityEvent
+    {
+    EPSIgnoreSecurityEventUninitialized = KStartupEnumerationFirstValue,
+    EPSIgnoreSecurityEventEPin1Required,
+    EPSIgnoreSecurityEventEPhonePasswordRequired
+    };
+
+// =============================================================================
 // Wakeup Alarm API
 // =============================================================================
 
--- a/sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecurityeventobserver.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/clayer/src/ssmsecurityeventobserver.cpp	Mon May 03 13:42:22 2010 +0300
@@ -15,7 +15,7 @@
 //
 
 
-
+#include <ssm/startupdomainpskeys.h>
 #include "strtsecphaseobserver.h"
 #include "ssmsecurityeventobserver.h"
 #include "ssmsecuritynotecontroller.h"
@@ -126,8 +126,24 @@
     switch (iEvent)
         {
         case RMobilePhone::EPin1Required:
-            SimCodeRequest(ESecCodePIN1);
+            {
+            TInt pSIgnorePin1RequiredEvent( EPSIgnoreSecurityEventUninitialized );
+
+            //Get the KIgnoreSecurityEvent PS value
+            TInt err = RProperty::Get( KPSUidStartup, KIgnoreSecurityEvent, pSIgnorePin1RequiredEvent );
+			DEBUGPRINT2A("Getting KIgnoreSecurityEvent completed with %d ", err);
+            //Ignore the event only when KIgnoreSecurityEvent value is EPSIgnoreSecurityEventEPin1Required 
+            if( KErrNone == err && EPSIgnoreSecurityEventEPin1Required == pSIgnorePin1RequiredEvent )
+                {
+                err = RProperty::Set( KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventUninitialized );
+                DEBUGPRINT2A("Setting KIgnoreSecurityEvent completed with %d ", err);
+				}
+            else
+                {
+                SimCodeRequest(ESecCodePIN1);
+                }
             break;
+            }
         case RMobilePhone::EPuk1Required:
             SimCodeRequest(ESecCodePUK1);
             break;
@@ -138,8 +154,24 @@
             SimCodeRequest(ESecCodePUK2);
             break;
         case RMobilePhone::EPhonePasswordRequired:
-            SecCodeRequest(ESecCodePasswd);
+            {
+            TInt pSIgnorePhonePasswordRequiredEvent( EPSIgnoreSecurityEventUninitialized );
+
+            //Get the KCancelSecurityNotifier PS value
+            TInt err = RProperty::Get( KPSUidStartup, KIgnoreSecurityEvent, pSIgnorePhonePasswordRequiredEvent );
+			DEBUGPRINT2A("Getting KIgnoreSecurityEvent completed with %d ", err);
+            //Ignore the event only when KIgnoreSecurityEvent value is EPSIgnoreSecurityEventEPhonePasswordRequired 
+            if( KErrNone == err && EPSIgnoreSecurityEventEPhonePasswordRequired == pSIgnorePhonePasswordRequiredEvent )
+                {
+                err = RProperty::Set( KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventUninitialized );
+				DEBUGPRINT2A("Setting KIgnoreSecurityEvent completed with %d ", err);
+				}
+            else
+                {
+                SecCodeRequest(ESecCodePasswd);
+                }
             break;
+            }
         case RMobilePhone::EPin1Verified:
             CodeVerifyIndication(ESecCodePIN1);
             break;
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllswitchu.def	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllswitchu.def	Mon May 03 13:42:22 2010 +0300
@@ -26,3 +26,5 @@
 	call_vector_25 @ 25  NONAME
 	call_vector_26 @ 26  NONAME
 	call_vector_27 @ 27  NONAME
+	call_vector_28 @ 28  NONAME
+	call_vector_29 @ 29  NONAME
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllu.def	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/bwins/ssmuiproviderdllu.def	Mon May 03 13:42:22 2010 +0300
@@ -26,3 +26,5 @@
 	?ValidateRTCPropertyKey@CSsmUiSpecific@@SAIXZ @ 25  NONAME ; unsigned int CSsmUiSpecific::ValidateRTCPropertyKey(void)
 	?ValidateRTCPropertyCategory@CSsmUiSpecific@@SA?AVTUid@@XZ @ 26  NONAME ; class TUid CSsmUiSpecific::ValidateRTCPropertyCategory(void)
 	?PhoneMemoryRootDriveId@CSsmUiSpecific@@SAHXZ @ 27  NONAME ; int CSsmUiSpecific::PhoneMemoryRootDriveId(void)
+	?ReservePhoneMemorySpace@CSsmUiSpecific@@QAEHXZ @ 28  NONAME ; int CSsmUiSpecific::ReservePhoneMemorySpace(void)
+	?FreeReservedPhoneMemorySpace@CSsmUiSpecific@@QAEHH@Z @ 29  NONAME ; int CSsmUiSpecific::FreeReservedPhoneMemorySpace(int)
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/eabi/ssmuiproviderdllu.def	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/eabi/ssmuiproviderdllu.def	Mon May 03 13:42:22 2010 +0300
@@ -28,3 +28,5 @@
 	_ZN14CSsmUiSpecific22ValidateRTCPropertyKeyEv @ 27 NONAME
 	_ZN14CSsmUiSpecific27ValidateRTCPropertyCategoryEv @ 28 NONAME
 	_ZN14CSsmUiSpecific22PhoneMemoryRootDriveIdEv @ 29 NONAME
+	_ZN14CSsmUiSpecific23ReservePhoneMemorySpaceEv @ 30 NONAME
+	_ZN14CSsmUiSpecific28FreeReservedPhoneMemorySpaceEi @ 31 NONAME
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/group/ssmuiproviderdlldefault.mmp	Mon May 03 13:42:22 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"
@@ -44,5 +44,6 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib
+LIBRARY			efsrv.lib
 
 SMPSAFE
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdll.h	Mon May 03 13:42:22 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"
@@ -25,6 +25,7 @@
 #include <e32def.h>
 #include <e32cmn.h>
 #include <e32base.h>
+#include <f32file.h>
 
 class CSsmUiSpecific : public CBase
     {
@@ -56,12 +57,17 @@
 	IMPORT_C static TUint ValidateRTCPropertyKey();
 	IMPORT_C static TUid ValidateRTCPropertyCategory();
 	IMPORT_C static TInt PhoneMemoryRootDriveId();
+	IMPORT_C TInt ReservePhoneMemorySpace();
+	IMPORT_C TInt FreeReservedPhoneMemorySpace(const TInt aSpaceToFree);
 
 private:
 	CSsmUiSpecific();
+	void ConstructL();
 private:
 	TStrtSecurityStatus iStrtSecurityStatus;
 	TInt iReferenceCount;
+	RFs iReservedPhoneMemoryFs;
+	TInt iReservedPhoneMemory;
     };
 
 #endif // __SSMUIPROVIDERDLL_H__
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdllswitch_stubs.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/inc/ssmuiproviderdllswitch_stubs.h	Mon May 03 13:42:22 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"
@@ -266,7 +266,25 @@
     _asm mov eax, 27
     _asm jmp common_dispatch
     }
+
+__declspec(dllexport)
+__declspec(naked)
+void call_vector_28 ()
+    {
+    //TInt ReservePhoneMemorySpace()
+    _asm mov eax, 28
+    _asm jmp common_dispatch
+    }
+
+__declspec(dllexport)
+__declspec(naked)
+void call_vector_29 ()
+    {
+    //TInt FreeReservedPhoneMemorySpace(const TInt aSpaceToFree)
+    _asm mov eax, 29
+    _asm jmp common_dispatch
+    }
 }
 
-#define MAX_ORDINAL 27
+#define MAX_ORDINAL 29
 
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmsecuritychecknotifier.cpp	Mon May 03 13:42:22 2010 +0300
@@ -29,7 +29,8 @@
 #include <ssm/ssmstateawaresession.h>
 #include <e32def.h>
 #include <startupdomaindefs.h>
-#include <etelmm.h> 
+#include <etelmm.h>
+#include <ctsydomainpskeys.h>
 
 static TBool NoteTypeToEvent(
     TInt& aEventCode, const TStrtSecurityNoteType aNoteType )
@@ -202,8 +203,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();
@@ -235,10 +243,26 @@
         }
     else if (iCmdState == EEmergencyCallIsActive && iStatus.Int() != KErrCancel)
         {
-        // Emergency call activated from the security note dialog has
-        // finished. Show the note again.
-        DEBUGPRINT1A("ECall Ended and restarting pin notifier");
-        StartNotifier();
+        TInt value = -1; 
+		const TInt errorcode = iSsmEmergencyCallProperty.Get( value );
+		DEBUGPRINT3A("iSsmEmergencyCallProperty.Get() has returned value %d and errorcode %d", value , errorcode);
+		if (KErrNone == errorcode)
+			{
+			// Compare the property value with EPSCTsyCallStateNone. This indicates the call has finished.
+			if (EPSCTsyCallStateNone == value)
+				{
+				// Emergency call activated from the security note dialog has
+				// finished. Show the note again.
+				DEBUGPRINT1A("ECall Ended and restarting pin notifier");
+				StartNotifier();
+				}
+			else
+				{
+				//Subscribe to the property again if the property key value is not yet set to EPSCTsyCallStateNone.
+				iSsmEmergencyCallProperty.Subscribe(iStatus);
+				SetActive();
+				}
+			}
         }
     else
         {
--- a/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/custcmd/src/ssmuiproviderdlldefault.cpp	Mon May 03 13:42:22 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -21,7 +21,7 @@
 #include "ssmuiproviderdll.h"
 #include "ssmpanic.h"
 #include <e32property.h>
-#include <f32file.h>
+#include "ssmdebug.h"
 
 const TUid KPSStartupUid = {0x2000E65E};
 const TUid KSecurityPinNotifierUid = {0x2000E667};
@@ -37,17 +37,20 @@
 const TUint KRFStatusPropertyKey = 0x2001D2A9;
 const TUid KValidateRTCPropertyCategory = {0x2000D75B};
 const TUint KValidateRTCPropertyKey = 0x2001D2AB;
+//Number of clusterSize to be reserve for phone memory space 
+const TInt KNumberOfCluster = 2;
 
 _LIT(KTsyModuleName, "mm.tsy");
 _LIT(KTsyPhoneName, "GsmPhone1");
 
 CSsmUiSpecific::CSsmUiSpecific()
-: iReferenceCount(1)
+: iReferenceCount(1), iReservedPhoneMemory(0)
 	{
 	}
 
 EXPORT_C CSsmUiSpecific::~CSsmUiSpecific()
 	{
+	iReservedPhoneMemoryFs.Close();
 	}
 
 EXPORT_C TUid CSsmUiSpecific::StartupPSUid()
@@ -95,7 +98,7 @@
 		//Instantiate CSsmUiSpecific if TLS is null
 		self = new (ELeave) CSsmUiSpecific();
 		CleanupStack::PushL(self);
-		
+		self->ConstructL();
 		//Copy CSsmUiSpecific pointer in TLS
 		User::LeaveIfError(Dll::SetTls(self));
 		CleanupStack::Pop(self);
@@ -203,3 +206,73 @@
 	return EDriveC;
 	}
 
+/**
+Leaving construction inside ConstructL
+*/
+void CSsmUiSpecific::ConstructL()
+	{
+	User::LeaveIfError( iReservedPhoneMemoryFs.Connect() );
+	}
+
+/**
+Reserve two ClusterSize in Phone Memory Space on H/W
+and 512 bytes for __WINS__
+@return KErrNone if successful or systemwide error
+*/
+EXPORT_C TInt CSsmUiSpecific::ReservePhoneMemorySpace()
+    {
+	TVolumeIOParamInfo volumeParamInfo; 
+	const TInt phoneMemoryDriveID = PhoneMemoryRootDriveId();
+	TInt errorCode = iReservedPhoneMemoryFs.VolumeIOParam(phoneMemoryDriveID, volumeParamInfo); 
+	if( KErrNone == errorCode )
+		{
+#ifdef __WINS__
+		//512 bytes for __WINS__
+		const TInt reservedMemory = 512;
+#else
+		//Reserving two clusterSize Phone memory 
+		const TInt reservedMemory = KNumberOfCluster * (volumeParamInfo.iClusterSize);
+#endif //__WINS__
+		errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace(phoneMemoryDriveID, reservedMemory);
+
+		if ( KErrNone == errorCode )
+			{
+			iReservedPhoneMemory = reservedMemory;
+			}
+		}
+    return errorCode;
+    }
+
+/**
+Free reserved bytes from Phone Memory Space. If aSpaceToFree is 0 bytes 
+then free complete reserved memory
+@param aSpaceToFree request to free memory
+@return KErrNone if successful or systemwide error
+*/
+EXPORT_C TInt CSsmUiSpecific::FreeReservedPhoneMemorySpace(const TInt aSpaceToFree)
+    {
+    TInt errorCode(KErrGeneral);
+	DEBUGPRINT3A("Reserved memory is = %d bytes, Request to free memory is = %d bytes", iReservedPhoneMemory, aSpaceToFree);
+    if(0 < iReservedPhoneMemory)
+        {
+		if(0 == aSpaceToFree)
+		    {
+		   	//Free complete reserved phone memory
+			errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), 0 );
+			DEBUGPRINT2A("Freeing memory completed with = %d", errorCode);
+			iReservedPhoneMemory = 0; 
+		    }
+		else
+		    {
+		    TInt newReserveSize = iReservedPhoneMemory - aSpaceToFree;
+		    newReserveSize = newReserveSize >= 0 ? newReserveSize : 0;
+		    errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), newReserveSize );
+			DEBUGPRINT2A("Freeing partial phone memory completed with = %d", errorCode);
+		    if(KErrNone == errorCode)
+			    {
+			    iReservedPhoneMemory = newReserveSize;
+			    }
+		    }
+    	}
+    return errorCode;
+    }
--- a/sysstatemgmt/sysuiprovider/inc/ssmuispecific.h	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/sysuiprovider/inc/ssmuispecific.h	Mon May 03 13:42:22 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"
@@ -168,18 +168,36 @@
      */
     IMPORT_C static TInt PhoneMemoryRootDriveId();
 
+	/**
+	Reserve two ClusterSize in Phone Memory Space on H/W
+	and 512 bytes for __WINS__
+	@return KErrNone if successful or systemwide error
+	*/
+	IMPORT_C TInt ReservePhoneMemorySpace();
+
+	/**
+	Free reserved bytes from Phone Memory Space. If aSpaceToFree is 0 bytes 
+	then free complete reserved memory
+	@param aSpaceToFree request to free memory
+	@return KErrNone if successful or systemwide error
+	*/
+	IMPORT_C TInt FreeReservedPhoneMemorySpace(const TInt aSpaceToFree);
+
 private:
 
     /**
      * Constructor.
      */
     CSsmUiSpecific();
+	
+	void ConstructL();
 
 private: // data
 
     TStrtSecurityStatus iStrtSecurityStatus;
     TInt iReferenceCount;
-
+	RFs iReservedPhoneMemoryFs;
+	TInt iReservedPhoneMemory;
     };
 
 #endif // SSMUISPECIFIC_H
--- a/sysstatemgmt/sysuiprovider/src/ssmuispecific.cpp	Fri Apr 16 16:18:45 2010 +0300
+++ b/sysstatemgmt/sysuiprovider/src/ssmuispecific.cpp	Mon May 03 13:42:22 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"
@@ -36,6 +36,8 @@
 
 // Type definitions for a buffer containing a drive id (drive letter + :).
 const TInt KDriveIdLength = 2;
+//Number of clusterSize to be reserve for phone memory space 
+const TInt KNumberOfCluster = 2;
 typedef TBuf<KDriveIdLength> TDriveId;
 
 // ======== MEMBER FUNCTIONS ========
@@ -47,6 +49,7 @@
 EXPORT_C CSsmUiSpecific::~CSsmUiSpecific()
 	{
     FUNC_LOG;
+    iReservedPhoneMemoryFs.Close();
 	}
 
 
@@ -68,6 +71,7 @@
 		{
 		self = new ( ELeave ) CSsmUiSpecific;
 		CleanupStack::PushL( self );
+		self->ConstructL();
 		User::LeaveIfError( Dll::SetTls( self ) );
 		CleanupStack::Pop( self );
 		}
@@ -431,7 +435,76 @@
 // CSsmUiSpecific::CSsmUiSpecific
 // ---------------------------------------------------------------------------
 //
-CSsmUiSpecific::CSsmUiSpecific() : iReferenceCount( 1 )
+CSsmUiSpecific::CSsmUiSpecific() : iReferenceCount(1), iReservedPhoneMemory(0)
 	{
     FUNC_LOG;
+    }
+/**
+Leaving construction inside ConstructL
+*/
+void CSsmUiSpecific::ConstructL()
+	{
+	FUNC_LOG;
+	
+	User::LeaveIfError( iReservedPhoneMemoryFs.Connect() );
 	}
+
+/**
+ReservePhoneMemorySpace
+*/
+EXPORT_C TInt CSsmUiSpecific::ReservePhoneMemorySpace()
+    {
+	FUNC_LOG;
+	TVolumeIOParamInfo volumeParamInfo; 
+	const TInt phoneMemoryDriveID = PhoneMemoryRootDriveId();
+	TInt errorCode = iReservedPhoneMemoryFs.VolumeIOParam(phoneMemoryDriveID, volumeParamInfo); 
+	if( KErrNone == errorCode )
+		{
+#ifdef __WINS__
+		//512 bytes for __WINS__
+		const TInt reservedMemory = 512;
+#else
+		//Reserving two clusterSize Phone memory 
+		const TInt reservedMemory = KNumberOfCluster * (volumeParamInfo.iClusterSize);
+#endif //__WINS__
+		errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace(phoneMemoryDriveID, reservedMemory);
+
+		if ( KErrNone == errorCode )
+			{
+			iReservedPhoneMemory = reservedMemory;
+			}
+		}
+    return errorCode;
+    }
+
+/**
+FreeReservedPhoneMemorySpace
+*/
+EXPORT_C TInt CSsmUiSpecific::FreeReservedPhoneMemorySpace(const TInt aSpaceToFree)
+    {
+	FUNC_LOG;
+    TInt errorCode(KErrGeneral);
+	INFO_2("Reserved memory is = %d bytes, Request to free memory is = %d bytes", iReservedPhoneMemory, aSpaceToFree);
+    if(0 < iReservedPhoneMemory)
+        {
+		if(0 == aSpaceToFree)
+		    {
+		   	//Free complete reserved phone memory
+			errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), 0 );
+			INFO_1("Freeing memory completed with = %d", errorCode);
+			iReservedPhoneMemory = 0; 
+		    }
+		else
+		    {
+		    TInt newReserveSize = iReservedPhoneMemory - aSpaceToFree;
+		    newReserveSize = newReserveSize >= 0 ? newReserveSize : 0;
+		    errorCode = iReservedPhoneMemoryFs.ReserveDriveSpace( PhoneMemoryRootDriveId(), newReserveSize );
+			INFO_1("Freeing partial phone memory completed with = %d", errorCode);
+		    if(KErrNone == errorCode)
+			    {
+			    iReservedPhoneMemory = newReserveSize;
+			    }
+		    }
+		}
+    return errorCode;
+    }