Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:36:55 +0300
branchRCL_3
changeset 12 9f21bab39f42
parent 10 ab88d4a85041
child 13 4a4892eec172
Revision: 201017 Kit: 201019
clfwrapper/CommonInc/CLFConsts.h
clfwrapper/group/contentlistingframework.mmp
harvester/blacklistclient/src/blacklistclient.cpp
harvester/blacklistserver/group/blacklistserver.mmp
harvester/blacklistserver/inc/blacklistcommon.h
harvester/blacklistserver/src/blacklistserver.cpp
harvester/client/bwincw/harvesterclientwinscw.def
harvester/client/eabi/harvesterclientarm.def
harvester/client/group/harvesterclient.mmp
harvester/client/inc/harvestersessionwatcher.h
harvester/client/src/harvesterclient.cpp
harvester/client/src/harvestersessionwatcher.cpp
harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp
harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp
harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp
harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp
harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp
harvester/server/src/harvesterao.cpp
harvester/server/src/harvesterqueue.cpp
harvester/sis/blacklistserver/package.pkg
iadstoprestart/inc/iadstop.h
inc/mdcserializationtype.h
inc/mdscommoninternal.h
inc/mdssqlconnection.inl
locationmanager/locationtrail/bwincw/locationtrailwinscw.def
locationmanager/locationtrail/eabi/locationtrailarm.def
locationmanager/locationtrail/inc/cgpxconverterao.h
locationmanager/locationtrail/inc/clocationrecord.h
locationmanager/locationtrail/src/cgpxconverterao.cpp
locationmanager/locationtrail/src/clocationrecord.cpp
locationmanager/server/src/clocationmanagerserver.cpp
locationmanager/server/src/clocationmanagersession.cpp
mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp
mds_plat/harvester_framework_api/inc/harvesterclient.h
mds_plat/harvester_framework_api/inc/monitorplugin.h
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h
mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp
mds_plat/metadata_engine_api/inc/mdccommon.h
mds_plat/metadata_engine_api/inc/mdequery.h
mds_plat/metadata_engine_api/tsrc/conf/MdETestScripter.cfg
mds_plat/metadata_engine_api/tsrc/src/MdETestScripter.cpp
metadataengine/client/src/mdeobjectcondition.cpp
metadataengine/data/MetadataEngine_Stub.pkg
metadataengine/data/metadataengine.pkg
metadataengine/server/group/mdsserver.mmp
metadataengine/server/inc/mdslogger.h
metadataengine/server/inc/mdsmanipulationengine.h
metadataengine/server/src/mdsfindsqlclause.cpp
metadataengine/server/src/mdsserver.cpp
metadataengine/server/src/mdssqliteconnection.cpp
metadataengine/sis/package.pkg
rom/mds.iby
sis/mds/mds_stub.sis
sis/mds/package.pkg
sis/mds/package_separate.pkg
sis/mds/stub.pkg
watchdog/src/watchdog.cpp
--- a/clfwrapper/CommonInc/CLFConsts.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/clfwrapper/CommonInc/CLFConsts.h	Tue May 11 16:36:55 2010 +0300
@@ -30,8 +30,6 @@
 const TInt KCLFServerCollectionManagerMajor( 2 );
 const TInt KCLFServerMinor( 1 );
 const TInt KCLFServerBuild( 1 );
-_LIT( KCLFServerName, "ContentListingFrameworkServer" );
-_LIT( KCLFServerExe, "ContentListingServer.exe" );
 
 // Message slots
 // RCLFDatabase::PrepareItemIds
--- a/clfwrapper/group/contentlistingframework.mmp	Tue Apr 27 17:05:23 2010 +0300
+++ b/clfwrapper/group/contentlistingframework.mmp	Tue May 11 16:36:55 2010 +0300
@@ -58,6 +58,7 @@
 PAGED
 BYTEPAIRCOMPRESSTARGET
 OPTION ARMCC -O3 -OTime
+OPTION GCC -w
 
 // End of File
 
--- a/harvester/blacklistclient/src/blacklistclient.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/blacklistclient/src/blacklistclient.cpp	Tue May 11 16:36:55 2010 +0300
@@ -419,7 +419,7 @@
         }
     else
         {
-        Send( EBlacklistCloseDB );
+        SendReceive( EBlacklistCloseDB );
         }
 
     WRITELOG( "RBlacklistClient::CloseDBL - end" );
--- a/harvester/blacklistserver/group/blacklistserver.mmp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/blacklistserver/group/blacklistserver.mmp	Tue May 11 16:36:55 2010 +0300
@@ -16,13 +16,13 @@
 
 #include <platform_paths.hrh>
 VERSION					  10.0
-TARGET            blacklistserver.exe
+TARGET            !blacklistserver.exe
 TARGETTYPE        exe
 UID               0x0 0x2001B2EB 
 
 VENDORID          VID_DEFAULT
 
-CAPABILITY        CAP_SERVER 
+CAPABILITY        CAP_SERVER ProtServ
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	  /epoc32/include/connect
--- a/harvester/blacklistserver/inc/blacklistcommon.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/blacklistserver/inc/blacklistcommon.h	Tue May 11 16:36:55 2010 +0300
@@ -19,8 +19,8 @@
 
 #include <e32base.h>
 
-_LIT( KBlacklistServerName, "BlacklistServer" );
-_LIT( KBlacklistServerExe,  "BlacklistServer.exe" ); // 0x0 2001B2EB = server uid
+_LIT( KBlacklistServerName, "!BlacklistServer" );
+_LIT( KBlacklistServerExe,  "!BlacklistServer.exe" ); // 0x0 2001B2EB = server uid
 _LIT( KBlacklistChunkName,  "BlacklistServerChunk" );
 
 const TUid KUidKBlacklistServer = { 0x2001B2EB };  
--- a/harvester/blacklistserver/src/blacklistserver.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/blacklistserver/src/blacklistserver.cpp	Tue May 11 16:36:55 2010 +0300
@@ -290,16 +290,16 @@
     iDatabaseOpen = ETrue; 
     CleanupStack::PopAndDestroy( databasePath );
 
+    if ( !TableExistsL() )
+        {
+        CreateBlacklistTableL();
+        }
+    
     // Add or remove operations when DB connection was off  
     if ( iDBUpdateNeeded )
         {
         CommitBufferedItemsL();        
         }
-
-    if ( !TableExistsL() )
-        {
-        CreateBlacklistTableL();
-        }
     
     LoadDatabaseToMemoryL();
     
--- a/harvester/client/bwincw/harvesterclientwinscw.def	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/client/bwincw/harvesterclientwinscw.def	Tue May 11 16:36:55 2010 +0300
@@ -12,4 +12,6 @@
 	?Stop@RHarvesterClient@@QAEXXZ @ 11 NONAME ABSENT ; void RHarvesterClient::Stop(void)
 	?HarvestFile@RHarvesterClient@@QAEXABVTDesC16@@AAV?$RArray@K@@H@Z @ 12 NONAME ; void RHarvesterClient::HarvestFile(class TDesC16 const &, class RArray<unsigned long> &, int)
 	?HarvestFileWithUID@RHarvesterClient@@QAEXABVTDesC16@@AAV?$RArray@K@@HVTUid@@@Z @ 13 NONAME ; void RHarvesterClient::HarvestFileWithUID(class TDesC16 const &, class RArray<unsigned long> &, int, class TUid)
+	?AddSessionObserverL@RHarvesterClient@@QAEXAAVMHarvesterSessionObserver@@@Z @ 14 NONAME ; void RHarvesterClient::AddSessionObserverL(class MHarvesterSessionObserver &)
+	?RemoveSessionObserver@RHarvesterClient@@QAEXXZ @ 15 NONAME ; void RHarvesterClient::RemoveSessionObserver(void)
 
--- a/harvester/client/eabi/harvesterclientarm.def	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/client/eabi/harvesterclientarm.def	Tue May 11 16:36:55 2010 +0300
@@ -18,4 +18,6 @@
 	_ZN16RHarvesterClient18HarvestFileWithUIDERK7TDesC16R6RArrayImEi4TUid @ 17 NONAME
 	_ZTI22CHarvesterRequestQueue @ 18 NONAME ; #<TI>#
 	_ZTV22CHarvesterRequestQueue @ 19 NONAME ; #<VT>#
+	_ZN16RHarvesterClient19AddSessionObserverLER25MHarvesterSessionObserver @ 20 NONAME
+	_ZN16RHarvesterClient21RemoveSessionObserverEv @ 21 NONAME
 
