--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Tue Jul 06 14:48:59 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Wed Aug 18 10:16:02 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
{