Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:52:12 +0300
branchRCL_3
changeset 39 469fa8a78de7
parent 33 332e7bf3b42f
child 47 312d2b433792
Revision: 201021 Kit: 2010123
appfw/viewserver/server/VWSERVER.CPP
appfw/viewserver/server/VWSEVENT.CPP
appfw/viewserver/server/vwspatchdata.cpp
commonappservices/alarmserver/Client/Source/ASCliSession.cpp
coreapplicationuis/SysAp/Inc/SysApAppUi.h
coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h
coreapplicationuis/SysAp/Src/SysApAppUi.cpp
coreapplicationuis/SysAp/Src/SysApLightsController.cpp
coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp
coreapplicationuis/powersaveutilities/group/bld.inf
coreapplicationuis/powersaveutilities/loc/batindicatorpaneplugin.loc
coreapplicationuis/powersaveutilities/rom/powersaveutilities.iby
coreapplicationuis/powersaveutilities/rom/powersaveutilitiesresources.iby
coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/formatterrfsplugin.mmp
coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/secureformatter.mmp
coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/formatterrfsplugincommon.h
coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/selectiveformatter.h
coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/formatterrfsplugin.cpp
coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/selectiveformatter.cpp
coreapplicationuis/rfsplugins/StarterRFSPlugin/conf/starterrfsplugin.confml
coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/data/rfstestapp.rss
coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/src/rfstestappui.cpp
tzservices/tzserver/Server/Source/timezonesession.cpp
--- a/appfw/viewserver/server/VWSERVER.CPP	Tue May 25 12:52:36 2010 +0300
+++ b/appfw/viewserver/server/VWSERVER.CPP	Wed Jun 09 09:52:12 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -206,7 +206,8 @@
 		iEnableBoostAppPriorityBeforePanic = valueOfKVwsBoostAppPriorityBeforePanic;
 		}
 #endif
-	
+	LOG3(CVwsLog::EQuiet,_L("CVwsServer::IsPriorityBoostBeforePanicEnabled(): iEnableBoostAppPriorityBeforePanic = [%d] "),iEnableBoostAppPriorityBeforePanic);
+		
 	if (iEnableBoostAppPriorityBeforePanic)
 		{
 		CVwsStartupAware* startupAware = new(ELeave)CVwsStartupAware(*this);
@@ -837,7 +838,7 @@
 		{
 		return;
 		}
-		
+	
 	if (starved.ProcessPriority() < EPriorityForeground)
 		{
 		RProcess owningProcess;
--- a/appfw/viewserver/server/VWSEVENT.CPP	Tue May 25 12:52:36 2010 +0300
+++ b/appfw/viewserver/server/VWSEVENT.CPP	Wed Jun 09 09:52:12 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -127,6 +127,7 @@
 		firstDelay=iServerEventTimeOut;
 		}
 
+	LOG3(CVwsLog::EQuiet,_L("CVwsEventTimer::Start : firstDelay [%d] "),firstDelay.Int());
 	TTimeIntervalMicroSeconds32 delay(firstDelay);
 	iPeriodic->Start(delay,delay,TCallBack(TimerCallBack,this));	
 	iScreenDeviceChangeEvent = aScreenDeviceChangeEvent;
@@ -167,7 +168,7 @@
 			else
 				{
 				//Delay of KTimeoutValueForPreemptedProcess is given after boosting priority of an application
-				TUint8 patchableConst = KTimeoutValueForPreemptedProcess;
+				TInt patchableConst = KTimeoutValueForPreemptedProcess;
 				#ifdef __WINS__
 				// For the emulator allow the constant to be patched via epoc.ini
 				UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalIntProperty,
@@ -175,8 +176,9 @@
 				#endif
 				delay = patchableConst;
 				iTimeOutState = EServerEventTimeOut;
+                LOG2(CVwsLog::ELoud,_L("CVwsEventTimer::DoTimerCallBack : iTimeOutState == EIntermediateEventTimeOut"));
 				}
-			
+            LOG3(CVwsLog::EQuiet,_L("CVwsEventTimer::DoTimerCallBack : delay = [%d] "),delay.Int());
             iPeriodic->Start(delay,delay,TCallBack(TimerCallBack,this));
 			}
 		}
--- a/appfw/viewserver/server/vwspatchdata.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/appfw/viewserver/server/vwspatchdata.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,6 +15,6 @@
 
 #include <e32std.h>
 
-EXPORT_C extern const TInt KVwsBoostAppPriorityBeforePanic = 0;
+EXPORT_C extern const TInt KVwsBoostAppPriorityBeforePanic = 1;
 
 EXPORT_C extern const TInt KTimeoutValueForPreemptedProcess = 4*1000*1000; //4 seconds
