# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277307679 -10800 # Node ID f727727520eb0ba1848ae83dbaf749ce3070bc69 # Parent 81125601ee7787136124928e8b469dc90da8603f Revision: 201023 Kit: 2010125 diff -r 81125601ee77 -r f727727520eb harvester/common/inc/harvestermediaidutil.h --- a/harvester/common/inc/harvestermediaidutil.h Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/common/inc/harvestermediaidutil.h Wed Jun 23 18:41:19 2010 +0300 @@ -19,6 +19,7 @@ #include #include +#include const TInt KHarvesterMediaIdTLSKey = 0x200009FE; diff -r 81125601ee77 -r f727727520eb harvester/common/src/harvestereventmanager.cpp --- a/harvester/common/src/harvestereventmanager.cpp Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/common/src/harvestereventmanager.cpp Wed Jun 23 18:41:19 2010 +0300 @@ -340,8 +340,6 @@ iRegisteredObservers.AppendL( observerInfo ); - CleanupStack::Pop( observerInfo ); - // send event if register is coming in the middle of harvesting for( TInt i = iEventStatuses.Count(); --i >= 0; ) { @@ -349,13 +347,31 @@ if( CheckObserverType( observerInfo->iObserverType, eventStatus.iObserverType) ) { - if( eventStatus.iItemsLeft > 0 ) - { - TRAP_IGNORE( SendEventL( eventStatus.iObserverType, - eventStatus.iCurrentState, eventStatus.iItemsLeft ) ); - } + TRAP_IGNORE( SendEventL( eventStatus.iObserverType, + eventStatus.iCurrentState, eventStatus.iItemsLeft ) ); } } + + //no events in queue, signal registered client anyways + if( !iEventStatuses.Count() ) + { + if(observerInfo->iObserverType & EHEObserverTypeOverall) + { + SendSingleEvent(*observerInfo, EHEObserverTypeOverall, EHEStateUninitialized, 0); + } + + if(observerInfo->iObserverType & EHEObserverTypeMMC) + { + SendSingleEvent(*observerInfo, EHEObserverTypeMMC, EHEStateUninitialized, 0); + } + + if(observerInfo->iObserverType & EHEObserverTypePlaceholder) + { + SendSingleEvent(*observerInfo, EHEObserverTypePlaceholder, EHEStateUninitialized, 0); + } + } + + CleanupStack::Pop( observerInfo ); } EXPORT_C TInt CHarvesterEventManager::UnregisterEventObserver( const RMessage2& aMessage ) diff -r 81125601ee77 -r f727727520eb harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h --- a/harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h Wed Jun 23 18:41:19 2010 +0300 @@ -32,7 +32,7 @@ * CMdSOomPlugin * */ -class CMdSOomPlugin : public COomMonitorPlugin +class CMdSOomPlugin : public COomMonitorPluginV2 { public: // Constructors and destructor @@ -48,9 +48,8 @@ * From COomMonitorPlugin v2 * FreeRam is called when the system RAM level becomes * low. This plugin is requested to help free some RAM. - * Paramater reserved for v2 plugin */ - void FreeRam( /*TInt aBytesToFree*/ ); + void FreeRam( TInt aBytesToFree ); /** * From COomMonitorPlugin v2 diff -r 81125601ee77 -r f727727520eb harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp --- a/harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp Wed Jun 23 18:41:19 2010 +0300 @@ -49,7 +49,7 @@ } -void CMdSOomPlugin::FreeRam( /*TInt aBytesToFree*/ ) +void CMdSOomPlugin::FreeRam( TInt /*aBytesToFree*/ ) { WRITELOG("CMdSOomPlugin::FreeRam() - start"); diff -r 81125601ee77 -r f727727520eb harvester/server/inc/harvesterao.h --- a/harvester/server/inc/harvesterao.h Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/server/inc/harvesterao.h Wed Jun 23 18:41:19 2010 +0300 @@ -115,8 +115,6 @@ ERequestContainerPlaceholder }; - - /** * Constructs a new harvesting thread * @@ -302,6 +300,8 @@ void MemoryGood(); void RemoveBlacklistedFile( CHarvesterData* aItem ); + + CHarvesterAO::TRequest GetHarvesterAORunState(); private: @@ -585,6 +585,7 @@ HBufC* iMmcSoundsPath; TBool iUnmountDetected; + TBool iPriorityInterruptDetected; }; #endif //__CHARVESTERAO_H__ diff -r 81125601ee77 -r f727727520eb harvester/server/src/harvesterao.cpp --- a/harvester/server/src/harvesterao.cpp Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/server/src/harvesterao.cpp Wed Jun 23 18:41:19 2010 +0300 @@ -145,6 +145,7 @@ iHarvestingPlaceholders = EFalse; iUnmountDetected = EFalse; + iPriorityInterruptDetected = EFalse; } // --------------------------------------------------------------------------- @@ -913,6 +914,30 @@ CleanupStack::PopAndDestroy( &mdeObjectArray ); return; } + // Check for priority interrupt + // If priority interrupt occures, drop current operation to handle the priority item first, + // and continue from current situation after that + else if( iPriorityInterruptDetected ) + { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Priority interrupt during execution!" ); + const TInt currentPHArrayCount( iPHArray.Count() ); + for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- ) + { + CHarvesterData* hd = iTempReadyPHArray[y]; + if( currentPHArrayCount ) + { + // Leave the first item in the array as it is the priority item + iPHArray.Insert( hd, 1 ); + } + else + { + iPHArray.Insert( hd, 0 ); + } + } + iTempReadyPHArray.Reset(); + CleanupStack::PopAndDestroy( &mdeObjectArray ); + return; + } if( objDefStr.Length() == 0 || ( objDefStr == KInUse ) ) @@ -1644,6 +1669,8 @@ // Reset unmount flag, as unmount is handled before RunL is called again after aborted harvesting run iUnmountDetected = EFalse; + // Reset priority flag, as interrupt is handled automatically first when RunL is called again + iPriorityInterruptDetected = EFalse; User::LeaveIfError( iStatus.Int() ); switch( iNextRequest ) @@ -2108,8 +2135,10 @@ { iQueue->Append( hd ); + iPriorityInterruptDetected = ETrue; + // signal to start harvest if harvester idles - if ( !IsServerPaused() ) + if ( !IsServerPaused() && iNextRequest == ERequestIdle ) { SetNextRequest( CHarvesterAO::ERequestHarvest ); } @@ -2286,7 +2315,7 @@ iQueue->Append( hd ); // signal to start harvest if harvester idles - if ( !IsServerPaused() ) + if ( !IsServerPaused() && iNextRequest == ERequestIdle ) { SetNextRequest( CHarvesterAO::ERequestHarvest ); } @@ -3058,3 +3087,9 @@ aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); } } + +CHarvesterAO::TRequest CHarvesterAO::GetHarvesterAORunState() + { + return iNextRequest; + } + diff -r 81125601ee77 -r f727727520eb harvester/server/src/harvesterqueue.cpp --- a/harvester/server/src/harvesterqueue.cpp Fri Jun 11 14:04:21 2010 +0300 +++ b/harvester/server/src/harvesterqueue.cpp Wed Jun 23 18:41:19 2010 +0300 @@ -252,7 +252,7 @@ Append( aHarvesterData ); // signal to start harvest if harvester idles - if ( !iHarvesterAO->IsServerPaused() ) + if ( !iHarvesterAO->IsServerPaused() && iHarvesterAO->GetHarvesterAORunState() == CHarvesterAO::ERequestIdle ) { iHarvesterAO->SetNextRequest( CHarvesterAO::ERequestHarvest ); } diff -r 81125601ee77 -r f727727520eb sis/mds/mds_stub.sis Binary file sis/mds/mds_stub.sis has changed diff -r 81125601ee77 -r f727727520eb sis/mds/package.pkg --- a/sis/mds/package.pkg Fri Jun 11 14:04:21 2010 +0300 +++ b/sis/mds/package.pkg Wed Jun 23 18:41:19 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 8, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r 81125601ee77 -r f727727520eb sis/mds/package_separate.pkg --- a/sis/mds/package_separate.pkg Fri Jun 11 14:04:21 2010 +0300 +++ b/sis/mds/package_separate.pkg Wed Jun 23 18:41:19 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 8, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r 81125601ee77 -r f727727520eb sis/mds/stub.pkg --- a/sis/mds/stub.pkg Fri Jun 11 14:04:21 2010 +0300 +++ b/sis/mds/stub.pkg Wed Jun 23 18:41:19 2010 +0300 @@ -17,7 +17,7 @@ &EN ; Header -#{"Metadata System"}, (0x200009F5), 10, 10, 8, TYPE=SA +#{"Metadata System"}, (0x200009F5), 10, 10, 9, TYPE=SA ; Localised Vendor name %{"Nokia"}