Revision: 201020 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 10:36:33 +0300
branchRCL_3
changeset 13 81da3301b632
parent 12 523717cdb0ad
child 15 f85613f12947
Revision: 201020 Kit: 2010123
backupandrestore/backupengine/inc/sbedataowner.h
backupandrestore/backupengine/inc/sbeparserdefs.h
backupandrestore/backupengine/src/absession.cpp
backupandrestore/backupengine/src/sbedataowner.cpp
connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h
connectivitymodules/SeCon/services/pcd/src/sconmetadata.cpp
connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp
mtpfws/mtpfw/dataproviders/devdp/inc/cmtpdevicedatastore.h
mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedatastore.cpp
mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetdeviceinfo.cpp
mtpfws/mtpfw/dataproviders/dputility/src/cmtpfsenumerator.cpp
mtpfws/mtpfw/src/cmtpdataprovider.cpp
--- a/backupandrestore/backupengine/inc/sbedataowner.h	Tue May 25 13:35:25 2010 +0300
+++ b/backupandrestore/backupengine/inc/sbedataowner.h	Wed Jun 09 10:36:33 2010 +0300
@@ -50,6 +50,8 @@
 	_LIT(KCentRepProcessName, "centralrepositorysrv.exe");
 	_LIT8(KYes, "yes");
 	
+	const TTimeIntervalMicroSeconds32 KABCallbackDefaultTimeout(200000000);
+	
 	// Forwards
 	class CABServer;
 	class CDataOwnerManager;
@@ -196,7 +198,7 @@
 		*/
 		TActiveInformation() :
 			iSupported(EFalse), iRequiresDelayToPrepareData(EFalse),
-			iSupportsSelective(EFalse), iSupportsIncremental(ETrue), iActiveDataOwner(EFalse), iActiveType(EActiveOnly)
+			iSupportsSelective(EFalse), iSupportsIncremental(ETrue), iActiveDataOwner(EFalse), iActiveType(EActiveOnly), iCallbackDelayTime(KABCallbackDefaultTimeout)
 				{
 				}
 	public:
@@ -207,6 +209,7 @@
 		TUint8	iSupportsIncremental; /*<! Supports Incremental */
 		TUint8	iActiveDataOwner; /*<! Although we say we're active, we're not really */
 		TActiveType	iActiveType; /*<! Type of the Active DO */
+		TTimeIntervalMicroSeconds32  iCallbackDelayTime; /*<! Callback Delay Time */
 		};
 		
 	/** Data Owner support classes and enums */
--- a/backupandrestore/backupengine/inc/sbeparserdefs.h	Tue May 25 13:35:25 2010 +0300
+++ b/backupandrestore/backupengine/inc/sbeparserdefs.h	Wed Jun 09 10:36:33 2010 +0300
@@ -67,6 +67,8 @@
 	_LIT8(KRequiresReboot, "requires_reboot");
 	_LIT8(KDeleteBeforeRestore, "delete_before_restore");
 	_LIT8(KBaseBackupOnly, "base_backup_only");
+	
+	_LIT8(KCallbackDelayTime, "callback_delay_time");
 
 	}
 #endif // __SBEPARSERDEFS_H__
--- a/backupandrestore/backupengine/src/absession.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/backupandrestore/backupengine/src/absession.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -425,9 +425,10 @@
 		iCallbackWatchdog = NULL;
 		iCallbackWatchdog = CPeriodic::NewL(EPriorityHigh);
 		TTimeIntervalMicroSeconds32 KWatchdogIntervalNone = 0;
-		iCallbackWatchdog->Start(KABCallbackWatchdogTimeout, KWatchdogIntervalNone, iWatchdogHandler);
+		iCallbackWatchdog->Start(DataOwnerL().ActiveInformation().iCallbackDelayTime, KWatchdogIntervalNone, iWatchdogHandler);
 		#endif
-
+		
+		
 		// Send the message back to the callback handler
 		iMessage.Complete(KErrNone);
 		
--- a/backupandrestore/backupengine/src/sbedataowner.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/backupandrestore/backupengine/src/sbedataowner.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -3553,6 +3553,17 @@
 					iActiveInformation.iActiveType = EProxyImpOnly;
 					}
 				}