--- a/commonappservices/alarmserver/Client/Source/ASCliSession.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/commonappservices/alarmserver/Client/Source/ASCliSession.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -65,7 +65,7 @@
 	TInt startupAttempts = KNumberOfServerStartupAttempts;
 	for(;;)
 		{
-		TInt ret = CreateSession(ASCliDefinitions::ServerAndThreadName(), ASCliDefinitions::Version(), KAlarmServerAsynchronousSlotCount);
+		TInt ret = CreateSession(ASCliDefinitions::ServerAndThreadName(), ASCliDefinitions::Version());
 
 		if	(ret != KErrNotFound && ret != KErrServerTerminated)
 			{
--- a/coreapplicationuis/SysAp/Inc/SysApAppUi.h	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/SysAp/Inc/SysApAppUi.h	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -1444,7 +1444,18 @@
     void AddMmcMenuItemsL( CDesCArray*& aProfileNameCDesCArray,
                            RArray<TInt>& aItemIdArray, 
                            TInt& aPowerMenuItemIndex );
-
+						   
+	public:
+	/**
+    * Starts the charging animation in the battery pane.
+    */
+	void StartChargingBatteryL();
+	
+	/**
+    * Stops the charging animation in the battery pane.
+    */
+	void StopChargingBatteryL();
+	
 private:
     //Data members
 
--- a/coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h	Wed Jun 09 09:52:12 2010 +0300
@@ -22,6 +22,7 @@
 #include <e32base.h>
 #include <coedef.h>
 #include <AknCapServerClient.h>
+#include <e32property.h>
 
 class MSysapCallback;
 class RAknKeylock2;
@@ -236,6 +237,11 @@
          */
         CRepository* iSlideRepository;
         TBool iKeypadWasLocked;
+
+        /**
+          * Call status P&S for slide handling
+          */
+        RProperty iCallStateProperty;
     };
 
 #endif // SYSAPDEFAULTKEYHANDLER_H
--- a/coreapplicationuis/SysAp/Src/SysApAppUi.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/SysApAppUi.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -6890,4 +6890,25 @@
             }
         }
     }
+	
+// ----------------------------------------------------------------------------
+// CSysApAppUi::StartChargingBatteryL
+// ----------------------------------------------------------------------------
+//
+void CSysApAppUi::StartChargingBatteryL() 
+	{
+	TRACES( RDebug::Print( _L("CSysApAppUi::StartChargingBatteryL") ) );
+    iBatteryNotify->StartChargingL();
+    }
+	
+// ----------------------------------------------------------------------------
+// CSysApAppUi::StopChargingBatteryL
+// ----------------------------------------------------------------------------
+//
+void CSysApAppUi::StopChargingBatteryL()
+	{
+	TRACES( RDebug::Print( _L("CSysApAppUi::StopChargingBatteryL") ) );
+    iBatteryNotify->StopChargingL();
+    }
+	
 // End of File
--- a/coreapplicationuis/SysAp/Src/SysApLightsController.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/SysApLightsController.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -29,6 +29,7 @@
 #endif // RD_LIGHT_CONTROL_CHANGE
 
 #include "SysApFeatureManager.h"
+#include "startupdomainpskeys.h"
 
 // CONSTANTS
 
@@ -216,7 +217,13 @@
         {
         iLightPluginHandler->HandleEventNoAction( SysApLightExtension::EChargerConnection, TPckgBuf<TBool>(aConnected) );
         }        
-#endif // RD_LIGHT_CONTROL_CHANGE           
+#endif // RD_LIGHT_CONTROL_CHANGE 
+	TInt state( 0 );
+	TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
+    if ( error == KErrNone && state == ESwStateCharging ) 
+		{
+		EnableActivityManagerL();
+		}		
     }
 
 // ----------------------------------------------------------------------------
@@ -969,16 +976,26 @@
         return;
         }
 
-    TInt err(KErrNone);
+	TInt err(KErrNone);
+    TInt state( 0 );
+    TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
     
-#ifdef RD_LIGHT_CONTROL_CHANGE
-    if ( !iLightPluginHandler->HandleCommand( SysApLightExtension::ELightCommandOff ) )
+    if ( error == KErrNone && state != ESwStateCharging ) 
         {
-        TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
-        }
+#ifdef RD_LIGHT_CONTROL_CHANGE
+		if ( !iLightPluginHandler->HandleCommand( SysApLightExtension::ELightCommandOff ) )
+			{
+			TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
+			}
 #else //  RD_LIGHT_CONTROL_CHANGE
-    TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
-#endif // RD_LIGHT_CONTROL_CHANGE            
+		TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
+#endif // RD_LIGHT_CONTROL_CHANGE  
+		}
+	else
+		{
+		TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
+		iSysApAppUi.StopChargingBatteryL();
+		}            
     // Ignore unreserved in use warnings.
     if ( err != KErrNone && err != KErrInUse )
         {
@@ -1078,6 +1095,13 @@
                 iLightsCurrentlyOn = ETrue;
                 iLastLightsOnTime.HomeTime(); 
                 }
+				
+			TInt state( 0 );
+			TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
+    		if ( error == KErrNone && state == ESwStateCharging ) 
+				{
+				iSysApAppUi.StartChargingBatteryL();
+				}	
             }
         else
             {
--- a/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -37,6 +37,7 @@
 #include <centralrepository.h> //for CRepository
 #include <settingsinternalcrkeys.h>
 #include <keylockpolicyapi.h>
+#include <ctsydomainpskeys.h>
 #include "sysapdefaultkeyhandler.h"
 #include "sysapcallback.h"
 #include "SysAp.hrh"
@@ -128,6 +129,9 @@
     //Load keylock slide handling CR 
     TRAP_IGNORE( iSlideRepository = CRepository::NewL( KCRUidSlideSettings ) );
     iKeylockPolicy = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard );
