Revision: 201004 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 16:49:36 +0300
branchRCL_3
changeset 5 3673b591050c
parent 4 60a94a45d437
child 6 ef55b168cedb
Revision: 201004 Kit: 201015
mtpdataproviders/mtpimagedp/inc/cmtpimagedp.h
mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp
mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectproplist.cpp
mtpdataproviders/mtpimagedp/src/cmtpimagedpthumbnailcreator.cpp
mtpfws/mtpfw/daemon/server/src/cmtpserversession.cpp
mtpfws/mtpfw/dataproviders/dputility/src/cmtpsetobjectprotection.cpp
mtpfws/mtpfw/src/cmtpobjectstore.cpp
--- a/mtpdataproviders/mtpimagedp/inc/cmtpimagedp.h	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/inc/cmtpimagedp.h	Wed Apr 14 16:49:36 2010 +0300
@@ -137,6 +137,7 @@
     TInt                    iActiveProcessor;
     TBool                   iActiveProcessorRemoved;    
     TBool                   iEnumerated;
+    TBool                   iEnumerationNotified;
 	
 	RPointerArray<HBufC>    iDeleteObjectsArray;
     };
--- a/mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -128,6 +128,7 @@
         User::LeaveIfError(error);
         }    
     
+    iEnumerationNotified = ETrue;
     __FLOG(_L8("<< CMTPImageDataProvider::ConstructL"));
     }
 
@@ -271,6 +272,8 @@
     __FLOG(_L8(">> StartObjectEnumerationL"));
     
     TBool isComplete = ETrue;
+    iEnumerationNotified = EFalse;
+
     if (aStorageId == KMTPStorageAll)
         {
         /*
@@ -479,7 +482,11 @@
     __FLOG(_L8(">> NotifyEnumerationCompletedL"));
     __FLOG_VA((_L8("Enumeration of storage 0x%08X completed with error status %d"), aStorageId, aError));
         
-    Framework().ObjectEnumerationCompleteL(aStorageId);
+    if (!iEnumerationNotified)
+        {
+        iEnumerationNotified = ETrue;
+        Framework().ObjectEnumerationCompleteL(aStorageId);
+        }
     
     __FLOG(_L8("<< HandleEnumerationCompletedL"));
     }
--- a/mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectproplist.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectproplist.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -146,12 +146,7 @@
     TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter3);
     if (propCode == 0)
         {
-            TUint32 groupCode = Request().Uint32(TMTPTypeRequest::ERequestParameter4);
-            if(groupCode != KMTPImageDpPropertyGroupOneNumber)
-            {
-            //Only supported group one
-            response = EMTPRespCodeSpecificationByGroupUnsupported;
-            }
+            /*Do nothing */
         }
     else if (propCode != KMaxTUint)
         {
@@ -309,15 +304,18 @@
 void CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL(TUint32 aHandle,TUint16 /*aGroupCode*/)
     {
     __FLOG(_L8(">> CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL"));
-    
-    if (iFramework.ObjectMgr().ObjectOwnerId(aHandle) == iFramework.DataProviderId())
+    TUint32 groupCode = Request().Uint32(TMTPTypeRequest::ERequestParameter4);
+    if (KMTPImageDpPropertyGroupOneNumber == groupCode) //only return data for group one
         {
-        for (TUint propCodeIndex(0); propCodeIndex < KMTPImageDpGroupOneSize; propCodeIndex++)
+        if (iFramework.ObjectMgr().ObjectOwnerId(aHandle) == iFramework.DataProviderId())
             {
-            TUint16 propCode = KMTPImageDpGroupOneProperties[propCodeIndex];  
-            if(propCode != 0)
+            for (TUint propCodeIndex(0); propCodeIndex < KMTPImageDpGroupOneSize; propCodeIndex++)
                 {
-                ServiceOneObjectPropertyL(aHandle, propCode);
+                TUint16 propCode = KMTPImageDpGroupOneProperties[propCodeIndex];  
+                if(propCode != 0)
+                    {
+                    ServiceOneObjectPropertyL(aHandle, propCode);
+                    }
                 }
             }
         }
--- a/mtpdataproviders/mtpimagedp/src/cmtpimagedpthumbnailcreator.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedpthumbnailcreator.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -261,10 +261,17 @@
     iObjectSource = NULL;
     
     TParsePtrC parse(aFileName);
-    const TDesC& mimeType = iDataProvider.FindMimeType(parse.Ext().Mid(1));
-    __FLOG_VA((_L16("CMtpImageDphumbnailCreator::GetThumbL() - FileName:%S, MimeType:%S"), &aFileName, &mimeType));
+    if (parse.Ext().Length() >= 1)
+        {
+        const TDesC& mimeType = iDataProvider.FindMimeType(parse.Ext().Mid(1));
+        __FLOG_VA((_L16("CMtpImageDphumbnailCreator::GetThumbL() - FileName:%S, MimeType:%S"), &aFileName, &mimeType));
     
-    iObjectSource = CThumbnailObjectSource::NewL(aFileName, mimeType);
+        iObjectSource = CThumbnailObjectSource::NewL(aFileName, mimeType);
+        }
+    else
+        {
+        iObjectSource = CThumbnailObjectSource::NewL(aFileName, KNullDesC);
+        }
     iCurrentReq = iThumbMgr->GetThumbnailL( *iObjectSource );
     iState = EGetting;
     __FLOG(_L8("<< CMtpImageDphumbnailCreator::GetThumbL()"));
--- a/mtpfws/mtpfw/daemon/server/src/cmtpserversession.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpfws/mtpfw/daemon/server/src/cmtpserversession.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -132,12 +132,7 @@
     iSingletons.ConnectionMgr().SetClientSId(secureid);
     
     TInt length = aMessage.GetDesLength( 1 );
-    
-    if((!CheckIsBlueToothTransport(newUID) || (length!=0)) && (iSingletons.DpController().Count()==0))
-    	{
-    	iSingletons.DpController().LoadDataProvidersL();
-    	iSingletons.Router().ConfigureL();
-    	}
+
    
     if (length > 0)
     	{
@@ -165,6 +160,13 @@
     	aMessage.Complete(KErrNone);
     	}
     
+    // Fix TSW error MHAN-7ZU96Z
+    if((!CheckIsBlueToothTransport(newUID) || (length!=0)) && (iSingletons.DpController().Count()==0))
+    	{
+    	iSingletons.DpController().LoadDataProvidersL();
+    	iSingletons.Router().ConfigureL();
+    	}
+    
     
     __FLOG(_L8("DoStartTransportL - Exit"));
     }  
--- a/mtpfws/mtpfw/dataproviders/dputility/src/cmtpsetobjectprotection.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/dputility/src/cmtpsetobjectprotection.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -37,6 +37,8 @@
         {TMTPTypeRequest::ERequestParameter1, EMTPElementTypeObjectHandle, EMTPElementAttrWrite, 0, 0, 0},      
      };
 
