diff -r b034b1c214c2 -r e42293e811d8 mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Thu Jul 15 19:11:42 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Thu Aug 19 10:24:28 2010 +0300 @@ -26,6 +26,7 @@ #include "mmmtpdputility.h" const TInt KMaxDeletionTimes = 10; +const TInt KMaxDeviceBusyTimes = 3; const TInt KDeletionThreshold = 100 * 1000; // (100 millisec) // ----------------------------------------------------------------------------- @@ -294,6 +295,25 @@ } // ----------------------------------------------------------------------------- +// CDeleteObject::DoHandleCompletingPhaseL +// Completeing phase Handler +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CDeleteObject::DoHandleCompletingPhaseL() + { + CRequestProcessor::DoHandleCompletingPhaseL(); + + // If the response code is EMTPRespCodeDeviceBusy, don't release this object + TBool result = !iDeviceBusy; + + PRINT2( _L( "MM MTP <> CDeleteObject::DoHandleCompletingPhaseL iDeleteError= %d, result = %d" ), + iDeleteError, + result ); + + return result; + } + +// ----------------------------------------------------------------------------- // CDeleteObject::ProcessFinalPhaseL // Delete all of the associations if file deletion was successful // Then signals that the deletion has been completed @@ -305,6 +325,7 @@ TInt num = iObjectsToDelete.Count(); TBool isOk = iDeleteError == KErrNone || iDeleteError == KErrNotFound; + iDeviceBusy = EFalse; if ( num == 0 && isOk ) { @@ -315,12 +336,15 @@ SendResponseL( EMTPRespCodePartialDeletion ); } else if ( !iIsMultiDelete && iDeleteError == KErrAccessDenied ) - { + { SendResponseL( EMTPRespCodeObjectWriteProtected ); } - else if ( iDeleteError == KErrInUse ) + else if ( iDeleteError == KErrInUse + && iCountDeviceBusyError < KMaxDeviceBusyTimes ) { + iCountDeviceBusyError++; SendResponseL( EMTPRespCodeDeviceBusy ); + iDeviceBusy = ETrue; } else {