+
+    //Load PhoneCallStatus P&S  
+    TInt err = iCallStateProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState);
     }
 
 // ---------------------------------------------------------------------------
@@ -216,26 +220,41 @@
 					}
 				else
 					{ // keylock action is defined by user setting
-					TInt keyGuardSetting;
-					iSlideRepository->Get( KSlideKeyguard, keyGuardSetting );
-					switch( ( TSlideSettingKeyguard ) keyGuardSetting )
-						{
-						case ESlideSettingsKeyguardActivatingOn: 
-						    iKeylock->EnableKeyLock();
-						    break;
-						case ESlideSettingsKeyguardActivatingAskMe: 
-						    iKeylock->OfferKeyLock();
-							break;
-						case ESlideSettingsKeyguardActivatingOff: 
-						    //do nothing
-						    break;
-						case ESlideSettingsKeyguardActivatingAutomatic: 
-						    if( iKeypadWasLocked )
-							    {
-								iKeylock->EnableKeyLock();
-								}
-							break;
-						}
+                    TInt status(0);
+                    TInt err = iCallStateProperty.Get( status );
+                    if (err == KErrNone)
+                        {
+                        switch ( status )
+                            {
+                            case EPSCTsyCallStateUninitialized:
+                            case EPSCTsyCallStateNone:
+                                {
+    
+                                TInt keyGuardSetting;
+                                iSlideRepository->Get( KSlideKeyguard, keyGuardSetting );
+                                switch( ( TSlideSettingKeyguard ) keyGuardSetting )
+                                    {
+                                    case ESlideSettingsKeyguardActivatingOn: 
+                                        iKeylock->EnableKeyLock();
+                                        break;
+                                    case ESlideSettingsKeyguardActivatingAskMe: 
+                                        iKeylock->OfferKeyLock();
+                                        break;
+                                    case ESlideSettingsKeyguardActivatingOff: 
+                                        //do nothing
+                                        break;
+                                    case ESlideSettingsKeyguardActivatingAutomatic: 
+                                        if( iKeypadWasLocked )
+                                            {
+                                            iKeylock->EnableKeyLock();
+                                            }
+                                        break;
+                                    }
+                                }
+                            default: // any other state
+                                break;
+                            }
+                        }
 					}
                 // apply default light control
                 iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyGripClose) );
--- a/coreapplicationuis/powersaveutilities/group/bld.inf	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/powersaveutilities/group/bld.inf	Wed Jun 09 09:52:12 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"
@@ -28,6 +28,7 @@
 ../conf/powersaveutilities_2001011A.crml    MW_LAYER_CRML(powersaveutilities_2001011A.crml)
 
 ../rom/powersaveutilities.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(powersaveutilities.iby)
+../rom/powersaveutilitiesresources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(powersaveutilitiesresources.iby)
 ../bsutil/inc/bsutil.h          |../../inc/bsutil.h
 
 // batterypopupcontrol
--- a/coreapplicationuis/powersaveutilities/loc/batindicatorpaneplugin.loc	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/powersaveutilities/loc/batindicatorpaneplugin.loc	Wed Jun 09 09:52:12 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"
@@ -50,4 +50,5 @@
 // l: popup_battery_window_t1
 // r:5.0
 //
-#define qtn_battery_status_popup    "%N %"
\ No newline at end of file
+#define qtn_battery_status_popup    "%N %"
+
--- a/coreapplicationuis/powersaveutilities/rom/powersaveutilities.iby	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/powersaveutilities/rom/powersaveutilities.iby	Wed Jun 09 09:52:12 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"
@@ -26,7 +26,6 @@
 ECOM_PLUGIN( batindicatorpaneplugin.dll, batindicatorpaneplugin.rsc )
 
 data=DATAZ_\ECOM_RESOURCE_DIR\batindicatorpaneplugin.rsc   ECOM_RESOURCE_DIR\batindicatorpaneplugin.rsc
-data=DATAZ_\ECOM_RESOURCE_DIR\batindpaneplugin.rsc         ECOM_RESOURCE_DIR\batindpaneplugin.rsc
 data=DATAZ_\APP_RESOURCE_DIR\batterypopupcontrol.mif			 APP_RESOURCE_DIR\batterypopupcontrol.mif
 
 #endif // __POWERSAVEUTILITIES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/powersaveutilities/rom/powersaveutilitiesresources.iby	Wed Jun 09 09:52:12 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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:  powesaveutilities resources 
+*
+*/
+
+
+#ifndef __POWERSAVEUTILITIES_RESOURCES_IBY__
+#define __POWERSAVEUTILITIES_RESOURCES_IBY__
+
+data=DATAZ_\ECOM_RESOURCE_DIR\batindpaneplugin.rsc         ECOM_RESOURCE_DIR\batindpaneplugin.rsc
+
+
+#endif // __POWERSAVEUTILITIES_RESOURCES_IBY__
+
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/formatterrfsplugin.mmp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/formatterrfsplugin.mmp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -44,4 +44,3 @@
 LIBRARY         efsrv.lib               // File Server
 LIBRARY         euser.lib               // Base library
 LIBRARY         platformenv.lib         // PathInfo