+			else if(!localName.CompareF(KCallbackDelayTime))
+				{
+				const TDesC8& value = aAttributes[x].Value().DesC();
+				TInt timeValue = 0;
+				TLex8 lex(value);
+				TInt err = lex.Val(timeValue);
+				if( err == KErrNone && timeValue > 0)
+					iActiveInformation.iCallbackDelayTime = TTimeIntervalMicroSeconds32(timeValue);
+				else
+					iActiveInformation.iCallbackDelayTime = KABCallbackDefaultTimeout;
+				}
 			} // for x
 		
 		return KErrNone;
--- a/connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h	Tue May 25 13:35:25 2010 +0300
+++ b/connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h	Wed Jun 09 10:36:33 2010 +0300
@@ -159,6 +159,7 @@
     TBool iVideoClipReady;
     TInt iVideoUtilErr;
     TInt iVideoClipErr;
+    TBool iAsyncStopCalled;
 };
 
 #endif // SCONVIDEOPARSER_H
--- a/connectivitymodules/SeCon/services/pcd/src/sconmetadata.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/connectivitymodules/SeCon/services/pcd/src/sconmetadata.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -568,7 +568,7 @@
     CleanupStack::PopAndDestroy( &file );
     
     CleanupStack::PushL( readBuffer );
-    
+    TRACE_FUNC_EXIT;
     return readBuffer;
 	}
 
@@ -1023,19 +1023,21 @@
 		denom = 0;
 		Mem::Copy(&numer, ratData + ((y * 2) * sizeof(numer)), sizeof(numer));
 		Mem::Copy(&denom, ratData + (((y * 2) + 1) * sizeof(numer)), sizeof(denom));	
-		
-		if ( y == 0 )// degrees
-			{
-			degrees = numer/denom;
-			}
-		else if ( y == 1 )// minutes
-			{
-			minutes = numer/denom;
-			}
-		else if ( y == 2 )// seconds
-			{
-			seconds = numer/denom;
-			}
+		if (denom != 0)
+		    {
+            if ( y == 0 )// degrees
+                {
+                degrees = numer/denom;
+                }
+            else if ( y == 1 )// minutes
+                {
+                minutes = numer/denom;
+                }
+            else if ( y == 2 )// seconds
+                {
+                seconds = numer/denom;
+                }
+		    }
 		}
 	_LIT(KFormat, "%.0f°%.0f'%.2f\"" );
 	aPosDegrees.Format( KFormat, degrees, minutes, seconds );
--- a/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -27,7 +27,7 @@
 _LIT( KMimeTypeAudio, "audio/*" );
 _LIT( KMimeTypeVideo, "video/*" );
 
-const TInt KVideoClipTimeout( 10000000 ); // 10 sec.
+const TInt KRequestTimeOut( 20000000 ); // 20 sec.
 
 // -----------------------------------------------------------------------------
 // CSConVideoParser::CSConVideoParser()
@@ -150,11 +150,13 @@
         {
         User::Leave( KErrNotFound );
         }
-    
+    iAsyncStopCalled = EFalse;
     iVideoClip = CTNEVideoClipInfo::NewL( aFileName, *this );
     
     iVideoUtil->OpenFileL( aFileName );
     
+    LOGGER_WRITE("Start timeout");
+    iTimeOut->Start( KRequestTimeOut );
     
     LOGGER_WRITE("iWait.Start()");
     iWait.Start();
