Merge RCL_3 fixes with latest delivery. RCL_3
authorsrilekhas <srilekhas@symbian.org>
Mon, 23 Aug 2010 13:37:15 +0100
branchRCL_3
changeset 68 c027dc8514da
parent 67 50c53e893c3f (diff)
parent 58 5816b2634c8a (current diff)
child 73 6661d8259859
Merge RCL_3 fixes with latest delivery.
--- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -33,6 +33,8 @@
 #include <barsread.h>  // for resource reader
 #include <centralrepository.h>
 #include <coeutils.h>
+#include <eikserverapp.h>
+
 
 #include <starterclient.h>
 
@@ -241,7 +243,8 @@
 //
 void CDRMRightsMgrAppUi::HandleCommandL( TInt aCommand )
     {
-
+    CEikAppServer* server = iEikonEnv->AppServer();
+ 
     switch ( aCommand )
         {
         case EEikCmdExit:
@@ -250,6 +253,17 @@
             Exit();
             break;
             }
+        case EAknSoftkeyClose:
+            {
+
+            if (server)
+                {
+                server->NotifyServerExit(EAknSoftkeyClose);
+                }
+                
+            Exit();
+            break;
+            }    
         default:
             break;
         }
--- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsView.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsView.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -184,7 +184,7 @@
 
     if ( aCommand == EAknSoftkeyOk )
         {
-            appUi.HandleCommandL( EEikCmdExit ); // Ok softkey was pressed
+            appUi.HandleCommandL( EAknSoftkeyClose ); // Ok softkey was pressed
         }
     else
         {
--- a/commondrm/drmutility/src/DrmUiHandlingImpl.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/commondrm/drmutility/src/DrmUiHandlingImpl.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -50,6 +50,10 @@
 #include <AiwGenericParam.h>
 #include <apgcli.h>
 
+// DCF repository
+#include <DcfRep.h>
+#include <DcfEntry.h>
+
 // character conversions
 #include <utf.h>
 
@@ -180,6 +184,70 @@
     return iapIdOfDest;
     }
 
+// ---------------------------------------------------------
+// UpdateDCFRepositoryL()
+// Update saved file to DCFRepository
+// ---------------------------------------------------------
+
+LOCAL_C void UpdateDCFRepositoryL( TDesC& aFullFileName )
+    {
+    CDcfEntry* dcfEntry( NULL );
+    CDcfRep* dcfRep( NULL );
+    
+    dcfEntry = CDcfEntry::NewL();
+    CleanupStack::PushL( dcfEntry );
+
+    dcfRep = CDcfRep::NewL();
+    CleanupStack::PushL( dcfRep );
+
+    dcfEntry->SetLocationL( aFullFileName, 0 );
+    dcfRep->UpdateL( dcfEntry );
+    CleanupStack::PopAndDestroy( dcfRep );
+    CleanupStack::PopAndDestroy( dcfEntry );
+    }
+
+// ---------------------------------------------------------
+// FindFullFileNameAndUpdateDCFRepositoryL()
+// Find full file name for the content and update saved 
+// file to DCFRepository
+// ---------------------------------------------------------
+
+LOCAL_C void FindFullFileNameAndUpdateDCFRepositoryL(
+    const RFile& aFileHandle )
+    {
+    HBufC* fullPath( NULL );
+    TPtr fullPathPtr( NULL, 0 );
+        
+    fullPath = HBufC::NewLC( KUrlMaxLen );
+    fullPathPtr.Set( fullPath->Des() );
+    
+    aFileHandle.FullName( fullPathPtr );
+    UpdateDCFRepositoryL( fullPathPtr );
+    CleanupStack::PopAndDestroy( fullPath );
+    }
+
+// ---------------------------------------------------------
+// FindFullFileNameAndUpdateDCFRepositoryL()
+// Find full file name for the content and update saved 
+// file to DCFRepository
+// ---------------------------------------------------------
+
+LOCAL_C void FindFullFileNameAndUpdateDCFRepositoryL(
+    const ContentAccess::CData& aFileData  )
+    {
+    HBufC* fullPath( NULL );
+    TPtr fullPathPtr( NULL, 0 );
+    
+    fullPath = HBufC::NewLC( KUrlMaxLen );
+    fullPathPtr.Set( fullPath->Des() );
+                
+    aFileData.GetStringAttribute( DRM::EDrmFullName, 
+        fullPathPtr );
+    
+    UpdateDCFRepositoryL( fullPathPtr );
+    CleanupStack::PopAndDestroy( fullPath );    
+    }
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -1420,6 +1488,9 @@
     if ( ( !agent.Compare( DRM::KDrmOmaAgentName ) ) || ( iOmaBasedAgentName
         && !agent.Compare( *iOmaBasedAgentName ) ) )
         {
+        // To embed Domain RO in superdistribution case, register the content
+        TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( *aData.iFile ) );
+        
         HandleOmaErrorL( *content, aData.iIntent, aData.iError,
             aData.iErrorObserver, aData.iOperationId );
         }