-LIBRARY			sisregistryclient.lib   // RSisRegistrySession
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/secureformatter.mmp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/group/secureformatter.mmp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,9 +23,11 @@
 TARGETTYPE      exe
 SECUREID        0x20002486
 
-CAPABILITY      ALLFILES TCB // TCB required to delete c:/sys and c:/resource
+CAPABILITY      ALLFILES TCB ReadUserData // TCB required to delete c:/sys and c:/resource
 VENDORID        VID_DEFAULT
 
+EPOCHEAPSIZE    0x1000 0x200000 // if the excludelist entries are more , we need the heapsize of 2MB
+
 SOURCEPATH      ../src
 SOURCE          dirstackentry.cpp
 SOURCE          excludelistentry.cpp
@@ -39,3 +41,4 @@
 
 LIBRARY         efsrv.lib // File Server
 LIBRARY         euser.lib
+LIBRARY			sisregistryclient.lib   // RSisRegistrySession
\ No newline at end of file
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/formatterrfsplugincommon.h	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/formatterrfsplugincommon.h	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2009-10 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -27,12 +27,6 @@
 _LIT( KExcludeList, "\\private\\100059C9\\excludelist.txt" );
 
 /**
-* Exclude list path and file which has the entries of the NR-flagged applications which are installed in c:\ drive and the RFS operation
-* is based on this file itself
-*/
-_LIT( KExcludeListcache, "\\private\\100059C9\\excludelistcache.txt" );
-
-/**
 * Application exclude list path
 */
 _LIT( KApplicationExcludeListPath, "?:\\private\\102073ea\\excludes\\" );
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/selectiveformatter.h	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/inc/selectiveformatter.h	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -115,6 +115,16 @@
     */
     void HandleAppExcludeListsOnDriveL( TPtr aBuf, TChar aDrive );
 
+    /**
+    * Handles NR-Application specific exclude list loading.       
+    */
+    void HandleNrExcludeListsL();
+
+    /**
+    * Append the list of nr-files to the excludelist entry.
+    */
+    void AppendNrlisttoExcludeListL(RPointerArray<HBufC> &nrFileList);
+
 private: // Data
 
     /** File server session. */
@@ -136,4 +146,35 @@
     TBool iValidExcludeListFound;
     };
 
+/** 
+Template class CleanupResetAndDestroy to clean up the array
+of implementation information from the cleanup stack.
+*/
+
+template <class T>
+class CleanupResetAndDestroy
+    {
+public:
+    /**
+    Puts an item on the cleanup stack.
+
+    @param  aRef 
+            The implementation information to be put on the cleanup stack.
+    */
+    inline static void PushL(T& aRef);
+private:
+    static void ResetAndDestroy(TAny *aPtr);
+    };
+template <class T>
+inline void CleanupResetAndDestroyPushL(T& aRef);
+template <class T>
+inline void CleanupResetAndDestroy<T>::PushL(T& aRef)
+    {CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef));}
+template <class T>
+void CleanupResetAndDestroy<T>::ResetAndDestroy(TAny *aPtr)
+    {(STATIC_CAST(T*,aPtr))->ResetAndDestroy();}
+template <class T>
+inline void CleanupResetAndDestroyPushL(T& aRef)
+    {CleanupResetAndDestroy<T>::PushL(aRef);}
+
 #endif // C_SELECTIVEFORMATTER_H
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/formatterrfsplugin.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/formatterrfsplugin.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -19,11 +19,9 @@
 // SYSTEM INCLUDE
 #include <centralrepository.h>
 #include <driveinfo.h>
-#include <swi/sisregistrysession.h>
-#include <swi/sisregistryentry.h>
-#include <swi/sisregistrypackage.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
+
 #include <starterdomaincrkeys.h>
+
 // USER INCLUDE
 #include "formatterrfsplugin.h"
 #include "formatterrfspluginprivatecrkeys.h"
@@ -39,210 +37,17 @@
 
 // ================= LOCAL FUNCTIONS =======================
 