--- a/harvester/client/group/harvesterclient.mmp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/client/group/harvesterclient.mmp	Tue May 11 16:36:55 2010 +0300
@@ -41,6 +41,7 @@
 SOURCEPATH        ../src
 SOURCE            harvesterclient.cpp
 SOURCE            harvesterclientao.cpp
+SOURCE            harvestersessionwatcher.cpp
 SOURCE		      harvestereventobserverao.cpp 
 SOURCE            harvesterrequestactive.cpp
 SOURCE            harvesterrequestqueue.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/client/inc/harvestersessionwatcher.h	Tue May 11 16:36:55 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*/
+
+#ifndef HARVESTERSESSIONWATCHER_H
+#define HARVESTERSESSIONWATCHER_H
+
+#include <e32base.h>
+#include <harvesterclient.h>
+
+NONSHARABLE_CLASS( CHarvesterSessionWatcher ) : public CActive
+	{
+public:
+
+    enum THarvesterWatcherState
+        {
+        EIdle,
+        ERunning,
+        ESCancelled
+        };
+
+	// Cancel and destroy
+	~CHarvesterSessionWatcher();
+
+	// Two-phased constructor.
+	static CHarvesterSessionWatcher* NewL( MHarvesterSessionObserver& aObserver );
+
+public:
+
+    // from base class CActive
+    void RunL();
+    TInt RunError( TInt aError );
+    void DoCancel();
+
+private:	
+
+    CHarvesterSessionWatcher( MHarvesterSessionObserver& aObserver );
+    
+    void ConstructL();
+    
+    void Start();
+
+private:	
+	
+    RProcess iProcess;
+    
+    THarvesterWatcherState iState;
+    
+    MHarvesterSessionObserver* iObserver;   
+	};
+
+#endif // HARVESTERSESSIONWATCHER_H
--- a/harvester/client/src/harvesterclient.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/client/src/harvesterclient.cpp	Tue May 11 16:36:55 2010 +0300
@@ -22,6 +22,7 @@
 #include "harvestereventobserverao.h"
 #include "harvesterlog.h"
 #include "harvesterclientao.h"
+#include "harvestersessionwatcher.h"
 #include "mdsutils.h"
 #include "harvesterrequestactive.h"
 #include "mdscommoninternal.h"
@@ -164,6 +165,8 @@
     {
     WRITELOG( "RHarvesterClient::Close()" );
     
+    delete iSessionWatcher;
+    
     // cancels Harvest Complete request if it exist at server
     UnregisterHarvestComplete();
     
@@ -408,6 +411,33 @@
     }
 
 // ----------------------------------------------------------------------------------------
+// AddSessionObserver
+// ----------------------------------------------------------------------------------------
+//
+EXPORT_C void RHarvesterClient::AddSessionObserverL( MHarvesterSessionObserver& aObserver  )
+    {
+    if( iSessionWatcher )
+        {
+        delete iSessionWatcher;
+        iSessionWatcher = NULL;
+        }
+    iSessionWatcher = CHarvesterSessionWatcher::NewL( aObserver );
+    }
+
+// ----------------------------------------------------------------------------------------
+// RemoveSessionObserver
+// ----------------------------------------------------------------------------------------
+//
+EXPORT_C void RHarvesterClient::RemoveSessionObserver()
+    {
+    if( iSessionWatcher )
+        {
+        delete iSessionWatcher;
+        iSessionWatcher = NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------------------
 // RegisterHarvestComplete
 // ----------------------------------------------------------------------------------------
 //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/client/src/harvestersessionwatcher.cpp	Tue May 11 16:36:55 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Harvester session watcher
+*
+*/
+
+#include "harvestersessionwatcher.h"
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CHarvesterSessionWatcher* CHarvesterSessionWatcher::NewL( MHarvesterSessionObserver& aObserver )
+	{
+    CHarvesterSessionWatcher* self = new ( ELeave ) CHarvesterSessionWatcher( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+	}
+
+// ---------------------------------------------------------------------------
+// ~CHarvesterSessionWatcher
+// ---------------------------------------------------------------------------
+//
+CHarvesterSessionWatcher::~CHarvesterSessionWatcher() // destruct
+	{   
+    Cancel();
+ 	}
+
+// ---------------------------------------------------------------------------
+// CHarvesterSessionWatcher
+// First-phase C++ constructor
+// ---------------------------------------------------------------------------
+//
+CHarvesterSessionWatcher::CHarvesterSessionWatcher( MHarvesterSessionObserver& aObserver )
+    : CActive( CActive::EPriorityStandard ), iState( EIdle ), iObserver( &aObserver )
+  	{
+    // Add to active scheduler.
+    CActiveScheduler::Add( this );
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CHarvesterSessionWatcher::ConstructL() // second-phase constructor
+	{
+    _LIT( KHarvesterServerProcess, "HarvesterServer*" );
+    TFullName name;
+        
+    // find Harvester Server
+    TFindProcess findProcess( KHarvesterServerProcess );
+    if ( findProcess.Next(name) == KErrNone )
+        {                      
+        User::LeaveIfError( iProcess.Open(name) );
+        iState = ERunning;
+        // logon to get termination signal
+        iProcess.Logon( iStatus );        
+        SetActive();
+        }
+    else
+        {
+        User::Leave( KErrCommsBreak );
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// DoCancel
+// ---------------------------------------------------------------------------
+//
+void CHarvesterSessionWatcher::DoCancel()
+	{
+    iState = ESCancelled;
+    iProcess.LogonCancel( iStatus );
+    iProcess.Close();
+	}
+
+// ---------------------------------------------------------------------------
+// RunL
+// ---------------------------------------------------------------------------
+//
+void CHarvesterSessionWatcher::RunL()
+	{ 
+    switch (iState)
+        {
+          case EIdle:
+          case ESCancelled:
+              {
+              break;
+              }       
+              
+          case ERunning:
+              {
+              // server terminated, notify clients
+              iObserver->HarvesterServerTerminated();
+              break;
+              }
+            
+          default:
+              break; 
+        }
+	}
+	
+// ---------------------------------------------------------------------------
+// RunError
+// ---------------------------------------------------------------------------
+//	
+TInt CHarvesterSessionWatcher::RunError( TInt /*aError*/ )
+    {   
+    return KErrNone;
+    }
+
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Tue May 11 16:36:55 2010 +0300
@@ -28,6 +28,7 @@
 #include "harvesteraudioplugin.h"
 #include "harvesteraudiopluginutils.h"
 #include "mdsutils.h"
+#include "mdscommoninternal.h"
 
 #include "harvesterlog.h"
 
@@ -399,7 +400,7 @@
     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
 	
     if ( song.Length() > 0
-        && song.Length() < iMaxTextLength )
+        && song.Length() < KMaxTitleFieldLength )
         {    
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iTitlePropertyDef, &song, EFalse );
--- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Tue May 11 16:36:55 2010 +0300
@@ -23,6 +23,7 @@
 #include "harvesterlog.h"
 #include "harvestercommon.h"
 #include "mdeobjectwrapper.h"
+#include "mdscommoninternal.h"
 #include <harvesterdata.h>
 
 #include <mdenamespacedef.h>
@@ -39,6 +40,8 @@
 
 _LIT( KSvgMime, "image/svg+xml" );
 
+_LIT(KInUse, "InUse");
+
 CHarvesterOmaDrmPluginPropertyDefs::CHarvesterOmaDrmPluginPropertyDefs() : CBase()
 	{
 	}
@@ -303,7 +306,7 @@
     		*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
     
     // Title (is set from URI by default)
-    if( aVHD.iTitle.Length() > 0 && aVHD.iTitle.Length() < iMaxTextLength )
+    if( aVHD.iTitle.Length() > 0 && aVHD.iTitle.Length() < KMaxTitleFieldLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     			*iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse );
@@ -343,6 +346,12 @@
 		err = content->GetStringAttribute( ContentAccess::EMimeType, mime );
 		delete content;
 		}
+	
+	if( err == KErrInUse || err == KErrLocked )
+	    {
+	    aObjectType.Copy( KInUse() );
+	    return;
+	    }
     
 	if( mime == KSvgMime )
 	    {
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Tue May 11 16:36:55 2010 +0300
@@ -27,6 +27,7 @@
 #include "harvesterlog.h"
 #include "harvesterblacklist.h"
 #include "mdeobjectwrapper.h"
+#include "mdscommoninternal.h"
 
 #include <mdenamespacedef.h>
 #include <mdeobjectdef.h>
@@ -758,7 +759,6 @@
         	aVHD.iMimeBuf = mime.Alloc();
         	}
         
-        helixMetadata->ResetL();
         CleanupStack::PopAndDestroy( helixMetadata );
         
         // don't destory mime type pointers just clean array
@@ -1089,7 +1089,7 @@
         }
     
     // Title
-    if( aVHD.iTitle && aVHD.iTitle->Length() < iMaxTextLength )
+    if( aVHD.iTitle && aVHD.iTitle->Length() < KMaxTitleFieldLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTitlePropertyDef, aVHD.iTitle, EFalse );
         }
--- a/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp	Tue May 11 16:36:55 2010 +0300
@@ -23,6 +23,7 @@
 #include "harvesterlog.h"
 #include "harvestercommon.h"
 #include "harvesterwmvplugin.h"
+#include "mdscommoninternal.h"
 #include <mdenamespacedef.h>
 #include <mdeobjectdef.h>
 #include "mdeobject.h"
@@ -310,7 +311,7 @@
                 *iPropDefs->iDrmPropertyDef, &aClipDetails.iDrmProtected, aIsAdd );
         } 
     // Title (is set from URI by default)