@@ -1441,6 +1512,7 @@
 void DRM::CDrmUiHandlingImpl::PerformHandleErrorDataL(
     DRM::CDrmUiHandlingData& aData )
     {
+    
     DRM::TDrmAgentUid agentUid( DRM::EDrmOmaAgent );
     IsProtectedL( aData.iFileData, agentUid );
     IsProperErrorL( aData.iError );
@@ -1449,7 +1521,11 @@
     switch ( agentUid )
         {
         case DRM::EDrmOmaAgent:
-
+            
+            // To embed Domain RO in superdistribution case, register the content
+            TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( 
+                *aData.iFileData ) );
+            
             HandleOmaErrorL( *aData.iFileData, aData.iIntent, aData.iError,
                 aData.iErrorObserver, aData.iOperationId );
 
@@ -1557,7 +1633,10 @@
     HBufC* riUrl( NULL );
     HBufC* domainRiUrl( NULL );
     DRM::TDrmUiUrlType urlType( DRM::EUHRightsIssuerUrl );
-
+            
+    // To embed Domain RO in superdistribution case, register the content
+    TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( aContent ) );
+    
     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
     GetOmaSilentRightsUrlLC( aContent, silentUrl );
     GetOmaRightsIssuerLC( aContent, riUrl );
@@ -1714,7 +1793,7 @@
     TInt previewType( ContentAccess::ENoPreview );
     TUint32 reason( 0 );
     TBool handled( EFalse );
-
+    
     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
 
     // Check that this really is an error situation
--- a/drm_pub/drm_helper_api/inc/Drmhelper.h	Tue Jul 13 13:57:53 2010 +0100
+++ b/drm_pub/drm_helper_api/inc/Drmhelper.h	Mon Aug 23 13:37:15 2010 +0100
@@ -26,7 +26,7 @@
 #include <ConeResLoader.h>
 #include <apparc.h>
 #include <rdrmhelper.h>
-#include <aknserverapp.h>
+#include <AknServerApp.h>
 #include <caf/caf.h>
 #include <caf/content.h>
 #include <caf/data.h>
--- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -82,9 +82,6 @@
     DRM::EDrmAllowVideoMacroVision |
     DRM::EDrmAllowAudioUsb |   
     DRM::EDrmAllowAudioHdmiHdcpRequired |
-    DRM::EDrmAllowAudioHdmi |
-    DRM::EDrmAllowVideoHDMI  |
-    DRM::EDrmAllowVideoHdmiHdcpRequested |
     DRM::EDrmAllowVideoHdmiHdcpRequired;
 
 // ============================= LOCAL FUNCTIONS ===============================
--- a/omadrm/drmplugins/drmromtm/group/RoMtmUi.mmp	Tue Jul 13 13:57:53 2010 +0100
+++ b/omadrm/drmplugins/drmromtm/group/RoMtmUi.mmp	Mon Aug 23 13:37:15 2010 +0100
@@ -28,6 +28,7 @@
 
 SOURCEPATH      ../ui/src
 SOURCE          RoMtmUi.cpp
+SOURCE          drmmsgwatcherobserver.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../ui/inc
--- a/omadrm/drmplugins/drmromtm/group/bld.inf	Tue Jul 13 13:57:53 2010 +0100
+++ b/omadrm/drmplugins/drmromtm/group/bld.inf	Mon Aug 23 13:37:15 2010 +0100
@@ -19,12 +19,10 @@
 #include <platform_paths.hrh>
 
 PRJ_PLATFORMS
-    DEFAULT -ARMI
+DEFAULT
 
 
 PRJ_EXPORTS
-../client/inc/romtmcli.h
-../server/inc/romtmser.h
 ../loc/romtmui.loc MW_LAYER_LOC_EXPORT_PATH( romtmui.loc )
 
 