-// ---------------------------------------------------------------------------
-// ExcludeListNameL
-// ---------------------------------------------------------------------------
-//
-static void FileWriteL(RPointerArray<HBufC> &files)
-    {
-    RFs fileSession;
-    RFile file;
-    User::LeaveIfError(fileSession.Connect());
-    TInt err = file.Open(fileSession,_L("c:\\private\\100059C9\\excludelistcache.txt"),EFileWrite|EFileStreamText);
-        
-    if ( err != KErrNone )
-        {
-        RDebug::Print(_L("CFormatterRFSPlugin::ExcludeListNameL , FileWrite : Failed to open the file"));
-        return;
-        }
-
-    TInt pos = 0;
-    file.Seek(ESeekEnd,pos);
-    TInt size = files.Count();
-    RBuf filenameBuf;
-
-    for ( TInt i=0; i < size; i++)
-        {
-        HBufC8* fileName = HBufC8::NewLC(files[i]->Size());
-        TPtr8 fileNamePtr(fileName->Des());
-        fileNamePtr.Copy(*files[i]);
-
-        filenameBuf.Create(fileNamePtr.Length());
-        filenameBuf.Copy(fileNamePtr);
-        TFileText fileText ;
-        fileText.Set(file) ;
-        fileText.Seek(ESeekStart);
-        fileText.Write(filenameBuf);
-        CleanupStack::PopAndDestroy();//Filename
-        file.Flush();
-        }
-
-    file.Close();
-    fileSession.Close();    
-    }
-
-static void MergeFilesL()
-    {
-    
-    RFs fileSession;
-    RFile excludeFileName;
-    
-    User::LeaveIfError(fileSession.Connect());
-    TInt ret = excludeFileName.Open(fileSession,_L("c:\\private\\100059C9\\excludelist.txt"),EFileRead);
-
-		if(ret != KErrNone)
-			{
-			RDebug::Print(_L("CFormatterRFSPlugin::ExcludeListNameL , MergeFiles : Failed to open the file"));
-			return;
-			}
-    excludeFileName.Close();
-
-    CFileMan* fileMan=CFileMan::NewL(fileSession);
-    CleanupStack::PushL(fileMan);
- 
-    TInt result=fileMan->Copy(_L("c:\\private\\100059C9\\excludelist.txt"),_L("c:\\private\\100059C9\\excludelistcache.txt"),CFileMan::EOverWrite);
-		RDebug::Print(_L("CFormatterRFSPlugin::MergeFilesL copying the excludelist.txt to excludelistcache.txt , CFileMan::Copy returned = %d"), result);   
-    CleanupStack::PopAndDestroy(fileMan);
-
-    fileSession.Close();
-    }
 
 static HBufC* ExcludeListNameL( TChar aSystemDrive )
     {
     FUNC_LOG;
 		
-    RDebug::Print(_L("CFormatterRFSPlugin::ExcludeListNameL"));
-    
-    RFs fileSession;
-    RFile file;
-    
-    _LIT8(KFileName, "c:\\private\\100059C9\\excludelistcache.txt\n");
-    TBuf8 <50> fileName;
-    fileName.Copy(KFileName);
-
-    User::LeaveIfError(fileSession.Connect());
-    
-    RDir dir;
-    if(dir.Open(fileSession,_L("c:\\private\\100059C9\\"),KEntryAttNormal) != KErrNone)
-        {
-        User::LeaveIfError(fileSession.MkDir(_L("c:\\private\\100059C9\\")));
-        }
-    
-    TInt rev = file.Replace(fileSession,_L("c:\\private\\100059C9\\excludelistcache.txt"),EFileWrite|EFileStreamText);
-    
-    RDebug::Print(_L("CFormatterRFSPlugin::ExcludeListNameL, Replace returned %d"),rev);
-    
-    file.Flush();
-    file.Close();
-    dir.Close();
-    fileSession.Close();
-
-    Swi::RSisRegistrySession session;
-    CleanupClosePushL(session);
-    User::LeaveIfError(session.Connect());
-    
-    // Get the installed application UIDs
-    RArray<TUid> uids;
-    CleanupClosePushL(uids);
-    session.InstalledUidsL(uids);
-    TInt uidcount = uids.Count(); 
-    
-    Swi::RSisRegistryEntry entry;
-    Swi::RSisRegistryEntry entry2;
-    CleanupClosePushL(entry);
-    CleanupClosePushL(entry2);
-    
-    RPointerArray<HBufC> registryFiles;
-    RPointerArray<HBufC> augmentedRegistryFiles;
-    RPointerArray<HBufC> nonRemovableFiles;
-    RPointerArray<HBufC> nonRemovableAugmentedFiles;
-    CleanupResetAndDestroyPushL(registryFiles);
-    CleanupResetAndDestroyPushL(augmentedRegistryFiles);
-    CleanupResetAndDestroyPushL(nonRemovableFiles);
-    CleanupResetAndDestroyPushL(nonRemovableAugmentedFiles);
-    
-     TInt count;
-     RPointerArray<Swi::CSisRegistryPackage> augmentationPackages;
-     CleanupResetAndDestroyPushL(augmentationPackages);
-     for ( TInt iter=0; iter<uidcount; iter++)
-         {
-         User::LeaveIfError(entry.Open(session,uids[iter]));
-         if(EFalse == entry.RemovableL())
-             {
-             entry.FilesL(nonRemovableFiles);
-             entry.RegistryFilesL(registryFiles);
-             TInt fileCount = nonRemovableFiles.Count(); 
-             for (TInt z=fileCount-1; z>=0;z--)
-                 {
-                 TPtr firstChar(nonRemovableFiles[z]->Des());
-                 if(firstChar.Mid(0,1) == _L("z"))
-                     {
-                     delete nonRemovableFiles[z];
-                     nonRemovableFiles.Remove(z);
-                     }
-                 }
-             // Look for augmentations.
-             if(entry.IsAugmentationL())
-                 {
-                 entry.AugmentationsL(augmentationPackages);
-                 count = entry.AugmentationsNumberL();
-                 for (TInt i=0; i < count; ++i)
-                     {
-                     User::LeaveIfError(entry2.OpenL(session,*augmentationPackages[i]));
-                     if(EFalse == entry2.RemovableL())
-                         {
-                         entry2.FilesL(nonRemovableAugmentedFiles);
-                         entry2.RegistryFilesL(augmentedRegistryFiles);
-                         for (TInt c=0; c<nonRemovableAugmentedFiles.Count();c++)
-                               {
-                               TPtr firstChar(nonRemovableAugmentedFiles[c]->Des());
-                               if(firstChar.Mid(0,1) == _L("z"))
-                                   {
-                                   delete nonRemovableAugmentedFiles[c];
-                                   nonRemovableAugmentedFiles.Remove(c);
-                                   }
-                               }
-											}
-                     	entry2.Close();
-                     	}
-                 }
-             }
-         entry.Close();
-         }
-     RDebug::Print(_L("CFormatterRFSPlugin::ExcludeListNameL Writing the file names to the excludelist.txt"));
- 
-     MergeFilesL();
-		 FileWriteL(nonRemovableAugmentedFiles);
-		 FileWriteL(augmentedRegistryFiles);
-		 FileWriteL(nonRemovableFiles);
- 		 FileWriteL(registryFiles);
-
-     TInt pos = 0;
-     User::LeaveIfError(fileSession.Connect());
-     User::LeaveIfError(file.Open(fileSession,_L("c:\\private\\100059C9\\excludelistcache.txt"),EFileWrite|EFileStreamText));
-          
-     file.Seek(ESeekEnd,pos);
-
-     TBuf<KMaxFileName> configurationLine ;
-     TFileText fileText ;
-     fileText.Set(file) ;
-     fileText.Seek(ESeekStart);
-     configurationLine.Format(_L("c:\\private\\100059C9\\excludelistcache.txt")) ;
-     fileText.Write(configurationLine);
-     
-     file.Flush();
-     file.Close();
-     fileSession.Close();
-    
-     
-     CleanupStack::PopAndDestroy(9,&session);
-
-     HBufC* buf = HBufC::NewLC( KExcludeListcache().Length() + KExcludeListPathNameLenExt );
-     TPtr bufPtr = buf->Des();
-     bufPtr.Append( aSystemDrive );
-     bufPtr.Append( KDriveDelimiter );
-     bufPtr.Append( KExcludeListcache );
-     CleanupStack::Pop( buf );
+    HBufC* buf = HBufC::NewLC( KExcludeList().Length() + KExcludeListPathNameLenExt );
+    TPtr bufPtr = buf->Des();
+    bufPtr.Append( aSystemDrive );
+    bufPtr.Append( KDriveDelimiter );
+    bufPtr.Append( KExcludeList );
+    CleanupStack::Pop( buf );
     return buf;
     }
 