-    if( aClipDetails.iTitle.Length() > 0 && aClipDetails.iTitle.Length() < iMaxTextLength )
+    if( aClipDetails.iTitle.Length() > 0 && aClipDetails.iTitle.Length() < KMaxTitleFieldLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
                 *iPropDefs->iTitlePropertyDef, &aClipDetails.iTitle, EFalse );
--- a/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Tue May 11 16:36:55 2010 +0300
@@ -561,16 +561,34 @@
     // check if not in mde, harvest
     if ( !oldObject && !newObject )
         {
-        HBufC* fn = NULL;        
+        HBufC* fn = NULL; 
+    
+        // ignore created file event if extension is not supported by any harverter plugin
+        if( aNewUrl.Length() > 0 )
+            {
+            if( iHarvesterPluginFactory->IsSupportedFileExtension( aNewUrl ) )
+                {
+                fn = aNewUrl.AllocLC();
+                }
+            else
+                {
+                WRITELOG1( "CFileEventHandlerAO::ReplaceL - file extension not supported: %S", &aNewUrl );
+                return;           
+                }
+            }
+        else
+            {
+            if( iHarvesterPluginFactory->IsSupportedFileExtension( aOldUrl ) )
+                {
+                fn = aOldUrl.AllocLC();
+                }
+            else
+                {
+                WRITELOG1( "CFileEventHandlerAO::ReplaceL - file extension not supported: %S", &aOldUrl );
+                return;           
+                }        
+            }
 
-        if (aNewUrl.Length() > 0)
-        	{
-        	fn = aNewUrl.AllocLC();
-        	}
-        else
-        	{
-        	fn = aOldUrl.AllocLC();
-        	}
         CHarvesterData* hd = CHarvesterData::NewL( fn );
         CleanupStack::Pop( fn );
         hd->SetEventType( EHarvesterAdd );
--- a/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp	Tue May 11 16:36:55 2010 +0300
@@ -157,11 +157,33 @@
 						{
 						continue;
 						}
+					
+                    // check if folder is hidden or system folder
+                    TUint att = 0;
+                    TInt attErr = aFs.Att( name, att );
+                    if ( attErr == KErrNone )
+                        {
+                        if ( att & KEntryAttHidden || att & KEntryAttSystem )
+                            {
+                            continue;
+                            }
+                        }
 
 					path->AppendL( name );
 					}
 				else
 					{
+			        // check if file is hidden or system file
+				    TUint att = 0;
+			        TInt attErr = aFs.Att( name, att );
+			        if ( attErr == KErrNone )
+			            {
+			            if ( att & KEntryAttHidden || att & KEntryAttSystem )
+			                {
+			                continue;
+			                }
+			            }
+				
 					CPlaceholderData* phData = CPlaceholderData::NewL();
 					CleanupStack::PushL( phData );
 					phData->SetUri( name );
--- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Tue May 11 16:36:55 2010 +0300
@@ -265,6 +265,11 @@
 	            mountData->iMountType = TMountData::EUnmount;
 	            iMountTask->StartUnmount( *mountData );
             	}
+            else
+                {
+                delete mountData;
+                mountData = NULL;
+                }
             }
         break;
         
--- a/harvester/server/src/harvesterao.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/server/src/harvesterao.cpp	Tue May 11 16:36:55 2010 +0300
@@ -780,8 +780,6 @@
 
 	TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
 	
-	TInt fastHarvestPlaceholderCount = 0;
-	
 	TInt endindex( iPHArray.Count() );
 	for( TInt i = 0; i < endindex; i++ )
 		{
@@ -846,6 +844,7 @@
 				iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
 				CleanupStack::PopAndDestroy( entry );
 				CleanupStack::PopAndDestroy( phData );
+				CleanupStack::PopAndDestroy( mdeObject );
 				continue;
 		    	}
 		    phData->SetUri( uri );
@@ -872,6 +871,7 @@
 	            i--;
 	            endindex--;
 				iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+				CleanupStack::PopAndDestroy( mdeObject );
 				continue;
 		    	}	
 			CleanupStack::PushL( phData );
@@ -946,7 +946,6 @@
 		// skip 
 		if( hd->TakeSnapshot() )
 			{
-			fastHarvestPlaceholderCount++;
 			hd->SetObjectType( EFastHarvest );
 			}
 		else
@@ -983,15 +982,10 @@
 		    iMdESession->AddObjectsL( mdeObjectArray );
 		    }
 
-		const TInt eventObjectCount = objectCount - fastHarvestPlaceholderCount;
-
-		if( eventObjectCount > 0 )
-			{
-			iHarvesterEventManager->IncreaseItemCount( EHEObserverTypePlaceholder, 
-					eventObjectCount );
-			iHarvesterEventManager->SendEventL( EHEObserverTypePlaceholder, EHEStateStarted, 
-					iHarvesterEventManager->ItemCount( EHEObserverTypePlaceholder ) );
-			}
+	    iHarvesterEventManager->IncreaseItemCount( EHEObserverTypePlaceholder, 
+		        objectCount );
+		iHarvesterEventManager->SendEventL( EHEObserverTypePlaceholder, EHEStateStarted, 
+				iHarvesterEventManager->ItemCount( EHEObserverTypePlaceholder ) );
 		
 #ifdef _DEBUG
 		for (TInt i = 0; i < objectCount; ++i)
@@ -2457,7 +2451,7 @@
 	// check if partial restore was done before last boot
 	TBool partialRestore = iRestoreWatcher->Register();
 	
-#ifdef __WINSCW__
+#if defined(__WINSCW__) || defined(FF_PLATFORM_SIMULATOR)
 	partialRestore = ETrue;
 #endif
 	