@@ -35,4 +33,4 @@
 RoMtmUi.mmp
 RoMtmDat.mmp
 
-//  End of File  
+//  End of File
--- a/omadrm/drmplugins/drmromtm/ui/inc/RoMtmUi.h	Tue Jul 13 13:57:53 2010 +0100
+++ b/omadrm/drmplugins/drmromtm/ui/inc/RoMtmUi.h	Mon Aug 23 13:37:15 2010 +0100
@@ -207,12 +207,12 @@
         CMsvOperation* CompletedOperationL( TRequestStatus& aObserverStatus );
         TBool ShowQueryL( TDesC16& aFile );
         TInt CheckTriggerTypeL( TDesC16& aFile );
+
     private:
         TMessageType iType;
-        CDocumentHandler* iDocHandler;
         RFs iFs;
         CEikProcess* iHostProcess;
-    CAknLaunchAppService* iOpenService;
+    
     };
 
 #endif      // RIGHTSOBJECTMTMUI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omadrm/drmplugins/drmromtm/ui/inc/drmmsgwatcherobserver.h	Mon Aug 23 13:37:15 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Msv operation for drm view closing
+*
+*/
+
+
+#ifndef C_DRMMSGWATCHEROBSERVER_H
+#define C_DRMMSGWATCHEROBSERVER_H
+
+
+
+#include <msvapi.h>        // CMsvOperation
+#include <AknServerApp.h>  // MAknServerAppExitObserver
+#include <AknLaunchAppService.h> // app service
+#include <DocumentHandler.h> // Document handler
+
+class CDocumentHandler;
+
+// CLASS DECLARATION
+
+/**
+* CDrmMsgWatcherObserver
+* Simple operation class which watches a service (drm),
+* completing when that thread closes.
+*
+* The passed CMsvSession is not used (merely required to base-construct
+* a CMsvOperation).
+*/
+NONSHARABLE_CLASS( CDrmMsgWatcherObserver ) : public CMsvOperation, public MAknServerAppExitObserver			
+    { 
+    public:
+
+	    static CDrmMsgWatcherObserver* NewL( 
+            CMsvSession& aMsvSession,
+            TInt aPriority,
+            TRequestStatus& aObserverRequestStatus,
+            TUid aMtm,
+            CAiwGenericParamList* aParamList );
+
+
+	    static CDrmMsgWatcherObserver* NewL( 
+            CMsvSession& aMsvSession,
+            TInt aPriority,
+            TRequestStatus& aObserverRequestStatus,
+            TUid aMtm,
+            const TDesC& aFileName,
+            TDataType& aDataType );
+	    
+        /**
+        * C++ constructor
+        */
+        CDrmMsgWatcherObserver(
+            CMsvSession& aMsvSession,
+            TInt aPriority,
+            TRequestStatus& aObserverRequestStatus,
+            TUid aMtm );
+
+        /**
+        * Destructor.
+        */
+        ~CDrmMsgWatcherObserver();
+
+    private: // From MApaServerAppExitObserver
+        void HandleServerAppExit( TInt aReason );
+		
+    protected:
+        
+        
+        /**
+        * From CMsvOperation
+        */
+        virtual const TDesC8& ProgressL();
+
+        /**
+        * From CMsvOperation
+        */
+        virtual const TDesC8& FinalProgress();
+                
+        /**
+        * From CActive
+        */
+        virtual void RunL();
+
+        /**
+        * From CActive
+        */
+        virtual void DoCancel();
+
+        /**
+        *
+        */
+        void Start();
+
+    private:
+        void ConstructL( CAiwGenericParamList* aParamList );
+        void ConstructL( const TDesC& aFileName, TDataType& aDataType );
+        
+        /**
+        * Completes observer with the completion code
+        * @param aCode: Completion code
+        */
+        void CompleteObserver( TInt aCode );
+
+
+    protected:// Data
+        HBufC8*     iProgress;
+
+    private:
+        CAknLaunchAppService* iService;
+        CDocumentHandler* iDocHandler;
+
+    };
+    
+#endif // C_DRMMSGWATCHEROBSERVER_H   
+
+// End of file
--- a/omadrm/drmplugins/drmromtm/ui/src/RoMtmUi.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/omadrm/drmplugins/drmromtm/ui/src/RoMtmUi.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-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"
@@ -50,6 +50,10 @@
 #include <StringLoader.h> //StringLoader
 #include <ConeResLoader.h> //rconeresloader
 #include <RoMtmUi.rsg> // test