--- a/coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/selectiveformatter.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/FormatterRFSPlugin/src/selectiveformatter.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -17,6 +17,9 @@
 
 
 #include <f32file.h>
+#include <swi/sisregistrysession.h>
+#include <swi/sisregistryentry.h>
+#include <swi/sisregistrypackage.h>
 
 #include "dirstackentry.h"
 #include "selectiveformatter.h"
@@ -24,6 +27,7 @@
 #include "rfsfileman.h"
 #include "trace.h"
 
+_LIT(KZDrive,"z");
 // ================= MEMBER FUNCTIONS =======================
 
 // ---------------------------------------------------------------------------
@@ -125,6 +129,9 @@
     // Handle app specific files
     HandleAppExcludeListsL();
     
+    // Handle NR-Applications
+    HandleNrExcludeListsL();
+    
     if( !iValidExcludeListFound )
         {
         User::Leave( KErrInvalidExcList );
@@ -329,3 +336,130 @@
         dir = NULL;
         }
     }
+
+// ---------------------------------------------------------------------------
+// CSelectiveFormatter::HandleNrExcludeListsL
+// ---------------------------------------------------------------------------
+//
+void CSelectiveFormatter::HandleNrExcludeListsL()
+    {
+    INFO( "CSelectiveFormatter::HandleNrExcludeListsL() START ");
+    
+    Swi::RSisRegistrySession session;
+    CleanupClosePushL(session);
+    User::LeaveIfError(session.Connect());
+    
+    INFO( "In CSelectiveFormatter::HandleNrExcludeListsL() RSisRegistrySession::Connect() established");
+    // Get the installed application UIDs
+    RArray<TUid> uids;
+    CleanupClosePushL(uids);
+    session.InstalledUidsL(uids);
+    TInt uidcount = uids.Count(); 
+    
+    Swi::RSisRegistryEntry regEntry;
+    Swi::RSisRegistryEntry augmentForRegEntry;
+    CleanupClosePushL(regEntry);
+    CleanupClosePushL(augmentForRegEntry);
+    
+    // Array of registry files i.e., .reg and .ctl for the installed apps
+    RPointerArray<HBufC> registryFiles;
+    
+    // Array of registry files i.e., .reg and .ctl for the augmented apps
+    RPointerArray<HBufC> augmentedRegistryFiles;
+    
+    // Array of files installed through package.
+    RPointerArray<HBufC> nonRemovableFiles;
+    
+    // Array of augmented files installed through package.
+    RPointerArray<HBufC> nonRemovableAugmentedFiles;
+    
+    CleanupResetAndDestroyPushL(registryFiles);
+    CleanupResetAndDestroyPushL(augmentedRegistryFiles);
+    CleanupResetAndDestroyPushL(nonRemovableFiles);
+    CleanupResetAndDestroyPushL(nonRemovableAugmentedFiles);
+    
+    TInt count;
+    
+    //Array of augmented packages
+    RPointerArray<Swi::CSisRegistryPackage> augmentationPackages;
+    CleanupResetAndDestroyPushL(augmentationPackages);
+        
+    for ( TInt iter=0; iter<uidcount; iter++)
+     {
+     User::LeaveIfError(regEntry.Open(session,uids[iter]));
+     if(EFalse == regEntry.RemovableL())
+         {
+         INFO( "In CSelectiveFormatter::HandleNrExcludeListsL() get the nonRemovable and registry files");
+         
+         regEntry.FilesL(nonRemovableFiles);
+         regEntry.RegistryFilesL(registryFiles);
+         TInt fileCount = nonRemovableFiles.Count(); 
+         for (TInt nonRemovableFilesCount=fileCount-1; nonRemovableFilesCount>=0;nonRemovableFilesCount--)
+             {
+             TPtr nrFileName(nonRemovableFiles[nonRemovableFilesCount]->Des());
+             if(nrFileName.Left(1) == KZDrive )
+                 {
+                 delete nonRemovableFiles[nonRemovableFilesCount];
+                 nonRemovableFiles.Remove(nonRemovableFilesCount);
+                 }
+             }
+         // Look for augmentations.
+         if(regEntry.IsAugmentationL())
+             {
+             regEntry.AugmentationsL(augmentationPackages);
+             count = regEntry.AugmentationsNumberL();
+             for (TInt augPkgCount=0; augPkgCount < count; ++augPkgCount)
+                 {
+                 User::LeaveIfError(augmentForRegEntry.OpenL(session,*augmentationPackages[augPkgCount]));
+                 if(EFalse == augmentForRegEntry.RemovableL())
+                     {
+                     INFO( "In CSelectiveFormatter::HandleNrExcludeListsL() get the augmented nonRemovable and registry files");
+                     augmentForRegEntry.FilesL(nonRemovableAugmentedFiles);
+                     augmentForRegEntry.RegistryFilesL(augmentedRegistryFiles);
+                     }
+                 augmentForRegEntry.Close();
+                 }
+             }
+         }
+     AppendNrlisttoExcludeListL(nonRemovableFiles);
+     nonRemovableFiles.ResetAndDestroy();
+     regEntry.Close();
+     }
+    INFO( "In CSelectiveFormatter::HandleNrExcludeListsL() append the list of files to the excludelist ");
+    
+    AppendNrlisttoExcludeListL(nonRemovableAugmentedFiles);
+    AppendNrlisttoExcludeListL(augmentedRegistryFiles);
+    AppendNrlisttoExcludeListL(registryFiles);
+    
+    CleanupStack::PopAndDestroy(9,&session);
+    INFO( "CSelectiveFormatter::HandleNrExcludeListsL() End");
+    }
+
+// ---------------------------------------------------------------------------
+// CSelectiveFormatter::HandleNrExcludeListsL
+// ---------------------------------------------------------------------------
+//
+
+void CSelectiveFormatter::AppendNrlisttoExcludeListL(RPointerArray<HBufC> &aFileNameArr)
+    {
+    INFO( "CSelectiveFormatter::AppendNrlisttoExcludeListL() START ");
+    TInt size = aFileNameArr.Count();
+    CExcludeListEntry* entry;
+    TInt err;
+    for ( TInt i=0; i < size; i++)
+        {
+        entry = CExcludeListEntry::NewL( aFileNameArr[i]->Des() );
+        err = iExcludeList.InsertInOrder( entry, CExcludeListEntry::Compare ); // take ownership
+        if( err != KErrNone )
+            {
+            delete entry; // delete entry if ownership not transferred
+            
+            if( err != KErrAlreadyExists )
+                {
+                INFO_1( "CSelectiveFormatter::AppendNrlisttoExcludeListL() leaves with error code %d",err);
+                User::Leave( err );
+                }
+            }            
+        }
+    INFO( "CSelectiveFormatter::AppendNrlisttoExcludeListL() END ");
+    }
Binary file coreapplicationuis/rfsplugins/StarterRFSPlugin/conf/starterrfsplugin.confml has changed
--- a/coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/data/rfstestapp.rss	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/data/rfstestapp.rss	Wed Jun 09 09:52:12 2010 +0300
@@ -21,8 +21,8 @@
 #include <appinfo.rh>
 #include <avkon.rh>
 #include <avkon.rsg>
