mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetdeviceinfo.cpp
branchRCL_3
changeset 20 4a793f564d72
parent 19 0aa8cc770c8a
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
   163     iDeviceInfo->SetStringL(CMTPTypeDeviceInfo::ESerialNumber, device.SerialNumber());
   163     iDeviceInfo->SetStringL(CMTPTypeDeviceInfo::ESerialNumber, device.SerialNumber());
   164     
   164     
   165     CMTPDataProviderController& dps(iSingletons.DpController());
   165     CMTPDataProviderController& dps(iSingletons.DpController());
   166     SetSupportedOperationsL(dps);
   166     SetSupportedOperationsL(dps);
   167     SetSupportedEventsL(dps);
   167     SetSupportedEventsL(dps);
   168     SetSupportedDevicePropertiesL(dps);
   168     SetSupportedDevicePropertiesL();
   169     SetSupportedCaptureFormatsL(dps);
   169     SetSupportedCaptureFormatsL(dps);
   170     SetSupportedPlaybackFormatsL(dps);
   170     SetSupportedPlaybackFormatsL(dps);
   171     
   171     
   172     __FLOG(_L8("BuildDeviceInfoL - Exit")); 
   172     __FLOG(_L8("BuildDeviceInfoL - Exit")); 
   173     }
   173     }
   241     }
   241     }
   242 
   242 
   243 /**
   243 /**
   244 Populates the supported device properties field in the device info data set
   244 Populates the supported device properties field in the device info data set
   245 */       
   245 */       
   246 void CMTPGetDeviceInfo::SetSupportedDevicePropertiesL(CMTPDataProviderController& aDpController)
   246 void CMTPGetDeviceInfo::SetSupportedDevicePropertiesL()
   247 	{ 
   247 	{ 
   248 	__FLOG(_L8("SetSupportedDevicePropertiesL - Entry"));	
   248 	__FLOG(_L8("SetSupportedDevicePropertiesL - Entry"));  
   249     TInt count = aDpController.Count();    
   249 	iDeviceInfo->SetL(CMTPTypeDeviceInfo::EDevicePropertiesSupported, 
   250     RArray<TUint> supportedOperations(KMTPArrayGranularity);
   250 	iDpSingletons.DeviceDataStore().GetSupportedDeviceProperties());
   251     CleanupClosePushL(supportedOperations);
       
   252     const TInt32 KMTPImplementationUidDeviceDp(0x102827AF);
       
   253     const TInt32 KMTPImplementationUidFileDp(0x102827B0);
       
   254     const TInt32 KMTPImplementationUidProxyDp(0x102827B1);
       
   255     const TInt32 KMTPFrameworkDpCount(3);
       
   256     TBool bOnlyInternalDpLoad = count > KMTPFrameworkDpCount ? EFalse : ETrue;
       
   257     while(count--)
       
   258         {
       
   259         TInt32 uid = aDpController.DataProviderByIndexL(count).ImplementationUid().iUid;
       
   260         // The filter is added for licencee's request which will filtrate the symbian's internal
       
   261         // dp's supported enhance mode operations to make licencee's dp work.
       
   262         // Every new internal dp need add it's implementation id here to filtrate and increase
       
   263         // the KMTPFrameworkDpCount number.
       
   264         if ((uid == KMTPImplementationUidDeviceDp ||
       
   265             uid == KMTPImplementationUidFileDp ||
       
   266             uid == KMTPImplementationUidProxyDp) && !bOnlyInternalDpLoad)
       
   267             {
       
   268             AddToArrayWithFilterL(supportedOperations, aDpController.DataProviderByIndexL(count).SupportedCodes(EDeviceProperties));
       
   269             }
       
   270         else
       
   271             {
       
   272             AddToArrayL(supportedOperations, aDpController.DataProviderByIndexL(count).SupportedCodes(EDeviceProperties));
       
   273             }
       
   274         }
       
   275 
       
   276     CMTPTypeArray* mtpOperationsArray = CMTPTypeArray::NewL(EMTPTypeAUINT16, supportedOperations);
       
   277     CleanupStack::PopAndDestroy(&supportedOperations);
       
   278     CleanupStack::PushL(mtpOperationsArray); //unnecessary if Set operation below does not leave,         
       
   279     iDeviceInfo->SetL(CMTPTypeDeviceInfo::EDevicePropertiesSupported, *mtpOperationsArray);
       
   280     CleanupStack::PopAndDestroy(mtpOperationsArray);  
       
   281 	
       
   282 	__FLOG(_L8("SetSupportedDevicePropertiesL - Exit"));  
   251 	__FLOG(_L8("SetSupportedDevicePropertiesL - Exit"));  
   283 	}
   252 	}
   284 
   253 
   285 /**
   254 /**
   286 Populates the supported capture formats field in the device info data set
   255 Populates the supported capture formats field in the device info data set
   414 void CMTPGetDeviceInfo::AddToArrayL(RArray<TUint>& aDestArray, const RArray<TUint>& aSrcArray) const
   383 void CMTPGetDeviceInfo::AddToArrayL(RArray<TUint>& aDestArray, const RArray<TUint>& aSrcArray) const
   415     {
   384     {
   416     TInt count(aSrcArray.Count());
   385     TInt count(aSrcArray.Count());
   417     for (TInt i(0); (i < count); i++)
   386     for (TInt i(0); (i < count); i++)
   418         {
   387         {
   419         // Apply filter
       
   420         if(aSrcArray[i] == EMTPOpCodeResetDevicePropValue)
       
   421             {
       
   422             __FLOG_VA((_L8("Filter ignored operation: %d"), aSrcArray[i]));
       
   423             continue;
       
   424             }
       
   425         
       
   426         TInt err(aDestArray.InsertInOrder(aSrcArray[i]));
   388         TInt err(aDestArray.InsertInOrder(aSrcArray[i]));
   427         if ((err != KErrNone) && (err != KErrAlreadyExists))
   389         if ((err != KErrNone) && (err != KErrAlreadyExists))
   428             {
   390             {
   429             User::Leave(err);
   391             User::Leave(err);
   430             }
   392             }