+#include "drmmsgwatcherobserver.h"
+
+#include "cleanupresetanddestroy.h"
+
 // EXTERNAL DATA STRUCTURES
 // EXTERNAL FUNCTION PROTOTYPES
 // CONSTANTS
@@ -230,8 +234,6 @@
 CRightsObjectMtmUi::CRightsObjectMtmUi( CBaseMtm& aBaseMtm , CRegisteredMtmDll& aRegisteredMtmDll )
     :   CBaseMtmUi( aBaseMtm , aRegisteredMtmDll )
     {
-    iOpenService = NULL;
-    iDocHandler = NULL;
     iHostProcess = NULL;
     iType = ERo;
     }
@@ -272,9 +274,6 @@
     TRAP(err,WriteL(_L8("~CRightsObjectMtmUi")));
 #endif
     iFs.Close();
-
-  delete iOpenService;
-    delete iDocHandler;
     }
 
 
@@ -568,15 +567,11 @@
     BaseMtm().LoadMessageL();
     CRichText& body = BaseMtm().Body();
     TPtrC ptr16( body.Read(0) );
-    const TUid KUidDRMUI = { 0x101f85c7 };
+    //const TUid KUidDRMUI = { 0x101f85c7 };
+    CMsvOperation* operation( NULL );
 
     if ( iType == ERoapTrigger || iType == ERoapTriggerRoAcquisition )
         {
-
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-iDocHandler"));
-#endif
-
         _LIT8( KRoapTriggerMimeType, "application/vnd.oma.drm.roap-trigger+xml" );
         TDataType type = TDataType( KRoapTriggerMimeType );
         HBufC* filename = NULL;
@@ -587,66 +582,42 @@
         ptr.Append(ptr16.Right(ptr16.Length()-4));
 
         show = ShowQueryL(ptr);
+
         if (!show)
             {
-            CleanupStack::PopAndDestroy(filename);
-            return CompletedOperationL( aStatus );
+            operation = CompletedOperationL( aStatus );
+            }
+        else
+            {
+            operation = CDrmMsgWatcherObserver::NewL(
+                    Session(),
+                    CActive::EPriorityStandard,
+                    aStatus,
+                    Type(),
+                    ptr,
+                    type );
             }
 
-#ifdef _DRM_TESTING
-        WriteL(ptr,ptr.Length());
-#endif
-        if (iDocHandler)
-            {
-            delete iDocHandler;
-            iDocHandler = NULL;
-            }
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-iDocHandler-NewL"));
-#endif
-        iDocHandler = CDocumentHandler::NewL();
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-iDocHandler-SetExitObserver"));
-#endif
-        iDocHandler->SetExitObserver(this);
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-iDocHandler-OpenFileEmbeddedL"));
-#endif
-        iDocHandler->OpenFileEmbeddedL(ptr,type);
         CleanupStack::PopAndDestroy(filename);
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-iDocHandler-End"));
-#endif
         }
     else
         {
-        if ( iOpenService )
-            {
-            delete iOpenService;
-            iOpenService = NULL;
-            }
-#ifdef _DRM_TESTING
-        WriteL(_L8("LaunchEditorApplicationL-CAknOpenFileService::NewL"));
-#endif
-
         CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC();
         TAiwVariant variantObject( ptr16 );
         TAiwGenericParam param( EGenericParamFile, variantObject );
         paramList->AppendL( param );
 
-        TRAPD( err, iOpenService = CAknLaunchAppService::NewL( KUidDRMUI, this, paramList ) );
-        if (err != KErrNone)
-            {
-            // just return to Inbox
-            }
+        operation = CDrmMsgWatcherObserver::NewL(
+                Session(),
+                CActive::EPriorityStandard,
+                aStatus,
+                Type(),
+                paramList );
 
-        CleanupStack::PopAndDestroy( paramList ); // paramList
+        CleanupStack::PopAndDestroy( paramList );
         }
 
-#ifdef _DRM_TESTING
-    WriteL(_L8("LaunchEditorApplicationL-End"));
-#endif
-    return CompletedOperationL( aStatus );
+    return operation;
     }
 
 
@@ -799,9 +770,9 @@
     CleanupStack::PushL(buf);
     roap = Roap::CRoapEng::NewL();
     CleanupStack::PushL(roap);