--- a/harvester/server/src/harvesterqueue.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/server/src/harvesterqueue.cpp	Tue May 11 16:36:55 2010 +0300
@@ -154,7 +154,10 @@
         		aItem->Uri(), mediaId, time ) )
             {
             WRITELOG( "CHarvesterQueue::Append() - found a blacklisted file" );
-            TRAP_IGNORE( iHEM->DecreaseItemCountL( EHEObserverTypePlaceholder ) );
+            if( aItem->ObjectType() == EPlaceholder )
+                {
+                TRAP_IGNORE( iHEM->DecreaseItemCountL( EHEObserverTypePlaceholder ) );
+                }
             TRAP_IGNORE( iHEM->DecreaseItemCountL( EHEObserverTypeMMC ) );
             if( aItem->EventType() == EHarvesterEdit )
                 {
--- a/harvester/sis/blacklistserver/package.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/harvester/sis/blacklistserver/package.pkg	Tue May 11 16:36:55 2010 +0300
@@ -26,6 +26,6 @@
 :"Nokia"
 
 ;Files
-"\EPOC32\RELEASE\ARMV5\UREL\blacklistserver.exe" -"c:\sys\bin\blacklistserver.exe"
+"\EPOC32\RELEASE\ARMV5\UREL\!blacklistserver.exe" -"c:\sys\bin\!blacklistserver.exe"
 "\EPOC32\RELEASE\ARMV5\UREL\blacklistclient.dll" -"c:\sys\bin\blacklistclient.dll"
 
--- a/iadstoprestart/inc/iadstop.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/iadstoprestart/inc/iadstop.h	Tue May 11 16:36:55 2010 +0300
@@ -25,8 +25,8 @@
 _LIT( KHarvesterServerProcess, "*HarvesterServer*");
 _LIT( KHarvesterServerExe, "harvesterserver.exe" );
 
-_LIT( KMdsServerName, "MdSServer" );
-_LIT( KMdSServerProcess, "*mdsserver*");
+_LIT( KMdsServerName, "!MdSServer" );
+_LIT( KMdSServerProcess, "*!mdsserver*");
 
 _LIT( KTAGDaemonName, "ThumbAGDaemon" );
 _LIT( KTAGDaemonProcess, "*ThumbAGDaemon*" );
--- a/inc/mdcserializationtype.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/inc/mdcserializationtype.h	Tue May 11 16:36:55 2010 +0300
@@ -15,13 +15,12 @@
 *
 */
 
+#ifndef __MDCSERIALIZATIONTYPE_H__
+#define __MDCSERIALIZATIONTYPE_H__
+
 #include "mdscommoninternal.h"
 #include "mdcserializationbuffer.h"
 
-
-#ifndef __MDCSERIALIZATIONTYPE_H__
-#define __MDCSERIALIZATIONTYPE_H__
-
 NONSHARABLE_CLASS(TMdCSerializationType)
 	{
 	protected:
--- a/inc/mdscommoninternal.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/inc/mdscommoninternal.h	Tue May 11 16:36:55 2010 +0300
@@ -46,8 +46,10 @@
 const TInt KMaxUintValueLength   = 10;
 const TInt KMaxUint64ValueLength = 20;
 
-_LIT( KMdSServerName,"MdSServer" ); // Server name
-_LIT( KMdSServerProcessString,"MdSServer*" ); 
+const TInt KMaxTitleFieldLength = 255;
+
+_LIT( KMdSServerName,"!MdSServer" ); // Server name
+_LIT( KMdSServerProcessString,"!MdSServer*" ); 
 _LIT( KSchemaChunkName, "MdSSchema" );
 
 _LIT( KCMediaIdKey, "CDriveMediaId" );
--- a/inc/mdssqlconnection.inl	Tue Apr 27 17:05:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Abstract SQL connection class*
-*/
-
-// -----------------------------------
-// RMdsStatement
-// -----------------------------------
-
-inline RMdsStatement::RMdsStatement( )
-    : iPrepared( EFalse )
-    {
-    }
-
-inline void RMdsStatement::Close()
-    {
-    iStatement.Close();
-    }
-
--- a/locationmanager/locationtrail/bwincw/locationtrailwinscw.def	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/bwincw/locationtrailwinscw.def	Tue May 11 16:36:55 2010 +0300
@@ -31,4 +31,5 @@
 	?SetStateToStopping@CLocationRecord@@QAEXXZ @ 30 NONAME ; void CLocationRecord::SetStateToStopping(void)
 	?LocationSnapshotL@CLocationRecord@@QAEXABI@Z @ 31 NONAME ; void CLocationRecord::LocationSnapshotL(unsigned int const &)
 	?RemappingNeeded@CLocationRecord@@QAEHXZ @ 32 NONAME ; int CLocationRecord::RemappingNeeded(void)
+	?IsLowBattery@CLocationRecord@@QAEHXZ @ 33 NONAME ; int CLocationRecord::IsLowBattery(void)
 
--- a/locationmanager/locationtrail/eabi/locationtrailarm.def	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/eabi/locationtrailarm.def	Tue May 11 16:36:55 2010 +0300
@@ -53,4 +53,5 @@
 	_ZN9CTrackLogD0Ev @ 52 NONAME
 	_ZN9CTrackLogD1Ev @ 53 NONAME
 	_ZN9CTrackLogD2Ev @ 54 NONAME
+	_ZN15CLocationRecord12IsLowBatteryEv @ 55 NONAME
 
--- a/locationmanager/locationtrail/inc/cgpxconverterao.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/inc/cgpxconverterao.h	Tue May 11 16:36:55 2010 +0300
@@ -162,7 +162,7 @@
     	RPointerArray<TFileName> iFileQueue;
     	RPointerArray<TBoundaries> iBoundQueue;
     	
-    	TFileName iTempFile;
+    	TFileName* iTempFile;    	
     	TBoundaries* iBoundaries;
     	TCoordinate* iLastCoords;
     	TFileName iGpxFileName;
--- a/locationmanager/locationtrail/inc/clocationrecord.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/inc/clocationrecord.h	Tue May 11 16:36:55 2010 +0300
@@ -216,6 +216,8 @@
     TTime GetMdeObjectTimeL( TItemId aObjectId );
     
     IMPORT_C TBool RemappingNeeded();
+    
+    IMPORT_C TBool IsLowBattery();
 
 public: // from MNetworkInfoObserver.
     /**
--- a/locationmanager/locationtrail/src/cgpxconverterao.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/src/cgpxconverterao.cpp	Tue May 11 16:36:55 2010 +0300
@@ -25,7 +25,9 @@
 // Default constructor.
 // ---------------------------------------------------------------------------
 //
-CGpxConverterAO::CGpxConverterAO() : CActive( CActive::EPriorityStandard )
+CGpxConverterAO::CGpxConverterAO() : CActive( CActive::EPriorityStandard ),
+        iTempFile(NULL),
+        iBoundaries(NULL)
     {
     }
 
@@ -75,7 +77,10 @@
     
     iBoundQueue.ResetAndDestroy();
     iBoundQueue.Close();
-    
+
+    delete iTempFile;
+    delete iBoundaries;
+        
     delete iWriteBuf;
     delete iFormatBuf;
     }
@@ -158,10 +163,12 @@
 				{
 				TInt err;
 				iFixLost = ETrue;
+                delete iTempFile;
+                delete iBoundaries;
 				// get next temp-file from queue
-				iTempFile = *iFileQueue[0];
+				iTempFile = iFileQueue[0];
 				iBoundaries = iBoundQueue[0];
-				err = iReader.Open( iFs, iTempFile, EFileRead );				
+				err = iReader.Open( iFs, *iTempFile, EFileRead );				
 				// remove from queue				
 				iFileQueue.Remove( 0 );
 				iBoundQueue.Remove( 0 );
@@ -201,7 +208,7 @@
 				{
 				TInt err;
 				iReader.Close();
-				err = iReader.Open( iFs, iTempFile, EFileRead );
+				err = iReader.Open( iFs, *iTempFile, EFileRead );
 				if( err != KErrNone )
 					{
 					SetState( ENextFile );
@@ -216,7 +223,7 @@
 			{
 			LOG("CGpxConverterAO::RunL - EStartFile");
 			_LIT( KExtGPX, ".gpx" );
-			TParsePtrC parse( iTempFile );
+			TParsePtrC parse( *iTempFile );
 			
 			TRAPD(err, GetTrackLogPathL( iGpxPath ));
 			
@@ -288,8 +295,15 @@
 				iObservers[i]->GpxFileCreated( iGpxPath, iTagId, distance, iStartTime, iEndTime );
 				}
 			
+			
+			iFs.Delete( *iTempFile );
+			
+			delete iTempFile;
+			iTempFile = NULL;
+			
 			delete iBoundaries;
-			iFs.Delete( iTempFile );
+			iBoundaries = NULL;
+			
 			SetState( ENextFile );
 			break;
 			}
--- a/locationmanager/locationtrail/src/clocationrecord.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp	Tue May 11 16:36:55 2010 +0300
@@ -27,6 +27,7 @@
 #include "locationtrailpskeys.h"
 #include "mdeconstants.h"
 #include <centralrepository.h>
+#include <hwrmpowerstatesdkpskeys.h>
 
 
 using namespace MdeConstants;
@@ -1118,4 +1119,23 @@
 	return iRemapper->ItemsInQueue();
 	}
 
+EXPORT_C TBool CLocationRecord::IsLowBattery()
+    {
+    LOG("CLocationRecord::IsLowBattery()");
+    RProperty batteryProperty;
+    TInt batteryStatus;
+
+    TInt error = batteryProperty.Get(KPSUidHWRMPowerState, KHWRMBatteryStatus, batteryStatus);
+    LOG1("CLocationRecord::IsLowBattery() - battery status %d", batteryStatus );
+    if( error != KErrNone || batteryStatus == EBatteryStatusOk )
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
+    
+    }
+
 // End of file
--- a/locationmanager/server/src/clocationmanagerserver.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/server/src/clocationmanagerserver.cpp	Tue May 11 16:36:55 2010 +0300
@@ -420,7 +420,7 @@
 
     self->iTimer->Cancel();    
     
-    if ( self->iLocationRecord->RemappingNeeded() )
+    if ( self->iLocationRecord->RemappingNeeded() && !self->iLocationRecord->IsLowBattery())
         {     
         self->iTimer->Start( self->iLocManStopRemapDelay * 1000000, 0, TCallBack( PositioningStopTimeout, self ) );
         self->iWaitForPositioningStopTimeout = ETrue;
--- a/locationmanager/server/src/clocationmanagersession.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/locationmanager/server/src/clocationmanagersession.cpp	Tue May 11 16:36:55 2010 +0300
@@ -280,11 +280,11 @@
 //    
 void CLocationManagerSession::CurrentLocationL( const RMessage2& aMessage )
     {
-    LOG ("CLocationManagerSession::StartLocationTrailL begin");
+    LOG ("CLocationManagerSession::CurrentLocationL begin");
     iLocationHandle = aMessage.Handle();
     // server creates completion after it has received current location data
     Server().RequestCurrentLocationL( aMessage );
-    LOG ("CLocationManagerSession::StartLocationTrailL end");
+    LOG ("CLocationManagerSession::CurrentLocationL end");
     }
 
 // --------------------------------------------------------------------------
--- a/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp	Tue May 11 16:36:55 2010 +0300
@@ -471,6 +471,7 @@
     
     const TInt itemCount( 500 );
     CDesCArray* removeItemArray = new (ELeave) CDesCArrayFlat( itemCount );
+    CleanupStack::PushL( removeItemArray );
 
     for( TInt i = 0 ; i < itemCount ; ++i )
         {
@@ -484,12 +485,12 @@
     TRAP( error, iCollectionManager->RemoveFromAllCollectionsL( *removeItemArray ) );
     if( error != KErrNotSupported && error != KErrNone )
         {
-        delete removeItemArray;
+        CleanupStack::PopAndDestroy( removeItemArray );
         removeItemArray = NULL;
         return error;
         }
     
-    delete removeItemArray;
+    CleanupStack::PopAndDestroy( removeItemArray );
     removeItemArray = NULL;
     
     _LIT( KMsg2, "Exit RemoveFromAllCollectionsL" );
--- a/mds_plat/harvester_framework_api/inc/harvesterclient.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/inc/harvesterclient.h	Tue May 11 16:36:55 2010 +0300
@@ -32,6 +32,8 @@
 class MHarvesterEventObserver;
 class CHarvesterRequestActive;
 class CHarvesterRequestQueue;
+class MHarvesterSessionObserver;
+class CHarvesterSessionWatcher;
 
 // default event interval for MHarvesterEventObserver
 const TInt KHarvesterEventInterval = 20;
@@ -171,6 +173,20 @@
 			TInt aItemsLeft ) = 0;
 	};
 
+class MHarvesterSessionObserver
+    {
+public:
+
+    /**
+     * Called to notify the observer that harvester server has been terminated,
+     * thus harvester server sessions created are now invalid and new connection
+     * needs to be established
+     * NOTE! Cliens still have to call Close() on the session to release client side
+     * resources.
+     */
+    virtual void HarvesterServerTerminated() = 0;
+    };
+
 /**
  * Harvester client session class which provides also means to:
  * - Pause/resume the Harvesting framework
@@ -284,7 +300,20 @@
 		                                  RArray<TItemId> &aAlbumIds, 
 										  TBool aAddLocation,
 										  TUid aUid );
-		
+
+        /**
+         * Public method to set observer for notifications about harvester server termination.
+         * Only one observer at a time is currently supported.
+         *
+         * @param aObserver  Pointer to the observer
+         */     
+    	IMPORT_C void AddSessionObserverL( MHarvesterSessionObserver& aObserver  );
+
+        /**
+         * Public method to remove harvester session observer
+         */     
+        IMPORT_C void RemoveSessionObserver();
+    	
         /**
          * Requests a harvest complete event from harvester server.
 		 * On return, aURI is the URI of the harvested file.
@@ -346,6 +375,11 @@
          * Request queue processor.
          */
         CHarvesterRequestQueue* iRequestQueue;
+        
+        /**
+         * Harvester session observer AO.
+         */
+        CHarvesterSessionWatcher* iSessionWatcher;
     	};
 
 #endif // __HARVESTER_CLIENT_H__
--- a/mds_plat/harvester_framework_api/inc/monitorplugin.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/inc/monitorplugin.h	Tue May 11 16:36:55 2010 +0300
@@ -114,8 +114,8 @@
  *    {
  *	  // Our CMyActiveObjectNotifier notifies us about new file and we notify the Harvester server about it.
  *	  // Before this CMyActiveObjectNotifier has filled the need data to aHarvesterData like:
- *	  // aHarvesterData->SetEventType( EHarvesterAdd );
- *    // aHarvesterData->SetOrigin( aOrigin );
+ *	  aHarvesterData->SetEventType( EHarvesterAdd );
+ *    aHarvesterData->SetOrigin( aOrigin );
  *    iObserver->MonitorEvent( aHarvesterData );
  *    }
  */
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg	Tue May 11 16:36:55 2010 +0300
@@ -410,3 +410,15 @@
 delete test
 [Endtest]
 
+[Test]
+title Harvester Blacklist Test
+timeout 180000
+create HarvesterClientTestScripter test
+test SetUpBlacklist
+test AddFileToBlacklist e:\testing\data\corrupt.jpg
+test CheckBlacklist e:\testing\data\corrupt.jpg
+test RemoveFileFromBlacklist e:\testing\data\corrupt.jpg
+test TearDownBlacklist
+delete test
+[Endtest]
+
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp	Tue May 11 16:36:55 2010 +0300
@@ -34,6 +34,8 @@
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../../../inc
+USERINCLUDE     ../../../../../harvester/common/inc/
+USERINCLUDE     ../../../../../harvester/blacklistclient/inc/
 
 MW_LAYER_SYSTEMINCLUDE
 
@@ -42,4 +44,7 @@
 LIBRARY         mdeclient.lib
 LIBRARY         stiftestinterface.lib
 LIBRARY         stiftestengine.lib
+LIBRARY         harvestercommon.lib
+LIBRARY         blacklistclient.lib
+LIBRARY         efsrv.lib
 
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg	Tue May 11 16:36:55 2010 +0300
@@ -53,4 +53,5 @@
 "..\..\data\mmc\HarvesterTest\MPEG4.3gp"      -"E:\testing\data\MPEG4.3gp"
 "..\..\data\mmc\HarvesterTest\MPEG4.mp4"      -"E:\testing\data\MPEG4.mp4"
 "..\..\data\mmc\HarvesterTest\00001.mp3"      -"E:\testing\data\00001.mp3"
+;"..\..\data\mmc\HarvesterTest\corrupt.jpg"      -"E:\testing\data\corrupt.jpg"
 
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf	Tue May 11 16:36:55 2010 +0300
@@ -51,3 +51,4 @@
 ../../data/mmc/HarvesterTest/Temp2.jpg /epoc32/WINSCW/C/Data/Temp2.jpg
 ../../data/mmc/HarvesterTest/Temp3.jpg /epoc32/WINSCW/C/Data/Temp3.jpg
 ../../data/mmc/HarvesterTest/00001.mp3 /epoc32/WINSCW/C/Data/00001.mp3
+//../../data/mmc/HarvesterTest/corrupt.jpg /epoc32/WINSCW/C/Data/corrupt.jpg
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h	Tue May 11 16:36:55 2010 +0300
@@ -27,6 +27,8 @@
 #include "mdccommon.h"
 #include "mdesession.h"
 #include "mdequery.h"
+#include "harvestermediaidutil.h"
+#include "blacklistclient.h"
 
 // CONSTANTS
 
@@ -142,6 +144,11 @@
         virtual TInt Results( CStifItemParser& aItem );
         virtual TInt AddHarvesterEventObserverL( CStifItemParser& aItem );
         virtual TInt RemoveHarvesterEventObserverL( CStifItemParser& aItem );
+        virtual TInt SetUpBlacklistL( CStifItemParser& aItem );
+        virtual TInt TearDownBlacklistL( CStifItemParser& aItem );
+        virtual TInt AddFileToBlacklistL( CStifItemParser& aItem );
+        virtual TInt CheckBlacklistL( CStifItemParser& aItem );
+        virtual TInt RemoveFileFromBlacklistL( CStifItemParser& aItem );
         
     private:    // Data
         // Status booleans
@@ -162,6 +169,10 @@
         RArray<TItemId> iObjectIdArray;
         
         TFileName iUri;
+
+        RBlacklistClient iBlacklistClient;
+        CHarvesterMediaIdUtil* iMediaIdUtil;
+        RFs iFs;
     };
 
 #endif      // HARVESTERCLIENTTESTSCRIPTER_H
--- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp	Tue May 11 16:36:55 2010 +0300
@@ -77,6 +77,11 @@
         ENTRY( "Results", CHarvesterClientTestScripter::Results ),     
         ENTRY( "AddHarvesterEventObserver", CHarvesterClientTestScripter::AddHarvesterEventObserverL ),
         ENTRY( "RemoveHarvesterEventObserver", CHarvesterClientTestScripter::RemoveHarvesterEventObserverL ),
+        ENTRY( "SetUpBlacklist", CHarvesterClientTestScripter::SetUpBlacklistL ),
+        ENTRY( "TearDownBlacklist", CHarvesterClientTestScripter::TearDownBlacklistL ),
+        ENTRY( "AddFileToBlacklist", CHarvesterClientTestScripter::AddFileToBlacklistL ),
+        ENTRY( "CheckBlacklist", CHarvesterClientTestScripter::CheckBlacklistL ),
+        ENTRY( "RemoveFileFromBlacklist", CHarvesterClientTestScripter::RemoveFileFromBlacklistL ),
         };
 
     const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
@@ -489,6 +494,174 @@
     }
 
 // -----------------------------------------------------------------------------
+// CHarvesterClientTest::SetUpBlacklistL
+// -----------------------------------------------------------------------------
+//
+TInt CHarvesterClientTestScripter::SetUpBlacklistL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KMsg1, "Enter SetUpBlacklistL" );
+    iLog->Log( KMsg1 );
+    RDebug::Print( KMsg1 );
+    
+    User::LeaveIfError( iBlacklistClient.Connect() );
+    iBlacklistClient.LoadBlacklistL();
+    iMediaIdUtil = &RMediaIdUtil::GetInstanceL();
+    User::LeaveIfError( iFs.Connect() );
+    
+    _LIT( KMsg2, "Exit SetUpBlacklistL" );
+    iLog->Log( KMsg2 );
+    RDebug::Print( KMsg2 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CHarvesterClientTest::TearDownBlacklistL
+// -----------------------------------------------------------------------------
+//
+TInt CHarvesterClientTestScripter::TearDownBlacklistL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KMsg1, "Enter TearDownBlacklistL" );
+    iLog->Log( KMsg1 );
+    RDebug::Print( KMsg1 );
+   
+    iBlacklistClient.CloseDBL();
+    iBlacklistClient.Close();
+    RMediaIdUtil::ReleaseInstance();
+    iMediaIdUtil = NULL;
+    iFs.Close();
+    
+    _LIT( KMsg2, "Exit TearDownBlacklistL" );
+    iLog->Log( KMsg2 );
+    RDebug::Print( KMsg2 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CHarvesterClientTest::AddFileToBlacklistL
+// -----------------------------------------------------------------------------
+//
+TInt CHarvesterClientTestScripter::AddFileToBlacklistL( CStifItemParser& aItem )
+    {
+    _LIT( KMsg1, "Enter AddFileToBlacklistL" );
+    iLog->Log( KMsg1 );
+    RDebug::Print( KMsg1 );
+    
+    TPtrC inputFile;
+    User::LeaveIfError( aItem.GetNextString( inputFile ));
+
+    TUint32 mediaId( 0 );
+//    TInt blackListError( KErrNone );
+    TTime modified ( 0 );
+/*    
+    blackListError = iMediaIdUtil->GetMediaId( inputFile, mediaId );
+    if( blackListError != KErrNone )
+        {
+        return blackListError;
+        }
+    
+    blackListError = iFs.Modified( inputFile, modified );
+    if( blackListError != KErrNone )
+        {
+        return blackListError;
+        }
+*/    
+    TRAPD( err, iBlacklistClient.AddL( inputFile, mediaId, modified ) );
+    if( err != KErrNone )
+        {
+        return err;
+        }
+
+    _LIT( KMsg2, "Exit AddFileToBlacklistL" );
+    iLog->Log( KMsg2 );
+    RDebug::Print( KMsg2 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CHarvesterClientTest::CheckBlacklistL
+// -----------------------------------------------------------------------------
+//
+TInt CHarvesterClientTestScripter::CheckBlacklistL( CStifItemParser& aItem )
+    {
+    _LIT( KMsg1, "Enter CheckBlacklistL" );
+    iLog->Log( KMsg1 );
+    RDebug::Print( KMsg1 );
+
+//    iBlacklistClient.LoadBlacklistL();
+    
+    TPtrC inputFile;
+    User::LeaveIfError( aItem.GetNextString( inputFile ));
+    
+    TUint32 mediaId( 0 );
+//    TInt blackListError( KErrNone );
+    TTime modified ( 0 );
+/*    
+    blackListError = iMediaIdUtil->GetMediaId( inputFile, mediaId );
+    if( blackListError != KErrNone )
+        {
+        return blackListError;
+        }
+  
+    blackListError = iFs.Modified( inputFile, modified );
+    if( blackListError != KErrNone )
+        {
+        return blackListError;
+        }
+*/    
+    TBool isBlacklisted( EFalse );
+    TRAP_IGNORE( isBlacklisted = iBlacklistClient.IsBlacklistedL( inputFile, mediaId, modified ) );
+    if( !isBlacklisted )
+        {
+        return KErrNotFound;
+        }
+
+    _LIT( KMsg2, "Exit CheckBlacklistL" );
+    iLog->Log( KMsg2 );
+    RDebug::Print( KMsg2 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CHarvesterClientTest::RemoveFileFromBlacklistL
+// -----------------------------------------------------------------------------
+//
+TInt CHarvesterClientTestScripter::RemoveFileFromBlacklistL( CStifItemParser& aItem )
+    {
+    _LIT( KMsg1, "Enter CheckBlacklistL" );
+    iLog->Log( KMsg1 );
+    RDebug::Print( KMsg1 );
+    
+    TPtrC inputFile;
+    User::LeaveIfError( aItem.GetNextString( inputFile ));
+    
+    TUint32 mediaId( 0 );
+//    TInt blackListError( KErrNone );
+    TTime modified ( 0 );
+/*    
+    blackListError = iMediaIdUtil->GetMediaId( inputFile, mediaId );
+    if( blackListError != KErrNone )
+        {
+        return blackListError;
+        }
+*/    
+    TRAPD( err, iBlacklistClient.RemoveL( inputFile, mediaId ) );
+    if( err != KErrNone )
+        {
+        return err;
+        }
+
+    _LIT( KMsg2, "Exit CheckBlacklistL" );
+    iLog->Log( KMsg2 );
+    RDebug::Print( KMsg2 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
 // CHarvesterClientTest::HarvestingUpdated
 // -----------------------------------------------------------------------------
 //
--- a/mds_plat/metadata_engine_api/inc/mdccommon.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/metadata_engine_api/inc/mdccommon.h	Tue May 11 16:36:55 2010 +0300
@@ -274,6 +274,9 @@
 
     /** Usage count */
     EObjectConditionCompareUsageCount,
+    
+    /** Object URIcontains specified string. */
+    EObjectConditionCompareUriContains,
 
     EObjectConditionCompareLast
     };
--- a/mds_plat/metadata_engine_api/inc/mdequery.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/metadata_engine_api/inc/mdequery.h	Tue May 11 16:36:55 2010 +0300
@@ -284,17 +284,12 @@
 	 * Starts a query operation and returns immediately. The observers of 
      * the query instance will be notified when the query is completed, or 
      * if it fails. The query parameters (order rules, search conditions, 
-     * property filters) must be configured before FindL() is called. FindL() 
-     * may be called several times, but the query parameters that were in 
-     * effect for the first FindL() are used for all subsequent calls. Any 
-     * previously fetched query results remain in the query instance's
-     * list of result items; any new result items are appended to the end of
-     * the list.
+     * property filters) must be configured before FindL() is called. 
      *
      * The caller can perform a find operation in several steps by using a
-     * sufficiently small maximum number of result items. Subsequent calls to
-     * FindL() work incrementally, continuing the previously started find 
-     * operation.
+     * sufficiently small maximum number of result items. Notifications 
+     * about progress of query is returned is steps, continuing the previously 
+     * started find operation.
      *
      * @param aMaxCount     Maximum number of result items. Defaults to 
      *                      unlimited. 
--- a/mds_plat/metadata_engine_api/tsrc/conf/MdETestScripter.cfg	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/metadata_engine_api/tsrc/conf/MdETestScripter.cfg	Tue May 11 16:36:55 2010 +0300
@@ -1917,24 +1917,24 @@
 test SetGuidL EObject obj3 000007 000004
 
 // Test objects' SetUri & Uri
-//test SetUriL obj0 e:\testing\data\TestVideo1.3gp
-//test UriL obj0 e:\testing\data\testvideo1.3gp
-//test SetUriL obj1 e:\testing\data\TestVideo2.mp4
-//test UriL obj1 e:\testing\data\testvideo2.mp4
+test SetUriL obj0 e:\testing\data\TestVideo1.3gp
+test UriL obj0 e:\testing\data\testvideo1.3gp
+test SetUriL obj1 e:\testing\data\TestVideo2.mp4
+test UriL obj1 e:\testing\data\testvideo2.mp4
 
 // Add the objects to the database, observe the additions and verify the observed results.
-test AddObjectObserverWithUriL
+test AddObjectObserverL
 test AddObjectL obj0
 waittestclass test
 test VerifyObserverNotificationTypeL ENotifyAdd
 test AddObjectsL obj1 3
 waittestclass test
 test VerifyObserverNotificationTypeL ENotifyAdd
-test RemoveObjectObserverWithUriL
+test RemoveObjectObserverL
 test VerifyTItemIdsL EObject 0 4
 
 // Remove the objects, observe the removals and verify the observed results.
-test AddObjectObserverWithUriL
+test AddObjectObserverL
 test RemoveObjectL obj0 KById
 waittestclass test
 test VerifyObserverNotificationTypeL ENotifyRemove
@@ -1947,7 +1947,7 @@
 test RemoveObjectL obj3 KById
 waittestclass test
 test VerifyObserverNotificationTypeL ENotifyRemove
-test RemoveObjectObserverWithUriL
+test RemoveObjectObserverL
 test VerifyTItemIdsL EObject 0 4
 
 // Final cleanup.
--- a/mds_plat/metadata_engine_api/tsrc/src/MdETestScripter.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/metadata_engine_api/tsrc/src/MdETestScripter.cpp	Tue May 11 16:36:55 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  ?Description
+* Description:  
 *
 */
 
--- a/metadataengine/client/src/mdeobjectcondition.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/client/src/mdeobjectcondition.cpp	Tue May 11 16:36:55 2010 +0300
@@ -309,6 +309,7 @@
 
 	    case EObjectConditionCompareUri:
 	    case EObjectConditionCompareUriBeginsWith:
+	    case EObjectConditionCompareUriContains:
 	    case EObjectConditionCompareFreeText:
 	    case EObjectConditionCompareFreeTextContains:
 	    case EObjectConditionCompareFreeTextBeginsWith:
@@ -410,6 +411,7 @@
 
 	    case EObjectConditionCompareUri:
 	    case EObjectConditionCompareUriBeginsWith:
+	    case EObjectConditionCompareUriContains:
 	    case EObjectConditionCompareFreeText:
 	    case EObjectConditionCompareFreeTextContains:
 	    case EObjectConditionCompareFreeTextBeginsWith:
--- a/metadataengine/data/MetadataEngine_Stub.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/data/MetadataEngine_Stub.pkg	Tue May 11 16:36:55 2010 +0300
@@ -28,4 +28,4 @@
 ;Files
 ""-"z:\sys\bin\mdeclient.dll"
 ""-"z:\sys\bin\mdccommon.dll"
-""-"z:\sys\bin\mdsserver.exe"
\ No newline at end of file
+""-"z:\sys\bin\!mdsserver.exe"
\ No newline at end of file
--- a/metadataengine/data/metadataengine.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/data/metadataengine.pkg	Tue May 11 16:36:55 2010 +0300
@@ -28,4 +28,4 @@
 ;Files
 "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"!:\sys\bin\mdeclient.dll"
 "\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"!:\sys\bin\mdccommon.dll"
-"\EPOC32\RELEASE\ARMV5\UREL\mdsserver.exe" -"!:\sys\bin\mdsserver.exe"
\ No newline at end of file
+"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"!:\sys\bin\!mdsserver.exe"
\ No newline at end of file
--- a/metadataengine/server/group/mdsserver.mmp	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/group/mdsserver.mmp	Tue May 11 16:36:55 2010 +0300
@@ -19,7 +19,7 @@
 #include <data_caging_paths.hrh>
 
 VERSION           10.0
-TARGET            mdsserver.exe
+TARGET            !mdsserver.exe
 TARGETTYPE        exe
 UID               0x0 0x200009F3
 TARGETPATH	      SHARED_LIB_DIR
@@ -31,13 +31,13 @@
 EPOCHEAPSIZE      0x8000 0x400000 
 #endif
 
-CAPABILITY        CAP_SERVER AllFiles
+CAPABILITY        CAP_SERVER ProtServ
 VENDORID        	VID_DEFAULT
 
 MACRO             LOG_MASTER_FLAG
 //MACRO             LOG_QUERY
-MACRO          	  LOG_DB
-// MACRO          LOG_MUTEX
+//MACRO             LOG_DB
+//MACRO             LOG_MUTEX
 MACRO             LOG_SERVER
 
 SYSTEMINCLUDE     /epoc32/include/ecom
--- a/metadataengine/server/inc/mdslogger.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/inc/mdslogger.h	Tue May 11 16:36:55 2010 +0300
@@ -57,10 +57,6 @@
 _LIT(KFilename, "server.txt");
 _LIT(KAltFilename, "server2.txt");
 
-#ifdef LOG_QUERY
-#define MDE_FILE_LOGGING
-#endif
-
 // CLASS DECLARATION
 /**
 * CMdSLogger.
--- a/metadataengine/server/inc/mdsmanipulationengine.h	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/inc/mdsmanipulationengine.h	Tue May 11 16:36:55 2010 +0300
@@ -32,7 +32,7 @@
 class CMdSSqlObjectManipulate;
 
 // CONSTANT DECLARATION
-const TInt KGarbageCollectionDelay = 60; // test 1 minute
+const TInt KGarbageCollectionDelay = 60; // 1 minute
 
 // CLASS DECLARATION
 
--- a/metadataengine/server/src/mdsfindsqlclause.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/src/mdsfindsqlclause.cpp	Tue May 11 16:36:55 2010 +0300
@@ -659,7 +659,7 @@
 	iQueryBuf->AppendL( KAsBaseObject );
 
 	// if object definitions is BaseObject
-	if( KBaseObjectDefId != iSourceObjectDef->GetId() )
+	if( iSourceObjectDef && KBaseObjectDefId != iSourceObjectDef->GetId() )
 		{
 		// "," + object def's table + namespace def id + " AS O ON BO.ObjectId=O.ObjectId "
         iQueryBuf->AppendL( KComma );
@@ -1314,6 +1314,26 @@
 			iQueryBuf->AppendL( KObjectUriBeginsWith );			
 			}
 			break;
+		 case EObjectConditionCompareUriContains:
+            {
+            TPtrC16 uriPtr = iSerializedBuffer->ReceivePtr16L();
+
+            HBufC16* pattern = HBufC16::NewLC( uriPtr.Length() + 2 );  // prepare for %uri%
+
+            TPtr16 modPattern = pattern->Des();
+
+            // add wildcard before and after URI "%uri%"
+            modPattern.Append( KWildcard );
+            modPattern.Append( uriPtr );
+            modPattern.Append( KWildcard );
+
+            iVariables.AppendL( TColumn( pattern ) );
+
+            CleanupStack::Pop( pattern );
+
+            iQueryBuf->AppendL( KObjectUriBeginsWith );         
+            }
+            break;
 		case EObjectConditionCompareFreeText:
 			{
 			TPtrC16 freetextPtr = iSerializedBuffer->ReceivePtr16L();
@@ -1538,7 +1558,7 @@
 	// (not multi object query or (multi object query and WHERE to search from 
 	// doesn't match with WHAT to search))
 	if( KBaseObjectDefId != objectDefId && ( !iSourceObjectDefs || 
-			( iSourceObjectDefs && iObjectDef != iSourceObjectDef ) ) )
+			( iSourceObjectDefs && iSourceObjectDef && iObjectDef != iSourceObjectDef ) ) )
 		{
 		objectDefId = iSourceObjectDef->GetId();
 		}
@@ -1576,7 +1596,7 @@
 TDefId CMdSFindSqlClause::ObjectDefForPropertyCondition(TDefId aObjectDefId)
 	{
 	// if object def is not base object def
-	if( KBaseObjectDefId != aObjectDefId )
+	if( iSourceObjectDef && KBaseObjectDefId != aObjectDefId )
 		{
 		const CMdsObjectDef* parent = iSourceObjectDef->GetParent();
 
--- a/metadataengine/server/src/mdsserver.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/src/mdsserver.cpp	Tue May 11 16:36:55 2010 +0300
@@ -354,6 +354,10 @@
     __INIT_LOGGER;
     StartL( KMdSServerName );
     __LOGLB( ELogAlways, "Server start" );
+
+    RProcess process;
+    process.SetPriority( EPriorityBackground );
+    process.Close();
     
     CheckInitSriptL();
     
--- a/metadataengine/server/src/mdssqliteconnection.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/server/src/mdssqliteconnection.cpp	Tue May 11 16:36:55 2010 +0300
@@ -75,14 +75,22 @@
 
 void CMdSSqLiteConnection::OpenDbL( const TDesC& aDbFileName )
     {
-    _LIT8( KMdsSqlDbaConfig, "cache_size=10000; page_size=4096; encoding=\"UTF-16\";");
-
-    TInt err = KErrNone;
+    _LIT8( KMdsSqlDbaConfig, "cache_size=8000; page_size=2048; encoding=\"UTF-16\";");
+    _LIT8( KBlacklistSqlDbaConfig, "cache_size=4000; page_size=1024; encoding=\"UTF-16\";");
 
     delete iDbFileName;
     iDbFileName = NULL; // in case AllocL leaves
     iDbFileName = aDbFileName.AllocL();
 
+    TBool setupForMdsServer( EFalse );
+    // Check if it is MDS server DB that is accessed, otherwise setup will be for Blacklist Server
+    if( iDbFileName->Des().FindF( KMdsSqlDbDefaultName ) != KErrNotFound )
+        {
+        setupForMdsServer = ETrue;
+        }
+    
+    TInt err = KErrNone;
+    
     // we need to set up policy, because we use secure database
 	TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysPass);
     RSqlSecurityPolicy sqlSecurityPolicy;
@@ -99,7 +107,14 @@
      *   First we try to open db. If this fails because db not creater yer, then
      *   try to create it. Otherwise we cannot open it and we leave
      */
-    err = iMdeSqlDb.Open( *iDbFileName, &KMdsSqlDbaConfig );
+    if( setupForMdsServer )
+        {
+        err = iMdeSqlDb.Open( *iDbFileName, &KMdsSqlDbaConfig );
+        }
+    else
+        {
+        err = iMdeSqlDb.Open( *iDbFileName, &KBlacklistSqlDbaConfig );
+        }
     if ( err != KErrNone )
         {
         __LOG1( ELogDb, "Cannot open database %d", err );
@@ -107,7 +122,14 @@
         if( err == KErrNotFound )
             {
             __LOG1( ELogDb, "Cannot find database %d", err );
-            err = iMdeSqlDb.Create( *iDbFileName, sqlSecurityPolicy, &KMdsSqlDbaConfig );
+            if( setupForMdsServer )
+                {
+                err = iMdeSqlDb.Create( *iDbFileName, sqlSecurityPolicy, &KMdsSqlDbaConfig );
+                }
+            else
+                {
+                err = iMdeSqlDb.Create( *iDbFileName, sqlSecurityPolicy, &KBlacklistSqlDbaConfig );
+                }
             if( err != KErrNone )
                 {
                 __LOG1( ELogDb, "Unknown error while creating %d", err );
@@ -118,11 +140,25 @@
                 err == KSqlErrCorrupt )
             {
             __LOGLB( ELogDb, "Warning: Database is corrupted, will delete and re-create it." );
-            err = DeleteAndReCreateDB( iDbFileName, sqlSecurityPolicy, &KMdsSqlDbaConfig );
+            if( setupForMdsServer )
+                {
+                err = DeleteAndReCreateDB( iDbFileName, sqlSecurityPolicy, &KMdsSqlDbaConfig );
+                }
+            else
+                {
+                err = DeleteAndReCreateDB( iDbFileName, sqlSecurityPolicy, &KBlacklistSqlDbaConfig );
+                }
         
             if ( KErrNone == err  )
                 {
-                err = iMdeSqlDb.Open( *iDbFileName, &KMdsSqlDbaConfig );
+                if( setupForMdsServer )
+                    {
+                    err = iMdeSqlDb.Open( *iDbFileName, &KMdsSqlDbaConfig );
+                    }
+                else
+                    {
+                    err = iMdeSqlDb.Open( *iDbFileName, &KBlacklistSqlDbaConfig );
+                    }
                 if ( err != KErrNone )
                     {
                     __LOG1( ELogDb, "Cannot open database again after delete and re-create %d", err );
--- a/metadataengine/sis/package.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/metadataengine/sis/package.pkg	Tue May 11 16:36:55 2010 +0300
@@ -28,4 +28,4 @@
 ;Files
 "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll"
 "\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"c:\sys\bin\mdccommon.dll"
-"\EPOC32\RELEASE\ARMV5\UREL\mdsserver.exe" -"c:\sys\bin\mdsserver.exe"
\ No newline at end of file
+"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"c:\sys\bin\!mdsserver.exe"
\ No newline at end of file
--- a/rom/mds.iby	Tue Apr 27 17:05:23 2010 +0300
+++ b/rom/mds.iby	Tue May 11 16:36:55 2010 +0300
@@ -27,7 +27,7 @@
 rem - MdE binaries
 file=ABI_DIR\BUILD_DIR\mdeclient.dll		SHARED_LIB_DIR\mdeclient.dll
 file=ABI_DIR\BUILD_DIR\mdccommon.dll		SHARED_LIB_DIR\mdccommon.dll
-file=ABI_DIR\BUILD_DIR\mdsserver.exe		PROGRAMS_DIR\mdsserver.exe
+file=ABI_DIR\BUILD_DIR\!mdsserver.exe		PROGRAMS_DIR\!mdsserver.exe
 
 rem - MdE data files
 data=EPOCROOT##epoc32\data\z\Private\200009F3\schema.mde                PRIVATE\200009F3\schema.mde
@@ -52,7 +52,7 @@
 ECOM_PLUGIN(harvesteraudioplugin.dll,harvesteraudioplugin.rsc)
 
 rem - Blacklist server binaries
-file=ABI_DIR\BUILD_DIR\blacklistserver.exe		        PROGRAMS_DIR\blacklistserver.exe
+file=ABI_DIR\BUILD_DIR\!blacklistserver.exe		        PROGRAMS_DIR\!blacklistserver.exe
 file=ABI_DIR\BUILD_DIR\blacklistclient.dll		        SHARED_LIB_DIR\blacklistclient.dll
 
 file=ABI_DIR\BUILD_DIR\MonitorPluginInterface.dll		SHARED_LIB_DIR\MonitorPluginInterface.dll
Binary file sis/mds/mds_stub.sis has changed
--- a/sis/mds/package.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/sis/mds/package.pkg	Tue May 11 16:36:55 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 13, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 15, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
@@ -46,7 +46,7 @@
 "\EPOC32\RELEASE\ARMV5\UREL\ContentListingFramework.dll" -"c:\sys\bin\ContentListingFramework.dll"
 
 ; blacklist 
-"\EPOC32\RELEASE\ARMV5\UREL\blacklistserver.exe" -"c:\sys\bin\blacklistserver.exe"
+"\EPOC32\RELEASE\ARMV5\UREL\!blacklistserver.exe" -"c:\sys\bin\!blacklistserver.exe"
 "\EPOC32\RELEASE\ARMV5\UREL\blacklistclient.dll" -"c:\sys\bin\blacklistclient.dll"
 
 ; composer plugins
@@ -97,7 +97,7 @@
 ; metadata engine
 "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll"
 "\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"c:\sys\bin\mdccommon.dll"
-"\EPOC32\RELEASE\ARMV5\UREL\mdsserver.exe" -"c:\sys\bin\mdsserver.exe"
+"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"c:\sys\bin\!mdsserver.exe"
 
 "\epoc32\release\armv5\udeb\mdswatchdog.exe"-"c:\sys\bin\mdswatchdog.exe"
 
--- a/sis/mds/package_separate.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/sis/mds/package_separate.pkg	Tue May 11 16:36:55 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 13, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 15, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/stub.pkg	Tue Apr 27 17:05:23 2010 +0300
+++ b/sis/mds/stub.pkg	Tue May 11 16:36:55 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"Metadata System"}, (0x200009F5), 9, 20, 13, TYPE=SA
+#{"Metadata System"}, (0x200009F5), 9, 20, 15, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/watchdog/src/watchdog.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/watchdog/src/watchdog.cpp	Tue May 11 16:36:55 2010 +0300
@@ -51,7 +51,7 @@
 // ---------------------------------------------------------------------------
 //
 CWatchdog::CWatchdog() : 
-    CActive( CActive::EPriorityLow ), iState(EIdle)
+    CActive( CActive::EPriorityStandard ), iState(EIdle)
     {
     // Add to active scheduler.
     CActiveScheduler::Add( this );