-#include <commondialogs.hrh>
-#include <commondialogs.rh>
+//#include <commondialogs.hrh>
+//#include <commondialogs.rh>
 #include <eikon.rh>
 #include <avkon.loc>
 #include "rfstestappcmds.hrh"
@@ -120,17 +120,19 @@
 // r_rfstestapp_memory_selection
 // ---------------------------------------------------------------------------
 //
+/*
 RESOURCE MEMORYSELECTIONDIALOG r_rfstestapp_memory_selection
     {
     title = "";
     softkey_1 = "Ok";
     }
-
+*/
 
 // ---------------------------------------------------------------------------
 // r_rfstestapp_specfile_selection
 // ---------------------------------------------------------------------------
 //
+/*
 RESOURCE FILESELECTIONDIALOG r_rfstestapp_specfile_selection
     {
     title = "Select Data Specification File";
@@ -147,13 +149,14 @@
             filter_data = { "*.spc" };
             }
         };
-    }
+    }*/
 
 
 // ---------------------------------------------------------------------------
 // r_rfstestapp_excludelist_selection
 // ---------------------------------------------------------------------------
 //
+/*
 RESOURCE FILESELECTIONDIALOG r_rfstestapp_excludelist_selection
     {
     title = "Select Exclude List File";
@@ -171,7 +174,7 @@
             }
         };
     }
-
+*/
 
 // ---------------------------------------------------------------------------
 // r_rfstestapp_progress
