commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp
branchRCL_3
changeset 28 00671737faf2
parent 27 1481bf457703
equal deleted inserted replaced
27:1481bf457703 28:00671737faf2
   274     // Ask the rights from CAF, same call for both ECanPlay and ECanView
   274     // Ask the rights from CAF, same call for both ECanPlay and ECanView
   275     User::LeaveIfError( aContent.GetAttribute( ContentAccess::ECanPlay, value ) );
   275     User::LeaveIfError( aContent.GetAttribute( ContentAccess::ECanPlay, value ) );
   276 
   276 
   277     if ( !value )
   277     if ( !value )
   278         {
   278         {
   279         ShowNoRightsNoteL( aContent, reason );
   279         ShowNoRightsNoteL( aContent, reason, aOperationId, aObserver );
   280         User::LeaveIfError( aContent.GetAttribute( ContentAccess::ECanPlay, value ) );
   280         User::LeaveIfError( aContent.GetAttribute( ContentAccess::ECanPlay, value ) );
   281         if ( value )
   281         if ( value )
   282             {
   282             {
   283             CallRightsAvailable( aObserver, aOperationId, KErrNone );
   283             CallRightsAvailable( aObserver, aOperationId, KErrNone );
   284             }
   284             }
   498 
   498 
   499     switch ( rightsAction )
   499     switch ( rightsAction )
   500         {
   500         {
   501         case DRM::EUHCheckRightsActionDefault:
   501         case DRM::EUHCheckRightsActionDefault:
   502             {
   502             {
   503             ShowNoRightsNoteL( aContent, aReason );
   503             ShowNoRightsNoteL( aContent, aReason, aOperationId, aObserver );
   504             }
   504             }
   505             break;
   505             break;
   506 
   506 
   507         case DRM::EUHCheckRightsActionOpenDetailsView:
   507         case DRM::EUHCheckRightsActionOpenDetailsView:
   508             {
   508             {
   556 // CDrmUtilityWMDrmWrapper::ShowNoRightsNoteL
   556 // CDrmUtilityWMDrmWrapper::ShowNoRightsNoteL
   557 // -----------------------------------------------------------------------------
   557 // -----------------------------------------------------------------------------
   558 //
   558 //
   559 void DRM::CDrmUtilityWMDrmWrapper::ShowNoRightsNoteL(
   559 void DRM::CDrmUtilityWMDrmWrapper::ShowNoRightsNoteL(
   560     ContentAccess::CData& aContent,
   560     ContentAccess::CData& aContent,
   561     TUint32 /*aReason*/ )
   561     TUint32 /*aReason*/,
   562     {
   562     TInt aOperationId,
       
   563     DRM::MDrmHandleErrorObserver* aObserver )
       
   564     {
       
   565     TInt value;
   563     TRAPD( err, LoadDlaWrapperL() );
   566     TRAPD( err, LoadDlaWrapperL() );
   564     if ( !err )
   567     if ( !err )
   565         {
   568         {
   566         TInt ret( EAknSoftkeyYes );
   569         TInt ret( EAknSoftkeyYes );
   567         RFile file;
   570         RFile file;
   587                 }
   590                 }
   588             }
   591             }
   589         if ( !err && ( ret == EAknSoftkeyYes || ret == EAknSoftkeyOk ) && iWmDrmDlaSupportOn)
   592         if ( !err && ( ret == EAknSoftkeyYes || ret == EAknSoftkeyOk ) && iWmDrmDlaSupportOn)
   590             {
   593             {
   591             TRAP_IGNORE( DlaLicenseAcquisitionL( file ) );
   594             TRAP_IGNORE( DlaLicenseAcquisitionL( file ) );
       
   595             
       
   596             // Ask the rights from CAF, same call for both ECanPlay and ECanView
       
   597             aContent.GetAttribute( ContentAccess::ECanPlay, value );
       
   598             // call given HandleErrorObserver
       
   599             if( value > 0 )
       
   600                 {
       
   601                 aObserver->RightsAvailable( aOperationId, KErrNone );              
       
   602                 }
   592             }
   603             }
   593         CleanupStack::PopAndDestroy( &file );
   604         CleanupStack::PopAndDestroy( &file );
   594         }
   605         }
   595     else
   606     else
   596         {
   607         {