@@ -353,6 +355,12 @@
 void CSConVideoParser::MvpuoOpenComplete( TInt aError )
     {
     TRACE_FUNC_ENTRY;
+    if ( iVideoUtilReady )
+        {
+        // already timeout
+        LOGGER_WRITE("Already timeout");
+        return;
+        }
     LOGGER_WRITE_1( "aError: %d", aError );
     if ( aError == KErrNone )
         {
@@ -364,8 +372,10 @@
         iVideoUtilErr = aError;
         }
     
-    if ( iVideoUtilReady && iVideoClipReady )
+    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
         {
+        iAsyncStopCalled = ETrue;
+        iTimeOut->Cancel();
         LOGGER_WRITE("AsyncStop");
         iWait.AsyncStop();
         }
@@ -380,13 +390,21 @@
 void CSConVideoParser::MvpuoPrepareComplete( TInt aError )
     {
     TRACE_FUNC_ENTRY;
+    if ( iVideoUtilReady )
+        {
+        // already timeout
+        LOGGER_WRITE("Already timeout");
+        return;
+        }
     LOGGER_WRITE_1( "aError: %d", aError );
     
     iVideoUtilReady = ETrue;
     iVideoUtilErr = aError;
     
-    if ( iVideoUtilReady && iVideoClipReady )
+    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
         {
+        iAsyncStopCalled = ETrue;
+        iTimeOut->Cancel();
         LOGGER_WRITE("AsyncStop");
         iWait.AsyncStop();
         }
@@ -428,6 +446,12 @@
 void CSConVideoParser::NotifyVideoClipInfoReady(CTNEVideoClipInfo& aInfo, TInt aError)
     {
     TRACE_FUNC_ENTRY;
+    if ( iVideoClipReady )
+        {
+        // already timeout
+        LOGGER_WRITE("Already timeout");
+        return;
+        }
     LOGGER_WRITE_1("aError: %d", aError);
     if ( aError == KErrNone )
         {
@@ -440,11 +464,6 @@
             iVideoClipReady = ETrue;
             iVideoClipErr = err;
             }
-        else
-            {
-            LOGGER_WRITE("Start timeout");
-            iTimeOut->Start( KVideoClipTimeout );
-            }
         }
     else
         {
@@ -452,8 +471,10 @@
         iVideoClipErr = aError;
         }
     
-    if ( iVideoUtilReady && iVideoClipReady )
+    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
         {
+        iAsyncStopCalled = ETrue;
+        iTimeOut->Cancel();
         LOGGER_WRITE("AsyncStop");
         iWait.AsyncStop();
         }
@@ -470,8 +491,14 @@
         CFbsBitmap* aThumb)
     {
     TRACE_FUNC_ENTRY;
+    if ( iVideoClipReady )
+        {
+        // already timeout
+        LOGGER_WRITE("Already timeout");
+        delete aThumb;
+        return;
+        }
     LOGGER_WRITE_1("aError: %d", aError);
-    iTimeOut->Cancel();
     if ( aError == KErrNone)
         {
         delete iThumbnail;
@@ -497,8 +524,10 @@
     iVideoClipReady = ETrue;
     iVideoClipErr = aError;
     
-    if ( iVideoUtilReady && iVideoClipReady )
+    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
         {
+        iAsyncStopCalled = ETrue;
+        iTimeOut->Cancel();
         LOGGER_WRITE("AsyncStop");
         iWait.AsyncStop();
         }
@@ -522,9 +551,17 @@
         iVideoClipErr = KErrCancel;
         }
     
-    if ( iVideoUtilReady && iVideoClipReady )
+    if ( !iVideoUtilReady )
+        {
+        LOGGER_WRITE("videoUtil cancelled");
+        iVideoUtilReady = ETrue;
+        iVideoUtilErr = KErrCancel;
+        }
+    
+    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
         {
         LOGGER_WRITE("AsyncStop");
+        iAsyncStopCalled = ETrue;
         iWait.AsyncStop();
         }
     TRACE_FUNC_EXIT;
--- a/mtpfws/mtpfw/dataproviders/devdp/inc/cmtpdevicedatastore.h	Tue May 25 13:35:25 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/devdp/inc/cmtpdevicedatastore.h	Wed Jun 09 10:36:33 2010 +0300
@@ -88,6 +88,9 @@
 
     TBool IsConnectMac();
     void SetConnectMac(TBool aConnectMac);	
+    
+    TBool Enumerated() const;
+    void RegisterPendingRequest();
 	
 private: // Form CActive
 
@@ -101,7 +104,6 @@
     CMTPDeviceDataStore();
     void ConstructL();
 
-    TBool Enumerated() const;
     void ExternalizeL(RWriteStream& aWriteStream) const;
     void InternalizeL(RReadStream& aReadStream);
     const TDesC& PropertyStoreName();
@@ -163,6 +165,7 @@
     CMTPTypeArray*                                   iSupportedDevProArray;
     TUint8			iFormatOreder; 
     
+    
 private: // Not owned.
 
     MMTPEnumerationCallback* 	    iCallback;
@@ -172,6 +175,7 @@
     MExtnDevicePropDp*              iExtnDevicePropDp;
 
     TBool                           iIsConnectMac; 
+    TBool                           iHasPendingRequest;    
     };
    
 #endif // CMTPDEVICEDATASTORE_H
--- a/mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedatastore.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedatastore.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -438,6 +438,7 @@
     	if (isCompleted)
     		{
     		Schedule(EEnumerated);
+
     		}
     	else
     		{
@@ -453,12 +454,20 @@
         break;
 
     case EEnumerated:
+        {
+        if (iHasPendingRequest)
+            {
+            iHasPendingRequest = EFalse;
+            iSingletons.DpController().ExecutePendingRequestL();
+            }
+        
         if (iCallback)
             {
             iCallback->NotifyEnumerationCompleteL(iStorageId, KErrNone);
             iCallback = NULL;
             iStorageId = KMTPNotSpecified32;
             }
+        }
         break;
 
 case EEnumeratedBatteryLevel :
@@ -483,7 +492,8 @@
     CActive(EPriorityStandard),
 	iBatteryInfoV1Pckg(iBatteryInfoV1),
 	iPhoneIdV1Pckg(iPhoneIdV1),
-	iIsConnectMac(EFalse)
+	iIsConnectMac(EFalse),
+	iHasPendingRequest(EFalse)
     {
     CActiveScheduler::Add(this);
     }
@@ -1235,3 +1245,10 @@
     {
     iIsConnectMac = aConnectMac;
     }
+
+void CMTPDeviceDataStore::RegisterPendingRequest()
+    {
+    iHasPendingRequest = ETrue;
+    }
+
+
--- a/mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetdeviceinfo.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetdeviceinfo.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -101,6 +101,15 @@
 void CMTPGetDeviceInfo::ServiceL()
     {
     __FLOG(_L8("ServiceL - Entry"));
+    
+    if (!iDpSingletons.DeviceDataStore().Enumerated())
+        {
+        __FLOG(_L8("MTPExtensionReady not ready, reschedule request")); 
+        iDpSingletons.DeviceDataStore().RegisterPendingRequest();
+        RegisterPendingRequest();
+        return;
+        }
+    
     BuildDeviceInfoL();
     SendDataL(*iDeviceInfo);
     __FLOG(_L8("ServiceL - Exit"));
--- a/mtpfws/mtpfw/dataproviders/dputility/src/cmtpfsenumerator.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/dputility/src/cmtpfsenumerator.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -455,7 +455,15 @@
     for (TInt i = (iFirstUnprocessed - count); i < iFirstUnprocessed; ++i)
         {
         const TEntry& entry = iEntries[i];
+        TInt len = entry.iName.Length();
+        if(iCurrentPath.Length()  + len > KMaxFileName)
+            {
+            __FLOG_VA(_L8("Full name exceeds KMaxFileName, ignored."));
+            continue;
+            }
+        
         iCurrentPath.Append(entry.iName);
+
         __FLOG_VA((_L("Process path %S name %S"), &iCurrentPath, &entry.iName));
 #ifdef __FLOG_ACTIVE    
         TBuf8<KMTPMaxFullFileName> tmp;
@@ -478,15 +486,6 @@
             }
 #endif // __FLOG_ACTIVE
 
-        TInt len = entry.iName.Length();
-        TInt totalLen = iCurrentPath.Length();
-        if(totalLen > KMaxFileName)
-            {
-            // Remove filename part
-            iCurrentPath.SetLength(totalLen - len);
-            __FLOG_VA(_L8("Full name exceeds KMaxFileName, ignored."));
-            continue;
-            }
         TUint32 handle = 0;
         TMTPFormatCode format;
         if(-- iObjectNeedToScan <=0 && iAllRootScaned)
--- a/mtpfws/mtpfw/src/cmtpdataprovider.cpp	Tue May 25 13:35:25 2010 +0300
+++ b/mtpfws/mtpfw/src/cmtpdataprovider.cpp	Wed Jun 09 10:36:33 2010 +0300
@@ -556,7 +556,10 @@
         }
     else
         {
-        iCurrentTransactionPhase = iCurrentConnection->TransactionPhaseL(iCurrentRequest->Uint32(TMTPTypeRequest::ERequestSessionID));        
+        if (iCurrentRequest != NULL)
+            {
+            iCurrentTransactionPhase = iCurrentConnection->TransactionPhaseL(iCurrentRequest->Uint32(TMTPTypeRequest::ERequestSessionID));
+            }
         }
     __FLOG_VA((_L8("Current transaction phase = 0x%08X"), iCurrentTransactionPhase));