--- a/coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/src/rfstestappui.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/coreapplicationuis/rfsplugins/tsrc/rfspluginstest/rfstestapp/src/rfstestappui.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -16,9 +16,9 @@
 */
 
 
-#include <akncommondialogsdynmem.h>
+//#include <akncommondialogsdynmem.h>
 #include <aknwaitdialog.h>
-#include <commondialogs.hrh>
+//#include <commondialogs.hrh>
 #include <rfstestapp.rsg>
 #include <aknlists.h>
 #include <aknpopup.h>
@@ -63,13 +63,13 @@
     TParsePtr parse( aPath );
     TPtrC rootFolder = parse.DriveAndPath();
     INFO_1( "Root folder for opening test files: %S", &rootFolder );
-    TBool ret = AknCommonDialogsDynMem::RunSelectDlgLD(
-        AknCommonDialogsDynMem::EMemoryTypePhone |
-        AknCommonDialogsDynMem::EMemoryTypeMMC,
-        aPath,
-        rootFolder,
-        R_RFSTESTAPP_MEMORY_SELECTION,
-        aResId );
+   TBool ret =ETrue;// = AknCommonDialogsDynMem::RunSelectDlgLD(
+        //AknCommonDialogsDynMem::EMemoryTypePhone |
+        //AknCommonDialogsDynMem::EMemoryTypeMMC,
+        //aPath,
+        //rootFolder,
+        //R_RFSTESTAPP_MEMORY_SELECTION,
+        //aResId );
 
     return ret;
     }
@@ -234,6 +234,7 @@
     HBufC* specFile = HBufC::NewLC( KMaxFileName );
     TPtr specFileDes = specFile->Des();
     specFileDes = aSpec;
+    /*
     if ( AskPathL( specFileDes, R_RFSTESTAPP_SPECFILE_SELECTION ) )
         {
         HBufC* excludeFile = HBufC::NewLC( KMaxFileName );
@@ -278,7 +279,7 @@
             }
 
         CleanupStack::PopAndDestroy( excludeFile );
-        }
+        }*/
     CleanupStack::PopAndDestroy( specFile );
     }
 
--- a/tzservices/tzserver/Server/Source/timezonesession.cpp	Tue May 25 12:52:36 2010 +0300
+++ b/tzservices/tzserver/Server/Source/timezonesession.cpp	Wed Jun 09 09:52:12 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -698,19 +698,23 @@
  TInt CTzServerSession::doGetUserTimeZoneNamesL(const RMessage2& aMessage)
 	{
 	TInt size = iTzUserDataCache->SizeOfNames();
-	CBufFlat* buffer = CBufFlat::NewL(size);
-	CleanupStack::PushL(buffer);
-	buffer->ExpandL(0,size);
-	
-	RBufWriteStream writeStream;
-	CleanupClosePushL(writeStream);
-	writeStream.Open(*buffer);
-	const CTzUserNames& names = iTzUserDataCache->GetNames();
-	writeStream << names;
-	writeStream.CommitL();
-	aMessage.WriteL(0, buffer->Ptr(0));
-	CleanupStack::PopAndDestroy(2, buffer);
-	return KErrNone;
+	if ( size > 0 )
+		{
+		CBufFlat* buffer = CBufFlat::NewL(size);
+		CleanupStack::PushL(buffer);
+		buffer->ExpandL(0,size);
+		
+		RBufWriteStream writeStream;
+		CleanupClosePushL(writeStream);
+		writeStream.Open(*buffer);
+		const CTzUserNames& names = iTzUserDataCache->GetNames();
+		writeStream << names;
+		writeStream.CommitL();
+		aMessage.WriteL(0, buffer->Ptr(0));
+		CleanupStack::PopAndDestroy(2, buffer);
+		return KErrNone;
+		}
+	return KErrArgument;
 	}
 	
 /**