diff -r 40261b775718 -r efebd1779a59 mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp --- a/mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp Tue Feb 02 01:56:55 2010 +0200 +++ b/mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp Fri Apr 16 16:34:49 2010 +0300 @@ -2282,8 +2282,73 @@ {//leaving as GetAttribute of CAF caused an error. User::Leave(error); } + + if(!isDataProtected) + { + CleanupStack::PopAndDestroy(content); + return;//returning cause if data is not protected, we need not evaluate the type of rights. + } + + RArray agents; + TAgent drmAgent; + + CManager* manager = CManager::NewLC(); + CleanupClosePushL( agents ); + manager->ListAgentsL( agents ); + + for ( TInt i = 0; i < agents.Count(); i++ ) + { + if ( agents[i].Name().Compare( content->Agent().Name() ) == 0 ) + { + drmAgent = agents[i]; + break; + } + } + + CleanupStack::PopAndDestroy( &agents ); + RStreamablePtrArray infoArray; + CRightsManager* rightsManager = manager->CreateRightsManagerL(drmAgent); + CleanupStack::PushL(rightsManager); + + if(iFileName.Length()) + { + if(iUniqueId) + { + TVirtualPathPtr pathPtr(iFileName, *iUniqueId); + TRAP(error,rightsManager->ListRightsL(infoArray, pathPtr) ); + } + else + { + TRAP(error,rightsManager->ListRightsL(infoArray, iFileName ) ); + } + } + else if (iUseFileHandle && iOwnFileHandle) + { + if(iUniqueId) + { + TRAP(error,rightsManager->ListRightsL(infoArray, iFileHandle, *iUniqueId) ); + } + else + { + TRAP(error,rightsManager->ListRightsL(infoArray, iFileHandle, KNullDesC) ); + } + } + + if(error) + { + infoArray.Close(); + User::Leave(error); + } + TInt consumableRights = 0; + if(infoArray.Count() > 0) + consumableRights = (ContentAccess::ERightsTypeConsumable) & infoArray[0]->RightsType(); + + + CleanupStack::PopAndDestroy( rightsManager ); + infoArray.Close(); + CleanupStack::PopAndDestroy( manager ); CleanupStack::PopAndDestroy(content); - if(isDataProtected && !iHasDrmCapability && mode == EPlayback ) + if(isDataProtected && !iHasDrmCapability && mode == EPlayback && !consumableRights) {//only when the Data is protected and client does not have the DRM capability, we need secure DRM process aIsSecureDrmProcess = ETrue; }