Revision: 201039 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:51:23 +0300
branchRCL_3
changeset 88 c1bd57533c56
parent 81 e9463401011b
child 89 c38f396e1cd0
Revision: 201039 Kit: 201041
commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp
commondrm/drmutility/src/DrmUiHandlingImpl.cpp
commondrm/drmutility/src/DrmUtility.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/agentv2/src/Oma2AgentAttributes.cpp
omadrm/drmengine/roap/src/RoapEng.cpp
--- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Wed Sep 15 12:30:23 2010 +0300
+++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Wed Oct 13 14:51:23 2010 +0300
@@ -35,6 +35,7 @@
 #include <coeutils.h>
 #include <eikserverapp.h>
 
+
 #include <starterclient.h>
 
 // character conversions
@@ -219,10 +220,10 @@
     {
     TChar charCode( aKeyEvent.iCode );
 
-    if ( aKeyEvent.iScanCode ==  EStdKeyEnter )
+    if ( charCode == EKeyEnter )
         // Default is to show details
         {
-        TInt command = EAknSoftkeyClose;
+        TInt command = EDRMRightsManagerCmdAppViewDet;
         HandleCommandL( command );
         return EKeyWasConsumed;
         }
@@ -254,10 +255,12 @@
             }
         case EAknSoftkeyClose:
             {
+
             if (server)
                 {
                 server->NotifyServerExit(EAknSoftkeyClose);
                 }
+                
             Exit();
             break;
             }    
--- a/commondrm/drmutility/src/DrmUiHandlingImpl.cpp	Wed Sep 15 12:30:23 2010 +0300
+++ b/commondrm/drmutility/src/DrmUiHandlingImpl.cpp	Wed Oct 13 14:51:23 2010 +0300
@@ -389,6 +389,10 @@
     {
     DRM::CDrmUiHandlingData* data( PopFront() );
 
+    // reset the current observer
+    // it may already be deleted so don't do any calls to it.
+    iObserver = NULL;
+
     // Empty the queue:
     while ( data )
         {
@@ -1126,17 +1130,26 @@
             break;
         }
 
-    // Complete the client request
-    iObserver->OperationCompleted( iOperationId, KErrNone );
-
+    // if the observer exists and it has not been deleted, call complete
+    // for the operation and get ready for another round
+    // this should prevent crashes in case the class is deleted before
+    // and operation finihes.
+    
+    if( iObserver && reinterpret_cast<TInt>(iObserver) != 0xDEDEDEDE )
+        {
+        // Complete the client request
+        iObserver->OperationCompleted( iOperationId, KErrNone );
+
+        // Get ready for another round:
+        SetActive();
+
+        // complete internal request:
+        User::RequestComplete( status, KErrNone );
+        }
+        
     // destroy the object:
     CleanupStack::PopAndDestroy( data );
 
-    // Get ready for another round:
-    SetActive();
-
-    // complete internal request:
-    User::RequestComplete( status, KErrNone );
     }
 
 // -----------------------------------------------------------------------------
--- a/commondrm/drmutility/src/DrmUtility.cpp	Wed Sep 15 12:30:23 2010 +0300
+++ b/commondrm/drmutility/src/DrmUtility.cpp	Wed Oct 13 14:51:23 2010 +0300
@@ -215,6 +215,7 @@
     TInt64 headerSize( 0 );
     TBool isDrmFile( EFalse );
     TPtr8 headerPtr( NULL, 0 );
+    TInt dataLength = 0;
 
     aProtected = DRM::EUUnprotected;
     aAgent.Set( KNullDesC );
@@ -306,11 +307,17 @@
             {
             // set the mimetype from the buffer which is in the beginning
             // starting from byte 3 with the length specified at position 2
-            TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) );
-            if( !mimeType.CompareF( *iOmaBasedMimeType ) )
-                {
-                aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
-                isDrmFile = ETrue;
+            // also make sure the data length is greater or equal to the
+            // position + the 2nd byte of the content
+            dataLength = 3 + (buffer->Des())[1];
+            if( buffer->Length() >= dataLength )
+                {           
+                TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) );
+                if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+                    {
+                    aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
+                    isDrmFile = ETrue;
+                    }
                 }
             }
         CleanupStack::PopAndDestroy( buffer );
@@ -333,6 +340,7 @@
     TPtr8 asfPtr( NULL, 0 );
     TBuf8< 32 > asfGuidHex;
     TBool isDrmFile( EFalse );
+    TInt dataLength = 0;
 
     aProtected = DRM::EUUnprotected;
     aAgent.Set( KNullDesC );
@@ -401,12 +409,18 @@
             {
             // set the mimetype from the buffer which is in the beginning
             // starting from byte 3 with the length specified at position 2
-            TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) );
-            if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+            // also make sure the data length is greater or equal to the
+            // position + the 2nd byte of the content
+            dataLength = 3 + (aContent)[1];
+            if( aContent.Length() >= dataLength )
                 {
-                aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
-                isDrmFile = ETrue;
-                aProtected = DRM::EUProtected;
+                TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) );
+                if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+                    {
+                    aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
+                    isDrmFile = ETrue;
+                    aProtected = DRM::EUProtected;
+                    }
                 }
             }
         }
--- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Wed Sep 15 12:30:23 2010 +0300
+++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Wed Oct 13 14:51:23 2010 +0300
@@ -469,7 +469,9 @@
                             DRM::EDrmAllowAudioBluetooth | 
                             DRM::EDrmAllowVideoMacroVision | 
                             DRM::EDrmAllowAudioFmTransmitter | 
-                            DRM::EDrmAllowAudioUsb;
+                            DRM::EDrmAllowAudioUsb |
+                            DRM::EDrmAllowAudioHdmiHdcpRequired |
+                            DRM::EDrmAllowVideoHdmiHdcpRequired;    
                     }
                 else
                     {
@@ -712,7 +714,9 @@
                             DRM::EDrmAllowAudioBluetooth | 
                             DRM::EDrmAllowVideoMacroVision | 
                             DRM::EDrmAllowAudioFmTransmitter | 
-                            DRM::EDrmAllowAudioUsb;
+                            DRM::EDrmAllowAudioUsb |
+                            DRM::EDrmAllowAudioHdmiHdcpRequired |
+                            DRM::EDrmAllowVideoHdmiHdcpRequired;    
                     }
                 else
                     {
--- a/omadrm/drmengine/roap/src/RoapEng.cpp	Wed Sep 15 12:30:23 2010 +0300
+++ b/omadrm/drmengine/roap/src/RoapEng.cpp	Wed Oct 13 14:51:23 2010 +0300
@@ -32,7 +32,7 @@
 #ifndef __WINS__
 #include <etelmm.h>
 #include <mmtsy_names.h>
-#include <sysutil.h>
+#include <SysUtil.h>
 #endif
 
 #include <flogger.h>