+const TInt KRetryTimes = 10;
+const TInt KRetryInterval = 150 * 1000; //150ms
 /**
 Two-phase construction method
 @param aPlugin  The data provider plugin
@@ -97,20 +99,42 @@
     {
     TUint32 handle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
     TUint32 statusValue = Request().Uint32(TMTPTypeRequest::ERequestParameter2);
-    TMTPResponseCode rsp = EMTPRespCodeOK;
+    TMTPResponseCode rsp = EMTPRespCodeAccessDenied;
     //iFramework.ObjectMgr().ObjectL(TMTPTypeUint32(handle), *iObjMeta);
     
     switch(statusValue)
         {
         case EMTPProtectionNoProtection:
             {
-            iRfs.SetAtt(iObjMeta->DesC(CMTPObjectMetaData::ESuid),KEntryAttNormal,KEntryAttReadOnly);
+            for(TInt i = 0; i < KRetryTimes; ++ i)
+                {
+                if(KErrNone == iRfs.SetAtt(iObjMeta->DesC(CMTPObjectMetaData::ESuid),KEntryAttNormal,KEntryAttReadOnly))
+                    {
+                    rsp = EMTPRespCodeOK;
+                    break;
+                    }
+                else
+                    {
+                    User::After(KRetryInterval);	
+                    }
+                }
             }
             break;
         case EMTPProtectionReadOnly:
         case EMTPProtectionReadOnlyData:
             {
-            iRfs.SetAtt(iObjMeta->DesC(CMTPObjectMetaData::ESuid),KEntryAttReadOnly,KEntryAttNormal);
+            for(TInt i = 0; i < KRetryTimes; ++ i)
+                {
+                if(KErrNone == iRfs.SetAtt(iObjMeta->DesC(CMTPObjectMetaData::ESuid),KEntryAttReadOnly,KEntryAttNormal))
+                    {
+                        rsp = EMTPRespCodeOK;
+                        break;
+                    }
+                    else
+                    {
+                        User::After(KRetryInterval);	
+                    }
+                }
             }
             break;
         default:
--- a/mtpfws/mtpfw/src/cmtpobjectstore.cpp	Wed Mar 31 22:58:56 2010 +0300
+++ b/mtpfws/mtpfw/src/cmtpobjectstore.cpp	Wed Apr 14 16:49:36 2010 +0300
@@ -496,6 +496,7 @@
 			else
 				{
 				aObject.SetUint(CMTPObjectMetaData::EHandle, handle);
+				needUpdateOwner = ETrue;
 				//while enumerating, we ignore the repeatedly INSERT operations.
 				//User::Leave(KErrAlreadyExists);
 				}
@@ -947,10 +948,7 @@
 	// Create table and index
 	CreateHandleTableL();
 	CreateHandleIndexL();
-	//This is the very very 1st time of MTP server running, therefore, all of the objects in the HandleStore should be added items
-	//roundtrip table will fetch the added items directly from the handlestore, do not popluate the added items to round-trip table
-	//until the enumeration is finished.
-	iUpdateDeltaDataTable = EFalse;
+	iUpdateDeltaDataTable = ETrue;
 	}
 
 /**