Revision: 201007 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 12 Mar 2010 15:43:46 +0200
branchRCL_3
changeset 17 e16d72588c28
parent 9 89a1f2bd800d
child 18 8a03a285ab14
Revision: 201007 Kit: 201008
commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp
commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsContainer.cpp
drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf
drm_plat/drm_rights_api/tsrc/data/c/content.dcf
drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf
omadrm/drmengine/notifier/src/DRMNotifierSession.cpp
omadrm/drmengine/server/data/101F51F2.exc
omadrm/drmplugins/drmfilter/inc/HTTPFilterDRMDataSupplier.h
omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp
--- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Fri Feb 19 23:05:49 2010 +0200
+++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Fri Mar 12 15:43:46 2010 +0200
@@ -231,7 +231,7 @@
         {
         case EDrmSchemeOmaDrm:
             CheckOmaDrmRightsL( aContentURI, aLocalID, rights, status );
-            if ( status ) 
+            if ( status < 0 ) 
                 {
                 rights = NULL;
                 }
@@ -331,6 +331,7 @@
                                        const TBool aIsGroup )
     {
     CDcfCommon* dcf = NULL;
+    HBufC8* buffer( NULL );
     TBool getName = ETrue;
     TParse parse;
 
@@ -356,19 +357,52 @@
 
         if ( err == KErrNotFound || itemNameBuf->Length() == 0 )
             {
-            if ( aIsGroup )
+            // Do not show name if group rights or forward lock
+            if ( !aIsGroup )
                 {
-                aItemName = aFullName;
-                }
-            else
-                {
-                parse.Set( aFullName, NULL, NULL );
-                aItemName = parse.NameAndExt();
+                if ( ( iRightsClient.ForwardLockURI( buffer ) == 
+                        KErrNone ) && buffer )  
+                    {
+                    
+                    // Not forward lock
+                    if ( aID.Compare( *buffer ) != 0 )    
+                        {
+                        parse.Set( aFullName, NULL, NULL );
+                        aItemName = parse.NameAndExt();
+                        }   
+                    delete buffer;
+                    buffer = NULL;
+                    
+                    }       
+                else
+                    {
+                    parse.Set( aFullName, NULL, NULL );
+                    aItemName = parse.NameAndExt();
+                    }
                 }
             }
         else if ( err == KErrNone )
             {
-            aItemName = *itemNameBuf;
+            // Forward lock or combined delivery
+            // If forward lock, do not show name
+            if ( iRightsClient.ForwardLockURI( buffer ) == KErrNone &&
+                    buffer )
+                {
+                if ( aID.Compare( *buffer ) != 0 )
+                    {
+                    // Combined delivery
+                    aItemName = *itemNameBuf;
+                    }
+                delete buffer;
+                }
+            else 
+                {
+                // Do not show name if having group rights
+                if ( !aIsGroup )
+                    {
+                    aItemName = *itemNameBuf;
+                    }
+                }
             }
         else
             {
@@ -720,11 +754,21 @@
             if ( entry )
                 {
                 fullName = entry->FileName();
-                delete entry;
                 SetSelectedItemFullName( fullName );
 
                 TFileName itemName;
-                GetItemNameL( fullName, itemName, aContentURI, EFalse );
+                
+                if ( entry->GroupId().Length() > 0 )
+                    {
+                    GetItemNameL( fullName, itemName, aContentURI, ETrue );
+                    }    
+                else 
+                    {
+                    GetItemNameL( fullName, itemName, aContentURI, EFalse );
+                    }
+                
+                delete entry;
+                
                 SetSelectedItemName( itemName );
 
                 if ( GetItemDataL( fullName, aContentURI, listable,
@@ -738,6 +782,7 @@
             {
             SetSelectedItemFullName( KNullDesC );
             TFileName itemName;
+            // Treat in GetItemNameL as if having group rights
             GetItemNameL( KNullDesC, itemName, aContentURI, ETrue );
             SetSelectedItemName( itemName );
 
@@ -753,15 +798,15 @@
         {
         aStatus = iDRMCommon->GetSingleRightsObject( aContentURI,
             aLocalID, aRights );
+        if ( aStatus )
+            {
+            aRights = NULL;
+            }
         }
-        else
+    else
         {
         aStatus = iDRMCommon->GetActiveRights( aContentURI, 0, aRights );
         }
-    if ( aStatus )
-        {
-        aRights = NULL;
-        }
 
     CheckIndividualConstraint( aContentURI, individualConstraint, usageAllowed );
     SetSelectedIndividualConstraint( individualConstraint );
--- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsContainer.cpp	Fri Feb 19 23:05:49 2010 +0200
+++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsContainer.cpp	Fri Mar 12 15:43:46 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -841,10 +841,10 @@
                                     TInt aIntYrs, TInt aIntMon, TInt aIntDay,
                                     TInt aIntHrs, TInt aIntMin, TInt aIntSec )
     {
-    // Only the two most meaningful data will be showed
+    // Only the first meaningful data will be shown
     TInt numOfData = 0;
 
-    CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( 2 );
+    CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( 1 );
     CleanupStack::PushL( strings );
 
     if ( aIntYrs > 0 )
@@ -855,10 +855,8 @@
                               R_QTN_DRM_NBR_OF_YEARS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_YEARS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
-
-    if ( aIntMon > 0 )
+    else if ( aIntMon > 0 )
         {
         //  Second type not provided because 11 is the maximum
         AddSinglePartOfTimeL( aIntMon,
@@ -867,11 +865,8 @@
                               R_QTN_DRM_NBR_OF_MONTHS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_MONTHS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
-
-    // Only if years or months were missing
-    if ( aIntDay > 0 && numOfData < 2 )
+    else if ( aIntDay > 0 )
         {
         AddSinglePartOfTimeL( aIntDay,
                               R_QTN_DRM_NBR_OF_DAYS_ONE,
@@ -879,10 +874,8 @@
                               R_QTN_DRM_NBR_OF_DAYS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_DAYS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
-
-    if ( aIntHrs > 0 && numOfData < 2 )
+    else if ( aIntHrs > 0 )
         {
         AddSinglePartOfTimeL( aIntHrs,
                               R_QTN_DRM_NBR_OF_HOURS_ONE,
@@ -890,10 +883,8 @@
                               R_QTN_DRM_NBR_OF_HOURS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_HOURS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
-
-    if ( aIntMin > 0 && numOfData < 2 )
+    else if ( aIntMin > 0 )
         {
         AddSinglePartOfTimeL( aIntMin,
                               R_QTN_DRM_NBR_OF_MINS_ONE,
@@ -901,11 +892,9 @@
                               R_QTN_DRM_NBR_OF_MINS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_MINS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
-
     // If interval is 0, then it shows "0 seconds" anyway
-    if ( ( aIntSec > 0 && numOfData < 2 ) || numOfData == 0 )
+    else
         {
         AddSinglePartOfTimeL( aIntSec,
                               R_QTN_DRM_NBR_OF_SECS_ONE,
@@ -913,21 +902,10 @@
                               R_QTN_DRM_NBR_OF_SECS_TWO_FOUR,
                               R_QTN_DRM_NBR_OF_SECS_FIVE_ZERO,
                               strings );
-        numOfData++;
         }
 
-    HBufC* stringHolder;
-    if ( numOfData == 1 )
-        {
-        stringHolder = StringLoader::LoadL( R_QTN_DRM_MGR_DET_INTER,
+    HBufC* stringHolder = StringLoader::LoadL( R_QTN_DRM_MGR_DET_INTER,
                                             strings->MdcaPoint(0), iEikonEnv );
-        }
-    else
-        {
-        stringHolder = StringLoader::LoadL( R_QTN_DRM_MGR_DET_INTER_TWO,
-                                            *strings, iEikonEnv );
-        }
-
     CleanupStack::PopAndDestroy( strings );
 
     return stringHolder;
--- a/omadrm/drmengine/notifier/src/DRMNotifierSession.cpp	Fri Feb 19 23:05:49 2010 +0200
+++ b/omadrm/drmengine/notifier/src/DRMNotifierSession.cpp	Fri Mar 12 15:43:46 2010 +0200
@@ -203,7 +203,10 @@
 //
 void CDRMNotifierSession::DispatchL( const RMessage2& aMessage ) 
     {
-		RDebug::Printf(">>> [%s] %d", _S8(__PRETTY_FUNCTION__), aMessage.Function());
+    #ifdef _DEBUG
+	RDebug::Printf(">>> [%s] %d", _S8(__PRETTY_FUNCTION__), aMessage.Function());
+    #endif
+    	
     switch ( aMessage.Function() )
         {
         case ENotifyClients:
Binary file omadrm/drmengine/server/data/101F51F2.exc has changed
--- a/omadrm/drmplugins/drmfilter/inc/HTTPFilterDRMDataSupplier.h	Fri Feb 19 23:05:49 2010 +0200
+++ b/omadrm/drmplugins/drmfilter/inc/HTTPFilterDRMDataSupplier.h	Fri Mar 12 15:43:46 2010 +0200
@@ -164,6 +164,7 @@
     TPtr8 iBufPtr;
     MHTTPDataSupplier *iPHData; // data supplier from protocol handler
     TBool iSendReady; // ready for sending?
+    TBool iLastPart; // should last part info be sent
 
     CDRMMessageParser* iDRMMessageParser;
     TInt iPrevPos;
--- a/omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp	Fri Feb 19 23:05:49 2010 +0200
+++ b/omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp	Fri Mar 12 15:43:46 2010 +0200
@@ -79,7 +79,7 @@
 CHTTPFilterDRMDataSupplier::CHTTPFilterDRMDataSupplier( TInt aTransId,
     MHTTPDataSupplier* iDataBody, CHTTPFilterDRM* aOwner ) :
     iTransId( aTransId ), iBufPtr( 0, 0 ), iPHData( iDataBody ), iSendReady(
-        EFalse ), iOwner( aOwner )
+        EFalse ), iLastPart( EFalse ), iOwner( aOwner )
     {
     iDRMMessageParser = 0;
     iPrevPos = 0;
@@ -350,17 +350,29 @@
 TBool CHTTPFilterDRMDataSupplier::GetNextDataPart( TPtrC8& aDataPart )
     {
 
+    // First call after releasedata
     if ( iDataPartSize == KWholeDataPart )
         {
         aDataPart.Set( iMemBuf->iBuf->GetPtr() );
         iDataPartSize = aDataPart.Length();
+        if( iSendReady )
+            {
+            iLastPart = ETrue;
+            }
         }
-    else
+    else // Consecutive calls so that we always return the same part
+         // and same amount of data
         {
         aDataPart.Set( iMemBuf->iBuf->GetPtr().Left( iDataPartSize ) );
         }
 
-    return ( iDataPartSize == KWholeDataPart ) ? iSendReady : EFalse;
+    // this check did not work, as in this phase the iDataPartSize is never 
+    // KWholeDataPart
+    //return ( iDataPartSize == KWholeDataPart ) ? iSendReady : EFalse;
+    
+    // Always return info if this is the last part, this is only true
+    // if iSendReady has been true when ReleaseData() has been called
+    return iLastPart;
     }
 
 // -----------------------------------------------------------------------------
@@ -370,7 +382,8 @@
 //
 void CHTTPFilterDRMDataSupplier::ReleaseData()
     {
-    if ( iDataPartSize == KWholeDataPart )
+    if ( iDataPartSize == KWholeDataPart || 
+         ( iLastPart && iSendReady ) )
         {
         TRAP_IGNORE( Sink()->SeekL( MStreamBuf::EWrite, TStreamPos(0) ) );
         if ( iSendReady )
@@ -388,6 +401,13 @@
         CleanupStack::PopAndDestroy( b );
         // Update data part size to available data.
         iDataPartSize = KWholeDataPart;
+
+        // if we are ready processing, make sure the client knows this
+        // is the last part
+        if( iSendReady )
+            {
+            iLastPart = ETrue;
+            }
         }
     }