+    CleanupResetAndDestroyPushL(array);
     roap->SetTriggerL(ptr,NULL,type,status,op,array);
-    array.ResetAndDestroy();
-    array.Close();
+    CleanupStack::PopAndDestroy(&array);
     CleanupStack::PopAndDestroy(roap);
     CleanupStack::PopAndDestroy(buf);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omadrm/drmplugins/drmromtm/ui/src/drmmsgwatcherobserver.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Msv operation for drm viewing
+*
+*/
+
+
+
+#include "drmmsgwatcherobserver.h"
+
+
+// CONSTANTS
+const TInt KiProgressBufferSize = 1;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::NewL
+// ---------------------------------------------------------
+//
+CDrmMsgWatcherObserver* CDrmMsgWatcherObserver::NewL( 
+	CMsvSession& aMsvSession,
+    TInt aPriority,
+    TRequestStatus& aObserverRequestStatus,
+    TUid aMtm,
+    CAiwGenericParamList* aParamList)
+	{
+	CDrmMsgWatcherObserver* self = 
+		new(ELeave) CDrmMsgWatcherObserver( 
+			aMsvSession,
+			aPriority,
+			aObserverRequestStatus,
+			aMtm);
+	CleanupStack::PushL(self);
+    self->ConstructL( aParamList );
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::NewL
+// ---------------------------------------------------------
+//
+CDrmMsgWatcherObserver* CDrmMsgWatcherObserver::NewL( 
+	CMsvSession& aMsvSession,
+    TInt aPriority,
+    TRequestStatus& aObserverRequestStatus,
+    TUid aMtm,
+    const TDesC& aFileName,
+    TDataType& aDataType )
+	{
+	CDrmMsgWatcherObserver* self = 
+		new(ELeave) CDrmMsgWatcherObserver( 
+			aMsvSession,
+			aPriority,
+			aObserverRequestStatus,
+			aMtm);
+	CleanupStack::PushL(self);
+    self->ConstructL( aFileName, aDataType );
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::ConstructL
+// ---------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::ConstructL( CAiwGenericParamList* aParamList )
+    {
+    const TUid KUidDRMUI = { 0x101f85c7 };        
+    iService = CAknLaunchAppService::NewL( KUidDRMUI, this, aParamList );        
+    iObserverRequestStatus = KRequestPending;
+    Start();
+    }
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::ConstructL
+// ---------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::ConstructL( const TDesC& aFileName, TDataType& aDataType )
+    {
+    iDocHandler = CDocumentHandler::NewL();
+
+    iDocHandler->SetExitObserver(this);
+
+    iDocHandler->OpenFileEmbeddedL(aFileName, aDataType);
+     
+    iObserverRequestStatus = KRequestPending;
+    Start();
+    }
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::CDrmMsgWatcherObserver
+// ---------------------------------------------------------
+//
+CDrmMsgWatcherObserver::CDrmMsgWatcherObserver
+	(
+    CMsvSession& aMsvSession, 
+    TInt aPriority, 
+    TRequestStatus& aObserverRequestStatus, 
+    TUid aMtm
+    )
+    :   
+    CMsvOperation(
+    aMsvSession, 
+    aPriority, 
+    aObserverRequestStatus )
+    {
+    iMtm = aMtm;        
+    }
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::~CDrmMsgWatcherObserver
+// ---------------------------------------------------------
+//
+CDrmMsgWatcherObserver::~CDrmMsgWatcherObserver()
+    {
+    Cancel();
+    if( iService )
+        {
+        delete iService;
+        iService = NULL;
+        } 
+    if( iDocHandler )
+        {
+        delete iDocHandler;
+        iDocHandler = NULL;
+        }         
+    delete iProgress;    
+    }
+
+// -----------------------------------------------------------------------------
+// CDrmMsgWatcherObserver::DoCancel
+// From CActive
+// -----------------------------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::DoCancel()
+    {
+    if ( iStatus == KRequestPending )
+        {
+        TRequestStatus* pstat = &iStatus;
+        User::RequestComplete( pstat, KErrCancel );
+        }
+    CompleteObserver( KErrCancel );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMsgEditorServerWatchingOperation::ProgressL
+// From CMsvOperation
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CDrmMsgWatcherObserver::ProgressL()
+    {
+    if ( !iProgress )
+        {
+        iProgress = HBufC8::NewL( KiProgressBufferSize );
+        }
+    return *iProgress;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMsgEditorServerWatchingOperation::FinalProgress
+// From CMsvOperation
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CDrmMsgWatcherObserver::FinalProgress()
+    {
+    return *iProgress;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDrmMsgWatcherObserver::RunL
+// From CActive
+// -----------------------------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::RunL()
+    {
+    CompleteObserver( iStatus.Int( ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDrmMsgWatcherObserver::Start
+//
+// -----------------------------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::Start()
+    {
+    CActiveScheduler::Add( this );
+    iStatus = KRequestPending;
+    SetActive();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDrmMsgWatcherObserver::CompleteObserver
+// Completes observer with the completion code
+// -----------------------------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::CompleteObserver( TInt aCode )
+    {
+    TRequestStatus* status = &iObserverRequestStatus;
+    
+    if( ( *status ) == KRequestPending )
+        {
+        User::RequestComplete( status, aCode );
+        }
+    }
+
+
+
+// ---------------------------------------------------------
+// CDrmMsgWatcherObserver::HandleServerAppExit
+// ---------------------------------------------------------
+//
+void CDrmMsgWatcherObserver::HandleServerAppExit( TInt aReason )
+	{
+    TInt exitMode = aReason;
+    if ( iStatus == KRequestPending )
+    	{
+    	TRequestStatus* pstat = &iStatus;
+    	User::RequestComplete( pstat, exitMode );
+    	}
+	MAknServerAppExitObserver::HandleServerAppExit( aReason );	
+	}
+
+// End of file
--- a/wmdrm/wmdrmengine/asf/src/asf.cpp	Tue Jul 13 13:57:53 2010 +0100
+++ b/wmdrm/wmdrmengine/asf/src/asf.cpp	Mon Aug 23 13:37:15 2010 +0100
@@ -86,6 +86,11 @@
     TInt aOffset,
     TInt aLength );
 
+LOCAL_C HBufC16* HBuf16IgnoreNullL(
+    const TDesC8& aBlock,
+    TInt aOffset,
+    TInt aLength );
+
 LOCAL_C TUint32 ReadUint64FromBlockL( const TDesC8& aBlock, TInt aOffset )
     {
     if ( aBlock.Length() <= ( aOffset + 3 ) )
@@ -140,6 +145,33 @@
 	return buffer;
     }
 
+LOCAL_C HBufC16* HBuf16IgnoreNullL(
+    const TDesC8& aBlock,
+    TInt aOffset,
+    TInt aLength )
+    {
+    if ( aBlock.Length() < ( aOffset + aLength ) )
+        {
+        User::Leave( KErrArgument );
+        }
+    HBufC16* buffer( HBufC16::NewL( aLength / 2 + 1 ) );
+    TPtr ptr( buffer->Des() );
+    
+    for ( TInt i( 0 ) ; i < aLength; i+=2 )
+        {
+        ptr.Append( aBlock[aOffset + i] );
+        }
+    
+    TInt dLength = ptr.Length();
+    
+    if ( dLength != 0 && ptr[dLength - 1] == '\0' )
+        {
+        ptr.SetLength( dLength - 1 );
+        }
+    
+    return buffer;
+    }
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -582,15 +614,19 @@
         User::Leave( KErrOverflow );
         }
 
-    iTitle = HBuf16FromBlockL( *iHeaderData, offset, iTitleLength );
+    iTitle = HBuf16IgnoreNullL( *iHeaderData, offset, iTitleLength );
     offset += iTitleLength;
-    iAuthor = HBuf16FromBlockL( *iHeaderData, offset, iAuthorLength );
+    
+    iAuthor = HBuf16IgnoreNullL( *iHeaderData, offset, iAuthorLength );
     offset += iAuthorLength;
-    iCopyright = HBuf16FromBlockL( *iHeaderData, offset, iCopyrightLength );
+    
+    iCopyright = HBuf16IgnoreNullL( *iHeaderData, offset, iCopyrightLength );
     offset += iCopyrightLength;
-    iDescription = HBuf16FromBlockL( *iHeaderData, offset, iDescriptionLength );
+    
+    iDescription = HBuf16IgnoreNullL( *iHeaderData, offset, iDescriptionLength );
     offset += iDescriptionLength;
-    iRating = HBuf16FromBlockL( *iHeaderData, offset, iRatingLength );
+    
+    iRating = HBuf16IgnoreNullL( *iHeaderData, offset, iRatingLength );
     offset += iRatingLength;
     }