# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273584518 -10800 # Node ID 457cd4423b8cff907640a93f91a79ee8b5cd7811 # Parent 04da681812a98ddbd926e14c6a61d19800026da0 Revision: 201017 Kit: 201019 diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmsettingsplugin/data/drmsettingspluginrsc.rss --- a/commondrm/drmsettingsplugin/data/drmsettingspluginrsc.rss Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmsettingsplugin/data/drmsettingspluginrsc.rss Tue May 11 16:28:38 2010 +0300 @@ -250,6 +250,27 @@ }; } +//---------------------------------------------------- +// +// r_drm_settings_lbx_no_oma2 +// DRM Settings view's listbox when OMA DRM version +// 2 is configured not to be supported. +// +//---------------------------------------------------- +// +RESOURCE DRM_SETTINGS_FEATURE_ARRAY r_drm_settings_lbx_no_oma2 + { + items = + { + DRM_SETTINGS_FEATURE + { + txt = " \t"qtn_drm_set_license_deletion"\t\t"; + item = EDRMSettingsIdWMDRMLicenseDeletion; + } + }; + } + + //---------------------------------------------------- // diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmsettingsplugin/inc/drmsettingsplugin.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugin.h Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmsettingsplugin/inc/drmsettingsplugin.h Tue May 11 16:28:38 2010 +0300 @@ -181,6 +181,10 @@ RConeResourceLoader iResourceLoader; TBool iWmdrmSupported; + + // Oma drm 2 run-time support + TBool iOmadrm2Supported; + }; #endif //DRMSETTINGSPLUGIN_H diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmsettingsplugin/inc/drmsettingsplugincontainer.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugincontainer.h Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmsettingsplugin/inc/drmsettingsplugincontainer.h Tue May 11 16:28:38 2010 +0300 @@ -45,7 +45,8 @@ */ void ConstructL( const TRect& aRect ); - CDRMSettingsPluginContainer( TBool aWmdrmSupported ); + CDRMSettingsPluginContainer( TBool aWmdrmSupported, + TBool aOmadrmSupported ); /** * Destructor. @@ -100,7 +101,12 @@ // Model for DRMSettingsPlugin. CDRMSettingsModel* iModel; + TBool iWmdrmSupported; + + // Oma drm 2 is configured to be supported. + TBool iOmadrm2Supported; + }; #endif //DRMSETTINGSPLUGINCONTAINER_H diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmsettingsplugin/src/drmsettingsplugin.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsplugin.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmsettingsplugin/src/drmsettingsplugin.cpp Tue May 11 16:28:38 2010 +0300 @@ -82,6 +82,21 @@ void CDRMSettingsPlugin::ConstructL() { FeatureManager::InitializeLibL(); + + if ( FeatureManager::FeatureSupported( KFeatureIdWindowsMediaDrm ) ) + { + iWmdrmSupported = ETrue; + } + + if ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + iOmadrm2Supported = ETrue; + } + else + { + iOmadrm2Supported = EFalse; + } + // Find the resource file TParse parse; parse.Set( KDRMSettingsPluginResourceFileName, @@ -97,10 +112,6 @@ BaseConstructL( R_DRM_SETTINGS_VIEW ); - if ( FeatureManager::FeatureSupported( KFeatureIdWindowsMediaDrm ) ) - { - iWmdrmSupported = ETrue; - } } @@ -195,24 +206,27 @@ { #ifdef __DRM_OMA2 case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( EFalse ); - + if ( iOmadrm2Supported ) + { + UpdateTransactionTrackingSettingL( EFalse ); + } break; #ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( EFalse ); - + if ( iOmadrm2Supported ) + { + UpdateAutomaticActivationSettingL( EFalse ); + } break; #endif // RD_DRM_SILENT_RIGHTS_ACQUISITION #ifdef RD_DRM_METERING case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - + if ( iOmadrm2Supported ) + { + UpdateUsageReportingSettingL(); + } break; #endif // RD_DRM_METERING #endif // __DRM_OMA2 @@ -241,24 +255,26 @@ { #ifdef __DRM_OMA2 case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( ETrue ); - + if ( iOmadrm2Supported ) + { + UpdateTransactionTrackingSettingL( ETrue ); + } break; - #ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( ETrue ); - + if ( iOmadrm2Supported ) + { + UpdateAutomaticActivationSettingL( ETrue ); + } break; #endif // RD_DRM_SILENT_RIGHTS_ACQUISITION #ifdef RD_DRM_METERING case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - + if ( iOmadrm2Supported ) + { + UpdateUsageReportingSettingL(); + } break; #endif // RD_DRM_METERING #endif // __DRM_OMA2 @@ -338,14 +354,16 @@ // void CDRMSettingsPlugin::NewContainerL() { - iContainer = new( ELeave ) CDRMSettingsPluginContainer( iWmdrmSupported ); + iContainer = new( ELeave ) CDRMSettingsPluginContainer( iWmdrmSupported, + iOmadrm2Supported ); } // --------------------------------------------------------------------------- // CDRMSettingsPlugin::HandleListBoxSelectionL() // -// Handles events raised through a rocker key. +// Handles events raised through a rocker key. Checks the run-time support of +// Oma Drm 2 when needed. // --------------------------------------------------------------------------- void CDRMSettingsPlugin::HandleListBoxSelectionL() { @@ -355,24 +373,26 @@ { #ifdef __DRM_OMA2 case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( EFalse ); - + if ( iOmadrm2Supported ) + { + UpdateTransactionTrackingSettingL( EFalse ); + } break; - #ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( EFalse ); - + if ( iOmadrm2Supported ) + { + UpdateAutomaticActivationSettingL( EFalse ); + } break; #endif // RD_DRM_SILENT_RIGHTS_ACQUISITION #ifdef RD_DRM_METERING case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - + if ( iOmadrm2Supported ) + { + UpdateUsageReportingSettingL(); + } break; #endif // RD_DRM_METERING #endif // __DRM_OMA2 @@ -707,20 +727,21 @@ { User::LeaveIfNull( aMenuPane ); -#ifdef __DRM_OMA2 - if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + if( FeatureManager::FeatureSupported( KFeatureIdDrmOma2 ) ) { - aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } } else { aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); } -#else - - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); - -#endif // __DRM_OMA2 } } diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmsettingsplugin/src/drmsettingsplugincontainer.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsplugincontainer.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmsettingsplugin/src/drmsettingsplugincontainer.cpp Tue May 11 16:28:38 2010 +0300 @@ -42,7 +42,17 @@ { iListBox = new( ELeave ) CAknSettingStyleListBox; iModel = CDRMSettingsModel::NewL(); - BaseConstructL( aRect, R_DRM_SETTINGS_VIEW_TITLE, R_DRM_SETTINGS_LBX ); + + if( iOmadrm2Supported ) + { + BaseConstructL( aRect, R_DRM_SETTINGS_VIEW_TITLE, + R_DRM_SETTINGS_LBX ); + } + else + { + BaseConstructL( aRect, R_DRM_SETTINGS_VIEW_TITLE, + R_DRM_SETTINGS_LBX_NO_OMA2 ); + } } // --------------------------------------------------------------------------- @@ -51,9 +61,11 @@ // Constructor // --------------------------------------------------------------------------- // -CDRMSettingsPluginContainer::CDRMSettingsPluginContainer( - TBool aWmdrmSupported ) : iWmdrmSupported( aWmdrmSupported ) - { +CDRMSettingsPluginContainer::CDRMSettingsPluginContainer( + TBool aWmdrmSupported, + TBool aOmadrm2Supported ) : iWmdrmSupported( aWmdrmSupported ), + iOmadrm2Supported( aOmadrm2Supported ) + { } // --------------------------------------------------------------------------- @@ -104,8 +116,10 @@ void CDRMSettingsPluginContainer::CreateListBoxItemsL() { #ifdef __DRM_OMA2 - MakeTransactionTrackingItemL(); - + if( iOmadrm2Supported ) + { + MakeTransactionTrackingItemL(); + #ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION MakeAutomaticActivationItemL(); #endif // RD_DRM_SILENT_RIGHTS_ACQUISITION @@ -113,6 +127,7 @@ #ifdef RD_DRM_METERING MakeUsageReportingItemL(); #endif // RD_DRM_METERING + } #endif // __DRM_OMA2 @@ -132,18 +147,27 @@ { #ifdef __DRM_OMA2 case EDRMSettingsIdTransactionTracking: - MakeTransactionTrackingItemL(); + if( iOmadrm2Supported ) + { + MakeTransactionTrackingItemL(); + } break; #ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION case EDRMSettingsIdAutomaticActivation: - MakeAutomaticActivationItemL(); - break; + if( iOmadrm2Supported ) + { + MakeAutomaticActivationItemL(); + } + break; #endif // RD_DRM_SILENT_RIGHTS_ACQUISITION #ifdef RD_DRM_METERING case EDRMSettingsIdUsageReporting: - MakeUsageReportingItemL(); + if( iOmadrm2Supported ) + { + MakeUsageReportingItemL(); + } break; #endif // RD_DRM_METERING #endif // __DRM_OMA2 diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/bwinscw/drmutilitycommonu.def --- a/commondrm/drmutility/bwinscw/drmutilitycommonu.def Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/bwinscw/drmutilitycommonu.def Tue May 11 16:28:38 2010 +0300 @@ -1,23 +1,24 @@ EXPORTS - ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXAAVTDesC16@@HABV3@H@Z @ 1 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(class TDesC16 &, int, class TDesC16 const &, int) - ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXH@Z @ 2 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int) - ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXHABVTDesC16@@@Z @ 3 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int, class TDesC16 const &) - ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXHH@Z @ 4 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int, int) - ?DisplayPopupWindowsForPreviewL@CDrmUtilityUI@DRM@@QAEHAAVCData@ContentAccess@@HH@Z @ 5 NONAME ; int DRM::CDrmUtilityUI::DisplayPopupWindowsForPreviewL(class ContentAccess::CData &, int, int) - ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHAAVTDesC16@@H@Z @ 6 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(class TDesC16 &, int) - ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHHABVTDesC16@@@Z @ 7 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(int, class TDesC16 const &) + ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXHABVTDesC16@@@Z @ 1 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int, class TDesC16 const &) + ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHAAVTDesC16@@H@Z @ 2 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(class TDesC16 &, int) + ?SetAutomatedQueryL@CDrmUtilityUI@DRM@@QAEHPAVCDRMConstraint@@@Z @ 3 NONAME ; int DRM::CDrmUtilityUI::SetAutomatedQueryL(class CDRMConstraint *) + ?NewL@CDrmUtilityUI@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 4 NONAME ; class DRM::CDrmUtilityUI * DRM::CDrmUtilityUI::NewL(class CCoeEnv *) + ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHHH@Z @ 5 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(int, int) + ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXAAVTDesC16@@HABV3@H@Z @ 6 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(class TDesC16 &, int, class TDesC16 const &, int) + ?NewL@CDrmUtilityWMDrm@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 7 NONAME ; class DRM::CDrmUtilityWMDrm * DRM::CDrmUtilityWMDrm::NewL(class CCoeEnv *) ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHHABVTDesC16@@HHH@Z @ 8 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(int, class TDesC16 const &, int, int, int) - ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHHH@Z @ 9 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(int, int) - ?DisplayQueryWithIdL@CDrmUtilityUI@DRM@@QAEHHH@Z @ 10 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryWithIdL(int, int) - ?DisplayQueryWithIdValueL@CDrmUtilityUI@DRM@@QAEHHHABVTDesC16@@@Z @ 11 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryWithIdValueL(int, int, class TDesC16 const &) - ?GetOmaRightsStatusL@CDrmUtilityCommon@DRM@@QAE?AW4TDrmRightsInfo@2@AAPAVHBufC8@@W4TIntent@ContentAccess@@PAVCDRMConstraint@@@Z @ 12 NONAME ; enum DRM::TDrmRightsInfo DRM::CDrmUtilityCommon::GetOmaRightsStatusL(class HBufC8 * &, enum ContentAccess::TIntent, class CDRMConstraint *) - ?GetWrapper@CDrmUtilityWMDrm@DRM@@QAEPAVMDrmUtilityWMDrmWrapper@2@XZ @ 13 NONAME ; class DRM::MDrmUtilityWMDrmWrapper * DRM::CDrmUtilityWMDrm::GetWrapper(void) - ?NewL@CDrmUtilityCommon@DRM@@SAPAV12@XZ @ 14 NONAME ; class DRM::CDrmUtilityCommon * DRM::CDrmUtilityCommon::NewL(void) - ?NewL@CDrmUtilityUI@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 15 NONAME ; class DRM::CDrmUtilityUI * DRM::CDrmUtilityUI::NewL(class CCoeEnv *) - ?NewL@CDrmUtilityWMDrm@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 16 NONAME ; class DRM::CDrmUtilityWMDrm * DRM::CDrmUtilityWMDrm::NewL(class CCoeEnv *) - ?NewLC@CDrmUtilityCommon@DRM@@SAPAV12@XZ @ 17 NONAME ; class DRM::CDrmUtilityCommon * DRM::CDrmUtilityCommon::NewLC(void) - ?NewLC@CDrmUtilityUI@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 18 NONAME ; class DRM::CDrmUtilityUI * DRM::CDrmUtilityUI::NewLC(class CCoeEnv *) - ?NewLC@CDrmUtilityWMDrm@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 19 NONAME ; class DRM::CDrmUtilityWMDrm * DRM::CDrmUtilityWMDrm::NewLC(class CCoeEnv *) - ?SetAutomatedQueryL@CDrmUtilityUI@DRM@@QAEHPAVCDRMConstraint@@@Z @ 20 NONAME ; int DRM::CDrmUtilityUI::SetAutomatedQueryL(class CDRMConstraint *) - ?ShowFutureRightsNoteL@CDrmUtilityUI@DRM@@QAEXPAVCDRMConstraint@@@Z @ 21 NONAME ; void DRM::CDrmUtilityUI::ShowFutureRightsNoteL(class CDRMConstraint *) + ?NewLC@CDrmUtilityWMDrm@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 9 NONAME ; class DRM::CDrmUtilityWMDrm * DRM::CDrmUtilityWMDrm::NewLC(class CCoeEnv *) + ?DisplayQueryWithIdValueL@CDrmUtilityUI@DRM@@QAEHHHABVTDesC16@@@Z @ 10 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryWithIdValueL(int, int, class TDesC16 const &) + ?ShowFutureRightsNoteL@CDrmUtilityUI@DRM@@QAEXPAVCDRMConstraint@@@Z @ 11 NONAME ; void DRM::CDrmUtilityUI::ShowFutureRightsNoteL(class CDRMConstraint *) + ?NewL@CDrmUtilityCommon@DRM@@SAPAV12@XZ @ 12 NONAME ; class DRM::CDrmUtilityCommon * DRM::CDrmUtilityCommon::NewL(void) + ?NewLC@CDrmUtilityCommon@DRM@@SAPAV12@XZ @ 13 NONAME ; class DRM::CDrmUtilityCommon * DRM::CDrmUtilityCommon::NewLC(void) + ?DisplayPopupWindowsForPreviewL@CDrmUtilityUI@DRM@@QAEHAAVCData@ContentAccess@@HH@Z @ 14 NONAME ; int DRM::CDrmUtilityUI::DisplayPopupWindowsForPreviewL(class ContentAccess::CData &, int, int) + ?GetOmaRightsStatusL@CDrmUtilityCommon@DRM@@QAE?AW4TDrmRightsInfo@2@AAPAVHBufC8@@W4TIntent@ContentAccess@@PAVCDRMConstraint@@@Z @ 15 NONAME ; enum DRM::TDrmRightsInfo DRM::CDrmUtilityCommon::GetOmaRightsStatusL(class HBufC8 * &, enum ContentAccess::TIntent, class CDRMConstraint *) + ?DisplayQueryWithIdL@CDrmUtilityUI@DRM@@QAEHHH@Z @ 16 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryWithIdL(int, int) + ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXH@Z @ 17 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int) + ?DisplayMessageQueryL@CDrmUtilityUI@DRM@@QAEHHHABVTDesC16@@@Z @ 18 NONAME ; int DRM::CDrmUtilityUI::DisplayMessageQueryL(int, int, class TDesC16 const &) + ?DisplayNoteL@CDrmUtilityUI@DRM@@QAEXHH@Z @ 19 NONAME ; void DRM::CDrmUtilityUI::DisplayNoteL(int, int) + ?NewLC@CDrmUtilityUI@DRM@@SAPAV12@PAVCCoeEnv@@@Z @ 20 NONAME ; class DRM::CDrmUtilityUI * DRM::CDrmUtilityUI::NewLC(class CCoeEnv *) + ?DisplayQueryL@CDrmUtilityUI@DRM@@QAEHHABVTDesC16@@@Z @ 21 NONAME ; int DRM::CDrmUtilityUI::DisplayQueryL(int, class TDesC16 const &) + ?GetWrapper@CDrmUtilityWMDrm@DRM@@QAEPAVMDrmUtilityWMDrmWrapper@2@XZ @ 22 NONAME ; class DRM::MDrmUtilityWMDrmWrapper * DRM::CDrmUtilityWMDrm::GetWrapper(void) diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/data/drmutility.rss --- a/commondrm/drmutility/data/drmutility.rss Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/data/drmutility.rss Tue May 11 16:28:38 2010 +0300 @@ -21,11 +21,15 @@ // INCLUDES #include -#include +#include #include -#include +#include +#include +#include #include -#include +#include +#include +#include #include @@ -597,4 +601,56 @@ #endif // RD_DRM_PREVIEW_RIGHT_FOR_AUDIO +// ----------------------------------------------------------------------------- +// r_drmutility_sync_with_pc +// Text displayed if WMDRM Direct License Acquisition is supported to +// notify user that license needs to be aquired with PC sync. +// ----------------------------------------------------------------------------- +RESOURCE TBUF r_drmutility_sync_with_pc + { + buf = qtn_drm_sync_with_pc; + } + +// ----------------------------------------------------------------------------- +// r_drmutility_sync_with_pc_header +// Header displayed if WMDRM Direct License Acquisition is supported to +// notify user that license needs to be aquired with PC sync. +// ----------------------------------------------------------------------------- +RESOURCE TBUF r_drmutility_head_no_license + { + buf = qtn_drm_msg_qry_head_no_license; + } + +//------------------------------------------------------------------------------ +// +// r_drmutility_sync_dialog +// Shows the user a dialog that license needs to be synced with pc +// +//------------------------------------------------------------------------------ +// +RESOURCE DIALOG r_drmutility_sync_dialog + { + flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items = + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + }; + } + }; + + } // End of File diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/eabi/drmutilitycommonu.def --- a/commondrm/drmutility/eabi/drmutilitycommonu.def Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/eabi/drmutilitycommonu.def Tue May 11 16:28:38 2010 +0300 @@ -9,15 +9,16 @@ _ZN3DRM13CDrmUtilityUI13DisplayQueryLEii @ 8 NONAME _ZN3DRM13CDrmUtilityUI18SetAutomatedQueryLEP14CDRMConstraint @ 9 NONAME _ZN3DRM13CDrmUtilityUI19DisplayQueryWithIdLEii @ 10 NONAME - _ZN3DRM13CDrmUtilityUI21ShowFutureRightsNoteLEP14CDRMConstraint @ 11 NONAME - _ZN3DRM13CDrmUtilityUI24DisplayQueryWithIdValueLEiiRK7TDesC16 @ 12 NONAME - _ZN3DRM13CDrmUtilityUI30DisplayPopupWindowsForPreviewLERN13ContentAccess5CDataEii @ 13 NONAME - _ZN3DRM13CDrmUtilityUI4NewLEP7CCoeEnv @ 14 NONAME - _ZN3DRM13CDrmUtilityUI5NewLCEP7CCoeEnv @ 15 NONAME - _ZN3DRM16CDrmUtilityWMDrm10GetWrapperEv @ 16 NONAME - _ZN3DRM16CDrmUtilityWMDrm4NewLEP7CCoeEnv @ 17 NONAME - _ZN3DRM16CDrmUtilityWMDrm5NewLCEP7CCoeEnv @ 18 NONAME - _ZN3DRM17CDrmUtilityCommon19GetOmaRightsStatusLERP6HBufC8N13ContentAccess7TIntentEP14CDRMConstraint @ 19 NONAME - _ZN3DRM17CDrmUtilityCommon4NewLEv @ 20 NONAME - _ZN3DRM17CDrmUtilityCommon5NewLCEv @ 21 NONAME + _ZN3DRM13CDrmUtilityUI20DisplayMessageQueryLEiiRK7TDesC16 @ 11 NONAME + _ZN3DRM13CDrmUtilityUI21ShowFutureRightsNoteLEP14CDRMConstraint @ 12 NONAME + _ZN3DRM13CDrmUtilityUI24DisplayQueryWithIdValueLEiiRK7TDesC16 @ 13 NONAME + _ZN3DRM13CDrmUtilityUI30DisplayPopupWindowsForPreviewLERN13ContentAccess5CDataEii @ 14 NONAME + _ZN3DRM13CDrmUtilityUI4NewLEP7CCoeEnv @ 15 NONAME + _ZN3DRM13CDrmUtilityUI5NewLCEP7CCoeEnv @ 16 NONAME + _ZN3DRM16CDrmUtilityWMDrm10GetWrapperEv @ 17 NONAME + _ZN3DRM16CDrmUtilityWMDrm4NewLEP7CCoeEnv @ 18 NONAME + _ZN3DRM16CDrmUtilityWMDrm5NewLCEP7CCoeEnv @ 19 NONAME + _ZN3DRM17CDrmUtilityCommon19GetOmaRightsStatusLERP6HBufC8N13ContentAccess7TIntentEP14CDRMConstraint @ 20 NONAME + _ZN3DRM17CDrmUtilityCommon4NewLEv @ 21 NONAME + _ZN3DRM17CDrmUtilityCommon5NewLCEv @ 22 NONAME diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/group/drmutilitywmdrmwrapper.mmp --- a/commondrm/drmutility/group/drmutilitywmdrmwrapper.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/group/drmutilitywmdrmwrapper.mmp Tue May 11 16:28:38 2010 +0300 @@ -37,6 +37,12 @@ // Default system include paths for application layer modules. APP_LAYER_SYSTEMINCLUDE +START RESOURCE ../data/drmutility.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + LIBRARY aknnotify.lib LIBRARY apparc.lib // for launching rights mgr ui embedded LIBRARY euser.lib @@ -52,6 +58,7 @@ LIBRARY servicehandler.lib LIBRARY drmserverinterfaces.lib // DrmClockClient LIBRARY drmrights.lib +LIBRARY featdiscovery.lib DOCUMENT bld.inf diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/inc/DrmUtilityGlobalNoteWrapper.h --- a/commondrm/drmutility/inc/DrmUtilityGlobalNoteWrapper.h Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/inc/DrmUtilityGlobalNoteWrapper.h Tue May 11 16:28:38 2010 +0300 @@ -23,6 +23,7 @@ // INCLUDES #include #include +#include namespace DRM { @@ -102,6 +103,16 @@ TInt aValuePos = -1 ); /** + * Asynchronous wrapper for showing global message query. + * @param aMessageResourceId resource id of string to be displayed + * @param aHeaderResourceId resource id of header to be displayed in the query + * @param aString string that replaces %U in resource string + */ + void ShowMessageQueryL(TInt aMessageResourceId, + TInt aHeaderResourceId, + const TDesC& aString); + + /** * Synchronous wrapper for showing global preview list query. * @param aTextResourceId resource id of preview structure to be * displayed @@ -147,6 +158,13 @@ // Resource id of buttons in confirmation query TInt iButtonsId; + + // AVKON Global message query, used in method ShowMessageQueryL, activated asynchronously so needs to be owned + CAknGlobalMsgQuery* iGlobalMsgQuery; + // Message buffer for the global message query, contains dialog text with replaced string + TBuf iFinalMessageBuffer; + // Message buffer for the global message query header text + TBuf iHeaderBuffer; }; } diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/inc/drmutilityui.h --- a/commondrm/drmutility/inc/drmutilityui.h Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/inc/drmutilityui.h Tue May 11 16:28:38 2010 +0300 @@ -24,6 +24,8 @@ #include #include +#include "DrmUtilityGlobalNoteWrapper.h" + //*** forward declarations go here: class CDRMConstraint; class CCoeEnv; @@ -123,8 +125,18 @@ ContentAccess::CData& aContent, TInt aPreviewType, TInt aMediaType ); + + /* + * Utility method for showing an AVKON Message Query dialog, with buttons R_AVKON_SOFTKEYS_OK_EMPTY__OK. + * + * @param aMessage Resource ID for the dialog message. + * @param aHeader Resource ID for the dialog header. + * @param aString Replacement string for dialog message content. Replaces aMessage resources strings %U mark. + * @return Returns button code TInt from the dialog. + */ - + IMPORT_C TInt DisplayMessageQueryL( TInt aMessage, TInt aHeader, const TDesC& aString ); + protected: private: @@ -174,6 +186,8 @@ RPointerArray iNoteList; CMediatorEventProvider* iEventProvider; + + CDrmUtilityGlobalNoteWrapper* iNoteWrapper; }; } diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/inc/drmutilitywmdrmwrapper.h --- a/commondrm/drmutility/inc/drmutilitywmdrmwrapper.h Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/inc/drmutilitywmdrmwrapper.h Tue May 11 16:28:38 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -213,6 +213,7 @@ RLibrary iDlaWrapperDll; CWmDrmDlaWrapper* iDlaWrapper; + TBool iWmDrmDlaSupportOn; }; } diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/loc/DRMUtility.loc --- a/commondrm/drmutility/loc/DRMUtility.loc Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/loc/DRMUtility.loc Tue May 11 16:28:38 2010 +0300 @@ -160,3 +160,10 @@ //r: 9.1 // #define qtn_drm_msg_qry_head_no_license "No license" + +//d: Text in message query to notify user that the DRM license needs to be acquired with PC sync. +//l: popup_note_window +//w: +//r: 9.2 +// +#define qtn_drm_sync_with_pc "You must have valid license to play %U. Please sync your phone with your PC to update license." diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp --- a/commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp Tue May 11 16:28:38 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include // EAknSoftkeyNo #include @@ -89,6 +90,7 @@ DRM::CDrmUtilityGlobalNoteWrapper::~CDrmUtilityGlobalNoteWrapper() { Cancel(); // Cancel active object + delete iGlobalMsgQuery; } // ----------------------------------------------------------------------------- @@ -182,6 +184,32 @@ } // ----------------------------------------------------------------------------- +// CDrmUtilityGlobalNoteWrapper::ShowNoteL +// ----------------------------------------------------------------------------- +// +void DRM::CDrmUtilityGlobalNoteWrapper::ShowMessageQueryL( + TInt aMessageResourceId, + TInt aHeaderResourceId, + const TDesC& aString) + { + TBuf messageBuffer( + iResourceReader->ReadResourceString( aMessageResourceId ) ); + + StringLoader::Format( iFinalMessageBuffer, messageBuffer, -1, aString ); + + iHeaderBuffer = iResourceReader->ReadResourceString( aHeaderResourceId ); + + CAknGlobalMsgQuery* iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); + + iStatus = KRequestPending; + iGlobalMsgQuery->ShowMsgQueryL(iStatus, iFinalMessageBuffer, + R_AVKON_SOFTKEYS_OK_EMPTY, iHeaderBuffer, KNullDesC); + + SetActive(); + iWait.Start(); + } + +// ----------------------------------------------------------------------------- // CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL // ----------------------------------------------------------------------------- // @@ -305,6 +333,10 @@ void DRM::CDrmUtilityGlobalNoteWrapper::RunL() { iWait.AsyncStop(); + if(iGlobalMsgQuery) + { + iGlobalMsgQuery->CancelMsgQuery(); + } } // ----------------------------------------------------------------------------- diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/src/drmutilityui.cpp --- a/commondrm/drmutility/src/drmutilityui.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/src/drmutilityui.cpp Tue May 11 16:28:38 2010 +0300 @@ -32,6 +32,7 @@ #include #include #include +#include // secondary display support #include @@ -231,6 +232,8 @@ iNoteList.Close(); FeatureManager::UnInitializeLib(); + delete iNoteWrapper; + } // ----------------------------------------------------------------------------- @@ -769,6 +772,39 @@ #endif // RD_DRM_PREVIEW_RIGHT_FOR_AUDIO +EXPORT_C TInt DRM::CDrmUtilityUI::DisplayMessageQueryL( TInt aMessage, TInt aHeader, const TDesC& aString) + { + TInt buttonCode = 0; + if ( iCoeEnv ) + { + CAknMessageQueryDialog* messageQuery = new (ELeave) CAknMessageQueryDialog(); + messageQuery->PrepareLC(R_DRMUTILITY_SYNC_DIALOG); + + HBufC* headerStringholder ( StringLoader::LoadLC( aHeader, iCoeEnv ) ); + + messageQuery->QueryHeading()->SetTextL(*headerStringholder); + CleanupStack::PopAndDestroy(); // headerStringholder + + HBufC* messageStringholder ( StringLoader::LoadLC( aMessage, aString, iCoeEnv ) ); + + messageQuery->SetMessageTextL(*messageStringholder); + CleanupStack::PopAndDestroy(); // messageStringholder + + buttonCode = messageQuery->RunLD(); + } + else + { + if(!iNoteWrapper) + { + iNoteWrapper = DRM::CDrmUtilityGlobalNoteWrapper::NewL( iUtilityStringResourceReader ); + } + + iNoteWrapper->ShowMessageQueryL(aMessage, aHeader, aString); + } + return buttonCode; + } + + // ----------------------------------------------------------------------------- // CDrmUtilityUI::CreateNoteForResourceL // ----------------------------------------------------------------------------- diff -r 04da681812a9 -r 457cd4423b8c commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp --- a/commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp Tue May 11 16:28:38 2010 +0300 @@ -41,6 +41,9 @@ #include #endif +#include +#include + #include // for WMDRM file details view #include #include @@ -59,6 +62,8 @@ #include "wmdrmdlawrapper.h" +using namespace DRM; + // CONSTANTS const TInt KMaxUrlLength( 1024 ); const TInt KMaxUrlSanityLength( 102400 ); @@ -85,7 +90,8 @@ // DRM::CDrmUtilityWMDrmWrapper::CDrmUtilityWMDrmWrapper() : iCoeEnv( NULL ), - iDrmUtilityUi( NULL ) + iDrmUtilityUi( NULL ), + iWmDrmDlaSupportOn ( ETrue ) { } @@ -97,6 +103,8 @@ void DRM::CDrmUtilityWMDrmWrapper::ConstructL() { User::LeaveIfError( iFs.Connect() ); + TUid u = TUid::Uid( KFeatureIdFfWmdrmDlaSupport ); + TRAPD(err, iWmDrmDlaSupportOn = CFeatureDiscovery::IsFeatureSupportedL( u )); } // ----------------------------------------------------------------------------- @@ -569,10 +577,16 @@ } TFileName fileName; User::LeaveIfError( aContent.GetStringAttribute( DRM::EDrmFileName, fileName ) ); - ret = iDrmUtilityUi->DisplayQueryL( R_DRM_QUERY_EXPIRED_OR_NO_RO, fileName ); + if(iWmDrmDlaSupportOn) + { + ret = iDrmUtilityUi->DisplayQueryL( R_DRM_QUERY_EXPIRED_OR_NO_RO, fileName ); + } + else + { + ret = iDrmUtilityUi->DisplayMessageQueryL( R_DRMUTILITY_SYNC_WITH_PC, R_DRMUTILITY_HEAD_NO_LICENSE, fileName); + } } - - if ( !err && ( ret == EAknSoftkeyYes || ret == EAknSoftkeyOk ) ) + if ( !err && ( ret == EAknSoftkeyYes || ret == EAknSoftkeyOk ) && iWmDrmDlaSupportOn) { TRAP_IGNORE( DlaLicenseAcquisitionL( file ) ); } @@ -763,18 +777,31 @@ void DRM::CDrmUtilityWMDrmWrapper::DlaLicenseAcquisitionL( RFile& aFile ) { - TInt iapId( 0 ); - HBufC* contentUrl( NULL ); - HBufC* htmlData( NULL ); - LoadDlaWrapperL(); - TRAPD( err, iapId = DefaultAccessPointL() ); - if ( !err ) + if( iWmDrmDlaSupportOn ) { - iDlaWrapper->SetIapId( iapId ); + TInt iapId( 0 ); + HBufC* contentUrl( NULL ); + HBufC* htmlData( NULL ); + LoadDlaWrapperL(); + TRAPD( err, iapId = DefaultAccessPointL() ); + if ( !err ) + { + iDlaWrapper->SetIapId( iapId ); + } + iDlaWrapper->AcquireLicenseL( aFile, contentUrl, htmlData ); + delete contentUrl; + delete htmlData; } - iDlaWrapper->AcquireLicenseL( aFile, contentUrl, htmlData ); - delete contentUrl; - delete htmlData; + else + { + if ( !iDrmUtilityUi ) + { + iDrmUtilityUi = DRM::CDrmUtilityUI::NewL( iCoeEnv ); + } + TFileName aFileName; + TInt err = aFile.Name(aFileName); + iDrmUtilityUi->DisplayNoteL( R_DRMUTILITY_SYNC_WITH_PC , aFileName); + } } // ----------------------------------------------------------------------------- diff -r 04da681812a9 -r 457cd4423b8c commondrm/rom/DRMRightsManagerUI.iby --- a/commondrm/rom/DRMRightsManagerUI.iby Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/rom/DRMRightsManagerUI.iby Tue May 11 16:28:38 2010 +0300 @@ -21,7 +21,7 @@ // DRM Rights Manager Application -#ifdef __DRM_FULL +#if ( (defined __DRM_FULL) || (defined __WINDOWS_MEDIA_DRM) ) S60_APP_EXE(DRMRightsManager) S60_APP_BITMAP(DRMRightsManager) @@ -30,7 +30,7 @@ data=\epoc32\data\z\private\10003a3f\apps\DRMRightsManager_reg.rsc \private\10003a3f\import\apps\DRMRightsManager_reg.rsc data=ZSYSTEM\install\DRMRightsManager_stub.SIS \system\install\DRMRightsManager_stub.SIS -#endif // __DRM_FULL +#endif // __DRM_FULL || __WINDOWS_MEDIA_DRM #endif // __DRMRIGHTSMANAGERUI_IBY__ diff -r 04da681812a9 -r 457cd4423b8c commondrm/rom/DRMRightsManagerUIResources.iby --- a/commondrm/rom/DRMRightsManagerUIResources.iby Tue Apr 27 16:56:11 2010 +0300 +++ b/commondrm/rom/DRMRightsManagerUIResources.iby Tue May 11 16:28:38 2010 +0300 @@ -20,11 +20,11 @@ #define __DRMRIGHTSMANAGERUIRESOURCES_IBY__ -#ifdef __DRM_FULL +#if ( (defined __DRM_FULL) || (defined __WINDOWS_MEDIA_DRM) ) S60_APP_RESOURCE(DRMRightsManager) -#endif // __DRM_FULL +#endif // __DRM_FULL || __WINDOWS_MEDIA_DRM #endif // __DRMRIGHTSMANAGERUIRESOURCES_IBY__ diff -r 04da681812a9 -r 457cd4423b8c inc/DrmKeyStorage.h --- a/inc/DrmKeyStorage.h Tue Apr 27 16:56:11 2010 +0300 +++ b/inc/DrmKeyStorage.h Tue May 11 16:28:38 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2004 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" @@ -25,7 +25,12 @@ // CLASS DECLARATION /** -* CDrmKeyStorage: Contains key storage for OMA DRM 2.0 +* CDrmKeyStorage: Contains key storage for OMA DRM 2.x +* +* Generally the methods to the class require that a root certificate is selected. +* A specific root certificate can be selected or the default root can be selected. +* Operations needing the PKI keys should fail if the key has not been selected. +* Suggested error code: KErrNotReady * * @lib - * @since 3.0 @@ -38,53 +43,231 @@ public: // New functions + /** + * Destructor + */ + virtual ~MDrmKeyStorage() = 0; + /** + * ModulusSize + * + * Return the modulus size of the selected certificates private key. + * + * @return Modulus size of the PKI key + */ + virtual TInt ModulusSize() = 0; - + + /** + * SelectTrustedRootL + * + * Selects the trusted root certificate to be used for operation occurring after + * this call + * + * @param aRootKeyHash Hash of the root key to be used. + * @leave Symbian OS error codes + */ + virtual void SelectTrustedRootL( const TDesC8& aRootKeyHash) = 0; - + + /** + * SelectedRootIsCmla + * + * Checks if the selected root is a CMLA root + * + * @return ETrue if the selected root is a CMLA root + * EFalse if the root does not exist or is not a CMLA root + */ + virtual TBool SelectedRootIsCmla() = 0; - + + /** + * SelectDefaultRootL + * + * Selects the default root certificate of the device/keystorage implementation + * + * @leave Symbian OS error code if the root can't be selected for some reason + */ + virtual void SelectDefaultRootL() = 0; - + + /** + * GetTrustedRootsL + * + * Get a list of unique identifiers for the trusted roots of the + * device / keystorage implementation. Generally PKI public key hash values. + * + * @param aRootList A pointer array of trusted root certificate hash values + * or other unique identifiers for the certificates + * @leave Symbian OS error codes + */ + virtual void GetTrustedRootsL( RPointerArray& aRootList) = 0; - + + /** + * GetCertificateChainL + * + * Get the certificate chain of the selected certificate + * + * @param aRootList A pointer array of certificate hash values + * or other unique identifiers for the certificates + * in the certificate chain + * @leave Symbian OS error codes + */ + virtual void GetCertificateChainL( RPointerArray& aCertChain) = 0; + + /** + * RsaSignL + * + * Create an RSA signature of the buffer given + * + * @param aInput A descriptor containing the data to be signed + * @return Signed buffer. Caller is responsible for freeing it. + * @leave Symbian OS error codes + */ virtual HBufC8* RsaSignL( const TDesC8& aInput) = 0; - + + /** + * RsaDecryptL + * + * Decrypt the RSA encrypted buffer + * + * @param aInput A descriptor containing the data to be decrypted + * @return Decrypted buffer. Caller is responsible for freeing it. + * @leave Symbian OS error codes + */ + virtual HBufC8* RsaDecryptL( const TDesC8& aInput) = 0; - + + /** + * ImportDataL + * + * Allows the importing of PKI keys into the system + * Should import: Private Key, Public Certificate and all + * signing certificates for the certificate chain all the way to the root. + * + * Mostly usable for debugging purposes. Should be used with caution. + * + * @param aPrivateKey Private key of the imported PKI key. + * @param aCertificateChain Public Certificate and signing certificates + * @leave Symbian OS error codes + */ + virtual void ImportDataL( const TDesC8& aPrivateKey, const RArray& aCertificateChain) = 0; - + + /** + * GetDeviceSpecificKeyL + * + * Get the device specific key/identifier that has a length of + * KDeviceSpecificKeyLength. Must return the same value every time. + * This method must not require the root to be selected. + * + * Does not require the selection of + * + * @param aKey Buffer to fit the bytes of a device specific + * unique key / identifier. Must return the same + * value every time + * @leave Symbian OS error codes + */ + virtual void GetDeviceSpecificKeyL( TBuf8& aKey) = 0; + + /** + * GetRdbSerialNumberL + * + * This method fetches a unique serial number for the OMA DRM rights database + * currently in use. Does not have to be unique per device, but should return + * the same value while the current database is in use. + * Should create a new serial number if one does not exists. + * + * @param aSerialNumber Serial number for the OMA DRM + * rights database + * @leave Symbian OS error codes + */ virtual void GetRdbSerialNumberL( TBuf8& aSerialNumber) = 0; - + + /** + * GenerateNewRdbSerialNumberL( + * + * This method creates a new unique serial number for the OMA DRM rights database. + * Length of the serial number is defined by KRdbSerialNumberLength constant. + * Should be random and must be persisted until a new serial number is generated by + * a new call to this method. + * + * Recommend storing the serial number into the file system or other secure location. + * For example under the rightsserver.exe private directory. + * + * @leave Symbian OS error codes + */ + virtual void GenerateNewRdbSerialNumberL() = 0; - + + /** + * UdtEncryptL + * + * Encrypt the User Data Transfer data. Usable only in the user data transfer use case. + * Uses it's own User Data Transfer PKI key. + * + * @param aInput Input buffer to be encrypted + * @return Buffer encrypted with the User Data Transfer specific PKI key. + * @leave Symbian OS error codes + */ + virtual HBufC8* UdtEncryptL( const TDesC8& aInput) = 0; - + + /** + * GetRootCertificatesL + * + * Get a list of all the root certificates of the device. + * Returns actual binary format (.der) certificates. + * + * @param aRootCerts Param description + * @return Return value descriptions + * @leave Symbian OS error codes + */ + virtual void GetRootCertificatesL( RPointerArray& aRootCerts) = 0; + /** + * RandomDataGetL + * + * Get random data into the beginning of the aData buffer. + * + * @param aData A return buffer that has enough space for the aLength amount of data. + * @param aLength Amount of random data requested + * @leave Symbian OS error codes + */ + virtual void RandomDataGetL( TDes8& aData, const TInt aLength ) = 0; }; +/** +* DrmKeyStorageNewL +* +* @return Pointer to an object which implements the MDrmKeyStorage +* interface. Underlying implementation tells which +* keystorage to load if there are emulator/hw specific ones +* @leave Symbian OS error codes +*/ + IMPORT_C MDrmKeyStorage* DrmKeyStorageNewL(); #endif // DRMKEYSTORAGE_H diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Tue May 11 16:28:38 2010 +0300 @@ -29,6 +29,7 @@ #include #include #include +#include #include "Oma2Agent.h" #include "Oma2AgentAttributes.h" #include "Oma1Dcf.h" @@ -72,6 +73,20 @@ const TInt KMaxAlbumTrack = 3; const TInt KMaxRecordingYear = 6; +const TInt KAllowAllDefined = + DRM::EDrmAllowAudioAnalog | + DRM::EDrmAllowAudioFmTransmitter | + DRM::EDrmAllowAudioBluetooth | + DRM::EDrmAllowAudioUplink | + DRM::EDrmAllowVideoAnalog | + DRM::EDrmAllowVideoMacroVision | + DRM::EDrmAllowAudioUsb | + DRM::EDrmAllowAudioHdmiHdcpRequired | + DRM::EDrmAllowAudioHdmi | + DRM::EDrmAllowVideoHDMI | + DRM::EDrmAllowVideoHdmiHdcpRequested | + DRM::EDrmAllowVideoHdmiHdcpRequired; + // ============================= LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -451,7 +466,14 @@ } break; case DRM::EDrmAllowedOutputs: - value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + if( dcf2 ) + { + value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + } + else + { + value = KAllowAllDefined; + } break; default: value = KErrCANotSupported; @@ -683,7 +705,14 @@ } break; case DRM::EDrmAllowedOutputs: - value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + if( dcf2 ) + { + value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + } + else + { + value = KAllowAllDefined; + } break; case ERightsNone: if (aRightsClient == NULL) @@ -817,6 +846,7 @@ RDRMRightsClient* aRightsClient) { TInt err = KErrCANotSupported; + TInt ret = KErrNone; HBufC* b = NULL; COma1Dcf* dcf1 = NULL; COma2Dcf* dcf2 = NULL; @@ -986,14 +1016,26 @@ } break; case ERightsIssuerUrl: -#ifndef __DRM_FULL - err = KErrNotSupported; -#else - if (aDcfFile.iRightsIssuerURL != NULL) + TRAP(ret, FeatureManager::InitializeLibL()); + + if (!ret && FeatureManager::FeatureSupported(KFeatureIdFfOmadrm1FullSupport)) { - TRAP(err, b = CnvUtfConverter::ConvertToUnicodeFromUtf8L(*aDcfFile.iRightsIssuerURL)); + if (aDcfFile.iRightsIssuerURL != NULL) + { + TRAP(err, b = CnvUtfConverter::ConvertToUnicodeFromUtf8L( + *aDcfFile.iRightsIssuerURL)); + } } -#endif + else + { + err = KErrNotSupported; + } + + if (!ret) + { + FeatureManager::UnInitializeLib(); + } + break; case ETransactionTrackingId: if (dcf2 != NULL && dcf2->iTransactionTracking) diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/agentv2/src/Oma2AgentManager.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentManager.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentManager.cpp Tue May 11 16:28:38 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005 - 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" @@ -32,6 +32,7 @@ #include #include #include +#include #include "Oma2AgentManager.h" #include "Oma2AgentAttributes.h" @@ -130,7 +131,9 @@ } iOmaBasedMimeType = NULL; } - + + FeatureManager::InitializeLibL(); + } // ----------------------------------------------------------------------------- @@ -200,6 +203,8 @@ delete iWatchedId; delete iOmaBasedMimeType; + + FeatureManager::UnInitializeLib(); } // ----------------------------------------------------------------------------- @@ -723,11 +728,11 @@ TInt err = KErrNone; CDcfCommon* dcf = NULL; -#ifdef __DRM_OMA2 +#ifdef __DRM_OMA2 if ( !aFileName.Right(4).CompareF( KOma2DcfExtension ) || - !aFileName.Right(4).CompareF( KOma2DcfExtensionAudio ) || - !aFileName.Right(4).CompareF( KOma2DcfExtensionVideo ) || - COma2Dcf::IsValidDcf(aBuffer) ) + !aFileName.Right(4).CompareF( KOma2DcfExtensionAudio ) || + !aFileName.Right(4).CompareF( KOma2DcfExtensionVideo ) || + COma2Dcf::IsValidDcf(aBuffer) ) { aFileMimeType.Copy(KOma2DcfContentType); aContentMimeType.Copy(KCafMimeType); @@ -795,7 +800,11 @@ { aOutputBuffer.Copy(_L8("FL CD SD")); #ifdef __DRM_OMA2 - aOutputBuffer.Append(_L8(" OMADRM2")); + if( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + aOutputBuffer.Append(_L8(" OMADRM2")); + } #endif } break; diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/dcf/src/Oma2Dcf.cpp --- a/omadrm/drmengine/dcf/src/Oma2Dcf.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/dcf/src/Oma2Dcf.cpp Tue May 11 16:28:38 2010 +0300 @@ -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" @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include "Oma2Agent.h" @@ -291,11 +292,24 @@ const TDesC8& aDcfFragment ) { TBool r( EFalse ); + TInt err( KErrNone ); if ( aDcfFragment.Length() >= KBrandingSize && aDcfFragment.Left( KBrandingSize ).Compare( KOma2DcfBranding ) == 0 ) { - r = ETrue; + + TRAP( err, FeatureManager::InitializeLibL() ); + + if ( !err && FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + r = ETrue; + } + + if ( !err ) + { + FeatureManager::UnInitializeLib(); + } + } return r; } diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/dcfrepository/server/src/DcfRepSrv.cpp --- a/omadrm/drmengine/dcfrepository/server/src/DcfRepSrv.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/dcfrepository/server/src/DcfRepSrv.cpp Tue May 11 16:28:38 2010 +0300 @@ -726,7 +726,6 @@ { aType = ENoDcf; } - } break; case EStateSetTtid: diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/dm/src/DRMMessageParser.cpp --- a/omadrm/drmengine/dm/src/DRMMessageParser.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/dm/src/DRMMessageParser.cpp Tue May 11 16:28:38 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef RD_MULTIPLE_DRIVE #include @@ -223,6 +224,9 @@ Reset(); User::Free( const_cast< TUint8* >( iInputBuffer.Ptr() ) ); + + FeatureManager::UnInitializeLib(); + } // ----------------------------------------------------------------------------- @@ -331,6 +335,9 @@ // void CDRMMessageParser::ConstructL() { + + FeatureManager::InitializeLibL(); + // Make some extra room for crazy b64decode(). iInputBuffer.Set( reinterpret_cast< TUint8* >( User::AllocL( KInputBufferSize + 2 ) ), @@ -486,9 +493,12 @@ SetBit( EReadingHeaderPart ); res.Set( NULL, 0 ); -#ifndef __DRM_FULL - User::Leave(KErrNotSupported); -#endif + + if ( !( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm1FullSupport ) ) ) + { + User::Leave(KErrNotSupported); + } } else { diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h --- a/omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h Tue May 11 16:28:38 2010 +0300 @@ -29,8 +29,7 @@ { public: ~CGPSTimeUpdater(); - static CGPSTimeUpdater* New( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, + static CGPSTimeUpdater* New( const TPositionModuleId& aModuleId, CDRMClock* aClock ); inline const TPositionModuleId& ModuleId() { return iModuleId; } @@ -38,8 +37,7 @@ inline const TBool TimeReceived() { return iTimeReceived; } private: - CGPSTimeUpdater( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, + CGPSTimeUpdater( const TPositionModuleId& aModuleId, CDRMClock* aClock ); void ConstructL(); @@ -48,7 +46,7 @@ TInt RunError( TInt aError ); private: - RPositionServer &iPosServer; + RPositionServer iPosServer; RPositioner iPositioner; TPositionModuleId iModuleId; diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/drmclock/Inc/GPSWatcher.h --- a/omadrm/drmengine/drmclock/Inc/GPSWatcher.h Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/drmclock/Inc/GPSWatcher.h Tue May 11 16:28:38 2010 +0300 @@ -21,39 +21,52 @@ #define GPSWATCHER_H_ #include - +#include class CGPSTimeUpdater; class CDRMClock; -class CGPSWatcher : public CTimer + +class CGPSWatcher : public CTimer, public MPosIntGpsHwStatusObserver { public: ~CGPSWatcher(); static CGPSWatcher* NewL( CDRMClock* aClock ); +public: // from MPosIntGpsHwStatusObserver + /** + * Notify observer of a GPS hardware status event + * @param aStatus The GPS hardware status. + * @param aError KErrNone if successful. Other possible error values defined by RProperty::Get() + */ + void OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError); + private: CGPSWatcher( CDRMClock* aClock ); void ConstructL(); - void CheckModules(); - void Subscribe(); + void CheckSatellites(); + TInt CheckModules(); void RunL(); void DoCancel(); TInt RunError( TInt aError ); private: - RPositionServer iPosServer; - TPositionModuleStatusEvent iStatusEvent; + // owned: + RPointerArray iTimeUpdaters; - // owned - CGPSTimeUpdater *iTimeUpdater; + // not owned: + CDRMClock* iClock; - // not owned - CDRMClock* iClock; - - // Retry counter - TInt iRetryCounter; + // GPS status information: + CPosIntGpsHwStatus* iStatusUpdater; + + // status received from GPS: + CPosIntGpsHwStatus::TIntGpsHwStatus iGpsStatus; + + // List of active satellite modules: + RPointerArray iActiveSatelliteModules; + }; #endif /* GPSWATCHER_H_ */ diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp --- a/omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp Tue May 11 16:28:38 2010 +0300 @@ -26,6 +26,10 @@ _LIT(KDRMClockServerName, "DRMClockServer"); +const TInt KGPSUpdateInterval = 1000000; // One second +const TInt KGPSUpdateAge = 500000; // Half a second +const TInt KGPSUpdateTimeOut = 30000000; // Thirty seconds + // ============================ MEMBER FUNCTIONS =============================== @@ -35,11 +39,9 @@ // might leave. // ----------------------------------------------------------------------------- // -CGPSTimeUpdater::CGPSTimeUpdater( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, +CGPSTimeUpdater::CGPSTimeUpdater( const TPositionModuleId& aModuleId, CDRMClock* aClock ) : CActive(EPriorityHigh), - iPosServer(aPosServer), iModuleId(aModuleId), iClock( aClock ), iTimeReceived( EFalse ) @@ -58,6 +60,7 @@ Cancel(); iPositioner.Close(); + iPosServer.Close(); } // ----------------------------------------------------------------------------- @@ -65,11 +68,10 @@ // Two-phased constructor // ----------------------------------------------------------------------------- // -CGPSTimeUpdater* CGPSTimeUpdater::New( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, +CGPSTimeUpdater* CGPSTimeUpdater::New( const TPositionModuleId& aModuleId, CDRMClock* aClock ) { - CGPSTimeUpdater* self = new CGPSTimeUpdater(aPosServer, aModuleId, aClock); + CGPSTimeUpdater* self = new CGPSTimeUpdater(aModuleId, aClock); if(self) { TRAPD(err, self->ConstructL()); @@ -92,6 +94,8 @@ { DRMLOG(_L("CGPSTimeUpdater::ConstructL >>")); + User::LeaveIfError( iPosServer.Connect() ); + // Open positioner User::LeaveIfError(iPositioner.Open(iPosServer, iModuleId)); User::LeaveIfError(iPositioner.SetRequestor(CRequestor::ERequestorService, @@ -101,9 +105,9 @@ // Set update options TPositionUpdateOptions updateOptions; updateOptions.SetAcceptPartialUpdates(ETrue); - updateOptions.SetMaxUpdateAge(0); - updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(0)); - updateOptions.SetUpdateTimeOut(TTimeIntervalMicroSeconds(30*1000*1000)); + updateOptions.SetMaxUpdateAge(KGPSUpdateAge); + updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(KGPSUpdateInterval)); + updateOptions.SetUpdateTimeOut(TTimeIntervalMicroSeconds(KGPSUpdateTimeOut)); User::LeaveIfError(iPositioner.SetUpdateOptions(updateOptions)); // Request position update @@ -124,7 +128,9 @@ DRMLOG2(_L("CGPSTimeUpdater::RunL: iStatus=%d"), iStatus.Int()); - if( iStatus == KErrNone || iStatus == KPositionPartialUpdate ) + // We got some kind of an update: + if( iStatus == KErrNone || + iStatus == KPositionPartialUpdate ) { DRMLOG(_L("CGPSTimeUpdater::RunL: position updated!")); @@ -140,18 +146,9 @@ // Mark time as received iTimeReceived = ETrue; } - - // if the call timed out try again - if( iStatus == KErrTimedOut ) - { - // Request position update - iPositioner.NotifyPositionUpdate(iSatelliteInfo, iStatus); - SetActive(); - } - else - { - iPositioner.Close(); - } + + // We only try once, if it fails it fails and we will try again when it is activated the next time. + iPositioner.Close(); DRMLOG(_L("CGPSTimeUpdater::RunL <<")); } diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/drmclock/Src/GPSWatcher.cpp --- a/omadrm/drmengine/drmclock/Src/GPSWatcher.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/drmclock/Src/GPSWatcher.cpp Tue May 11 16:28:38 2010 +0300 @@ -26,8 +26,6 @@ #include "drmlog.h" // Wait time in microseconds: wait 5 minutes -const TInt KGpsDefaultWaitTime = 300000000; -const TInt KMaxRetryCounter = 20; // ============================ MEMBER FUNCTIONS =============================== @@ -41,7 +39,8 @@ CGPSWatcher::CGPSWatcher( CDRMClock* aClock ) : CTimer(EPriorityHigh), iClock( aClock ), - iRetryCounter( 0 ) + iStatusUpdater( NULL ), + iGpsStatus( CPosIntGpsHwStatus::EStatusUnknown ) { CActiveScheduler::Add(this); } @@ -55,10 +54,10 @@ { Cancel(); - delete iTimeUpdater; - iTimeUpdater = 0; - - iPosServer.Close(); + iTimeUpdaters.ResetAndDestroy(); + iActiveSatelliteModules.ResetAndDestroy(); + + delete iStatusUpdater; } // ----------------------------------------------------------------------------- @@ -84,28 +83,42 @@ // void CGPSWatcher::ConstructL() { + TRequestStatus* status = &iStatus; CTimer::ConstructL(); - User::LeaveIfError(iPosServer.Connect()); - - // Immediately subscribe for module status events - iStatusEvent.SetRequestedEvents(TPositionModuleStatusEventBase::EEventDeviceStatus); - Subscribe(); - - // Check initial state - CheckModules(); + // Create the status updater + iStatusUpdater = CPosIntGpsHwStatus::NewL(*this); + + // Get the status manually, if we can, it's ok if we cant + TRAP_IGNORE( iStatusUpdater->GetStatusL( iGpsStatus ) ); + + if( !IsActive() ) + { + SetActive(); + } + + User::RequestComplete(status, KErrNone); } // ----------------------------------------------------------------------------- -// CGPSWatcher::Subscribe -// Subscribe to position events +// CGPSWatcher::OnStatusUpdateEvent +// Inherited from MPosIntGpsHwStatusObserver // ----------------------------------------------------------------------------- // -void CGPSWatcher::Subscribe() - { - iPosServer.NotifyModuleStatusEvent(iStatusEvent, iStatus); - SetActive(); - } +void CGPSWatcher::OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError) + { + TRequestStatus* status = &iStatus; + + // store the status from the Gps: + iGpsStatus = aStatus; + + User::RequestComplete(status, aError); + + if( !IsActive() ) + { + SetActive(); + } + } // ----------------------------------------------------------------------------- // CGPSWatcher::RunL @@ -114,41 +127,53 @@ // void CGPSWatcher::RunL() { + TInt error = KErrNone; + // If there are errors just leave and stop watching: - DRMLOG2(_L("CGPSWatcher::RunL: error: '%d'"), iStatus.Int()); - - // If we already updated the time: - if( iTimeUpdater && iTimeUpdater->TimeReceived() ) - { - DRMLOG( _L("CGPSWatcher::RunL: time updater exists, time received, deleting")); - iClock->Notify( CDRMClock::ENotifyGPSTimeReceived ); - DRMLOG( _L("CGPSWatcher::RunL: object deleted, returning")); - return; - } + DRMLOG2(_L("CGPSWatcher::RunL: status: '%d'"), iStatus.Int()); - // The server was killed: - if( iStatus.Int() == KErrServerTerminated ) + switch( iGpsStatus ) { - if( iRetryCounter > KMaxRetryCounter ) - { - DRMLOG( _L("CGPSWatcher::RunL: Maximum retries reached, stopping watcher.") ); - iClock->Notify( CDRMClock::ENotifyGPSTimeReceived ); - return; - } - // If there are errors just leave and stop watching: - DRMLOG2(_L("CGPSWatcher::RunL: server terminated, waiting '%d' microseconds"), KGpsDefaultWaitTime); - After( TTimeIntervalMicroSeconds32(KGpsDefaultWaitTime) ); - return; - } - - Subscribe(); - TPositionModuleStatusEventBase::TModuleEvent occurredEvents = iStatusEvent.OccurredEvents(); - DRMLOG2(_L("CGPSWatcher::RunL: occurredEvents = 0x%X"), occurredEvents); - - - // If time updater is not running, check module statuses - if(!iTimeUpdater) - CheckModules(); + // GPS HW is used and is receiving location fixes. + case CPosIntGpsHwStatus::EStatusOn: + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Checking modules")); + // No active modules, check again: + if( !iActiveSatelliteModules.Count() ) + { + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: No active modules in list Checking modules")); + error = CheckModules(); + } + + // if we have some or found some check the satellites for updates: + if( !error && iActiveSatelliteModules.Count() ) + { + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Active modules available (%d), check satellites"), iActiveSatelliteModules.Count()); + // Get the time update: + CheckSatellites(); + } + else + { + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Still no active modules in list or error (%d) occurred"), error); + } + break; + // GPS HW is used and is searching for location. + case CPosIntGpsHwStatus::EStatusActive: + // Get a list of active GPS modules: + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusActive: Checking modules")); + + // return value not important: + CheckModules(); + break; + case CPosIntGpsHwStatus::EStatusUnknown: + case CPosIntGpsHwStatus::EStatusOff: + // Clear the list of modules: + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusUnknown,Off or default: (%d) Checking modules"), iGpsStatus); + iActiveSatelliteModules.ResetAndDestroy(); + iTimeUpdaters.ResetAndDestroy(); + default: + // Do nothing + break; + } } @@ -159,7 +184,6 @@ // void CGPSWatcher::DoCancel() { - iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent); } // ----------------------------------------------------------------------------- @@ -178,36 +202,54 @@ // Check what modules are present and act accordingly // ----------------------------------------------------------------------------- // -void CGPSWatcher::CheckModules() +TInt CGPSWatcher::CheckModules() { - // Get number of modules - TUint numModules; - if(iPosServer.GetNumModules(numModules)!=KErrNone || !numModules) - return; + TUint numModules = 0; + TPositionModuleInfo* moduleInfo = NULL; + TInt error = KErrNone; + RPositionServer posServer; - // Collect all active and satellite capable modules - TFullName moduleName; - RPointerArray satelliteModules; - - TPositionModuleInfo *moduleInfo(0); - - for(TUint i=0; iDeviceLocation() & TPositionModuleInfo::EDeviceInternal) || ! (moduleInfo->Capabilities() & TPositionModuleInfo::ECapabilitySatellite) ) @@ -216,47 +258,75 @@ continue; } - // Get module status + // Get module status and check if the module is actually active: + + + DRMLOG(_L("CheckModules: Checking module status")); + TPositionModuleStatus moduleStatus; - if(iPosServer.GetModuleStatus(moduleStatus, moduleInfo->ModuleId()) != KErrNone) + + if(posServer.GetModuleStatus(moduleStatus, moduleInfo->ModuleId()) != KErrNone) { continue; } - // Check if the module is active - if(moduleStatus.DeviceStatus() != TPositionModuleStatus::EDeviceActive) + + // Check if the module is active or ready as all might not use the active state: + if(!(moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceActive || + moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceReady) ) { continue; } - moduleInfo->GetModuleName(moduleName); - - DRMLOG6( _L("Module %d: id=0x%08X, name = %S, cap=0x%08X, status=%d"), i, moduleInfo->ModuleId().iUid, &moduleName, moduleInfo->Capabilities(), moduleStatus.DeviceStatus()); + + DRMLOG(_L("CheckModules: Module is ready or active")); // Active internal satellite device, try to append in the array - if(satelliteModules.Append(moduleInfo) == KErrNone) + if(iActiveSatelliteModules.Append(moduleInfo) == KErrNone) { + // Set this to 0 so that on the next round a new one will be created + // old one will be in the list: + DRMLOG2(_L("CheckModules: Appended modules to list available (%d) active now available"), iActiveSatelliteModules.Count()); moduleInfo = 0; } } - delete moduleInfo; + // There is a module created which was not added, delete it. + if( moduleInfo ) + { + delete moduleInfo; + moduleInfo = NULL; + } - if(satelliteModules.Count()) - { - DRMLOG( _L("Active satellite module available") ); - // We have an active satellite module available - TPositionModuleId moduleId = satelliteModules[0]->ModuleId(); - - // Just allocating/deleting the time updater will do the trick - iTimeUpdater = CGPSTimeUpdater::New(iPosServer, moduleId, iClock); - } - else - { - DRMLOG( _L("No active satellite modules available") ); - // Delete time updater since no active GPS anymore - delete iTimeUpdater; iTimeUpdater = 0; - } - - satelliteModules.ResetAndDestroy(); - satelliteModules.Close(); + // close connection to the positioning server: + posServer.Close(); + return KErrNone; } + + +// ----------------------------------------------------------------------------- +// CGPSWatcher::CheckSatellites() +// Check what modules are present and act accordingly +// ----------------------------------------------------------------------------- +// +void CGPSWatcher::CheckSatellites() + { + CGPSTimeUpdater* updater = NULL; + + iTimeUpdaters.ResetAndDestroy(); + + // Start as many updaters as needed: + for( TInt i = 0; i < iActiveSatelliteModules.Count(); i++ ) + { + updater = CGPSTimeUpdater::New( iActiveSatelliteModules[i]->ModuleId(), iClock ); + if( updater ) + { + if( iTimeUpdaters.Append(updater) ) + { + delete updater; + updater = NULL; + } + } + } + } + +// End of File diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DRMCommon.mmp --- a/omadrm/drmengine/group/DRMCommon.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DRMCommon.mmp Tue May 11 16:28:38 2010 +0300 @@ -56,6 +56,7 @@ LIBRARY euser.lib efsrv.lib charconv.lib LIBRARY apmime.lib bafl.lib estor.lib InetProtUtil.lib LIBRARY caf.lib +LIBRARY featmgr.lib #ifdef RD_MULTIPLE_DRIVE LIBRARY platformenv.lib diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DrmDcf.mmp --- a/omadrm/drmengine/group/DrmDcf.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DrmDcf.mmp Tue May 11 16:28:38 2010 +0300 @@ -49,7 +49,7 @@ LIBRARY euser.lib XmlFramework.lib hash.lib LIBRARY estor.lib efsrv.lib apmime.lib InetProtUtil.lib bnf.lib LIBRARY cryptography.lib random.lib bafl.lib charconv.lib -LIBRARY centralrepository.lib +LIBRARY centralrepository.lib featmgr.lib #if defined(ARMCC) deffile ../eabi/ diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DrmKeyStorage.mmp --- a/omadrm/drmengine/group/DrmKeyStorage.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DrmKeyStorage.mmp Tue May 11 16:28:38 2010 +0300 @@ -47,6 +47,7 @@ LIBRARY random.lib LIBRARY hash.lib LIBRARY flogger.lib +LIBRARY featmgr.lib #if defined(ARMCC) deffile ../eabi/ diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DrmParsers.mmp --- a/omadrm/drmengine/group/DrmParsers.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DrmParsers.mmp Tue May 11 16:28:38 2010 +0300 @@ -57,6 +57,7 @@ LIBRARY drmdcf.lib euser.lib XmlFramework.lib hash.lib LIBRARY estor.lib efsrv.lib apmime.lib InetProtUtil.lib bnf.lib LIBRARY cryptography.lib bafl.lib charconv.lib drmkeystorage.lib +LIBRARY featmgr.lib #ifdef RD_MULTIPLE_DRIVE LIBRARY platformenv.lib diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DrmServerInterfaces.mmp --- a/omadrm/drmengine/group/DrmServerInterfaces.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DrmServerInterfaces.mmp Tue May 11 16:28:38 2010 +0300 @@ -76,6 +76,7 @@ LIBRARY euser.lib XmlFramework.lib hash.lib LIBRARY estor.lib efsrv.lib apmime.lib InetProtUtil.lib bnf.lib LIBRARY cryptography.lib random.lib bafl.lib charconv.lib +LIBRARY featmgr.lib #if defined(ARMCC) deffile ../eabi/ diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/DrmStdKeyStorage.mmp --- a/omadrm/drmengine/group/DrmStdKeyStorage.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/DrmStdKeyStorage.mmp Tue May 11 16:28:38 2010 +0300 @@ -49,6 +49,7 @@ LIBRARY etel.lib LIBRARY etelmm.lib LIBRARY flogger.lib +LIBRARY featmgr.lib #ifdef RD_MULTIPLE_DRIVE LIBRARY platformenv.lib diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/OmaDrmAgent.mmp --- a/omadrm/drmengine/group/OmaDrmAgent.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/OmaDrmAgent.mmp Tue May 11 16:28:38 2010 +0300 @@ -77,5 +77,6 @@ LIBRARY ws32.lib LIBRARY sysutil.lib LIBRARY centralrepository.lib +LIBRARY featmgr.lib SMPSAFE diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/ROAPHandler.mmp --- a/omadrm/drmengine/group/ROAPHandler.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/ROAPHandler.mmp Tue May 11 16:28:38 2010 +0300 @@ -115,6 +115,7 @@ LIBRARY cafutils.lib // Embedding domain ROs LIBRARY centralrepository.lib // Browser default AP LIBRARY cmmanager.lib +LIBRARY featmgr.lib LIBRARY SysUtil.lib LIBRARY HttpFilterCommon.lib diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/group/RightsServer.mmp --- a/omadrm/drmengine/group/RightsServer.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/group/RightsServer.mmp Tue May 11 16:28:38 2010 +0300 @@ -148,6 +148,7 @@ LIBRARY featmgr.lib // Feature Manager LIBRARY wmdrmfileserverclient.lib LIBRARY lbs.lib // GPS libraries +LIBRARY eposindicator.lib // GPS positioner indicator lib #ifdef RD_DRM_METERING LIBRARY random.lib #endif diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/keystorage/src/DrmStdKeyStorage.cpp --- a/omadrm/drmengine/keystorage/src/DrmStdKeyStorage.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/keystorage/src/DrmStdKeyStorage.cpp Tue May 11 16:28:38 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef RD_MULTIPLE_DRIVE #include @@ -210,10 +211,17 @@ User::LeaveIfError(iFs.Connect()); iFileMan = CFileMan::NewL(iFs); -#ifdef __DRM_OMA2 - TRAP_IGNORE( SelectDefaultRootL() ); // Allow startup anyway. + FeatureManager::InitializeLibL(); + +#ifdef __DRM_OMA2 + if ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + TRAP_IGNORE( SelectDefaultRootL() ); + } #endif - + + FeatureManager::UnInitializeLib(); + iDeviceSpecificKey.Copy(KDefaultKey); LOG(_L("CDrmStdKeyStorage::ConstructL <-")); diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/legacy/src/DRMCommon.cpp --- a/omadrm/drmengine/legacy/src/DRMCommon.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/legacy/src/DRMCommon.cpp Tue May 11 16:28:38 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -1821,7 +1822,8 @@ // ----------------------------------------------------------------------------- EXPORT_C void DRMCommon::ConstructL() { - } + FeatureManager::InitializeLibL(); + } // ----------------------------------------------------------------------------- // DRMCommon::NewL @@ -1840,6 +1842,7 @@ // Destructor EXPORT_C DRMCommon::~DRMCommon() { + FeatureManager::UnInitializeLib(); } // ----------------------------------------------------------------------------- @@ -2261,7 +2264,15 @@ DRMCommon::ESeparateDelivery | DRMCommon::ESuperDistribution; #ifdef __DRM_OMA2 - aOMALevel = EOMA_2_0; + if ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + aOMALevel = EOMA_2_0; + } + else + { + aOMALevel = EOMA_1_0; + } + #else aOMALevel = EOMA_1_0; #endif diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/roap/src/RoapEngBase.cpp --- a/omadrm/drmengine/roap/src/RoapEngBase.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/roap/src/RoapEngBase.cpp Tue May 11 16:28:38 2010 +0300 @@ -17,6 +17,7 @@ // INCLUDE FILES +#include #include #include // #include // from S60 @@ -50,6 +51,8 @@ iReturnedROs.ResetAndDestroy(); delete iDomainRightsResp; delete iRiAlias; + + FeatureManager::UnInitializeLib(); } // --------------------------------------------------------- @@ -78,6 +81,8 @@ iImplicitJoinDomain = EFalse; iReRegistered = EFalse; iRiAlias = NULL; + + FeatureManager::InitializeLibL(); } @@ -94,10 +99,12 @@ { LOGLIT( "CRoapEngBase::SetTriggerL" ) -#ifndef __DRM_OMA2 - User::Leave(KErrNotSupported); -#endif - + if ( !( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) ) + { + User::Leave(KErrNotSupported); + } + __ASSERT_ALWAYS( iState == EInit || iState == EReady, \ User::Invariant() ); TBool registered = EFalse; diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/server/src/DRMRightsClient.cpp --- a/omadrm/drmengine/server/src/DRMRightsClient.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/server/src/DRMRightsClient.cpp Tue May 11 16:28:38 2010 +0300 @@ -19,6 +19,7 @@ // INCLUDE FILES #include #include +#include #include "DRMRightsClient.h" #include "DRMEngineClientServer.h" #include "DrmPermission.h" @@ -157,11 +158,23 @@ } #ifdef __DRM_FULL - // startup code, if it starts it starts if not it will be tried again. - RDRMHelper helper; - TInt ignore = helper.Connect(); // Start HelperServer - helper.Close(); -#endif + + TRAP( ret, FeatureManager::InitializeLibL() ); + + if ( !ret && FeatureManager::FeatureSupported( KFeatureIdFfOmadrm1FullSupport ) ) + { + // startup code, if it starts it starts if not it will be tried again. + RDRMHelper helper; + TInt ignore = helper.Connect(); // Start HelperServer + helper.Close(); + } + + if ( !ret ) + { + FeatureManager::UnInitializeLib(); + } + +#endif DRMLOG2( _L( "RDRMRightsClient::Connect(): Result: %d" ), ret ); diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmengine/server/src/drmrightsdb.cpp --- a/omadrm/drmengine/server/src/drmrightsdb.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmengine/server/src/drmrightsdb.cpp Tue May 11 16:28:38 2010 +0300 @@ -22,6 +22,7 @@ #include // Type definitions #include // MD5 Algorithm // #include // Disk space checking +#include // Feature Manager #include #include #include @@ -69,8 +70,10 @@ // LOCAL CONSTANTS AND MACROS #ifdef RD_MULTIPLE_DRIVE // Backup Directory +#ifdef __DRM_OMA2 _LIT( KBackupDir, "%c:\\private\\101F51F2\\backup\\" ); #endif +#endif _LIT(KJavaExtension, ".jar"); @@ -89,16 +92,8 @@ _LIT(KCorruptionFlagFile, "invalid"); #ifdef __DRM_OMA2 -const TInt KMaxUDTDataSize = 256; -const TInt KDeviceDataSize = 256; const TInt KDeviceDataBlock = 128; -#else -const TInt KMaxUDTDataSize = 0; -const TInt KDeviceDataSize = 0; -const TInt KDeviceDataBlock = 0; #endif -const TInt KUdtDataPos = 4 + KDeviceDataSize; - const TInt KEncryptionKeySize = 16; const TInt KMaxEncryptionSize = 8192; @@ -111,8 +106,10 @@ // MODULE DATA STRUCTURES // LOCAL FUNCTION PROTOTYPES +#ifdef __DRM_OMA2 LOCAL_C void CleanupData( TAny* aPtr ); LOCAL_C void WriteIntToBlock( TInt aValue, TDes8& aBlock, TInt aOffset ); +#endif LOCAL_C void DeleteObject( TAny* aObject ); // FORWARD DECLARATIONS @@ -124,6 +121,7 @@ // Used to catch errors and delete the file if it's needed // ----------------------------------------------------------------------------- // +#ifdef __DRM_OMA2 LOCAL_C void CleanupData( TAny* aPtr ) { CDRMRightsDB* rdb = reinterpret_cast( aPtr ); @@ -139,7 +137,7 @@ aBlock[aOffset + 2] = (aValue & 0x0000ff00) >> 8; aBlock[aOffset + 3] = (aValue & 0x000000ff); } - +#endif // ---------------------------------------------------------------------------- // DeleteObject // Deletes the file by TFileName presented by aHandle @@ -205,6 +203,9 @@ } InitializeDatabaseL(); + + FeatureManager::InitializeLibL(); + }; // ----------------------------------------------------------------------------- @@ -268,6 +269,8 @@ } iMemStream.Close(); + + FeatureManager::UnInitializeLib(); DRMLOG( _L( "RDB Closing." ) ); }; @@ -1080,6 +1083,16 @@ HBufC8* CDRMRightsDB::GetUdtDataLC() { #ifdef __DRM_OMA2 + + if ( ! ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) ) + { + User::Leave( KErrNotSupported ); + } + + const TInt KMaxUDTDataSize( 256 ); + const TInt KDeviceDataSize( 256 ); + const TInt KUdtDataPos = 4 + KDeviceDataSize; + HBufC8* udtData = HBufC8::NewMaxLC( KMaxUDTDataSize ); TFileName backupFile; RFile input; @@ -1135,6 +1148,12 @@ #endif // __DRM_OMA2 { #ifdef __DRM_OMA2 + + if ( ! ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) ) + { + User::Leave( KErrNotSupported ); + } + TFileName backupFile; RFile input; HBufC8* keyData = NULL; @@ -1370,7 +1389,10 @@ stream.WriteInt32L( fileSize ); #ifdef __DRM_OMA2 - AddUDTDataL( stream ); + if ( FeatureManager::FeatureSupported ( KFeatureIdFfOmadrm2Support ) ) + { + AddUDTDataL( stream ); + } #endif encIV.SetLength(KEncryptionKeySize); @@ -1617,13 +1639,20 @@ // void CDRMRightsDB::RestoreContentFromFileL( RFile& aBackupFile, const TDesC8& aEncryptionKey, - const TInt aMode ) + const TInt aMode ) { + // RFileLogger::Write(KLogDir, KLogName, EFileLoggingModeAppend, _L8("RestoreContentFromFileL\n\r")); TInt8 continueMarker = 1; TBuf8<16> key; TBuf8<16> encryptionKey; TInt permissions = 0; + + // Default values when OMA2 DRM is not supported + TInt maxUDTDataSize( 0 ); + TInt deviceDataSize( 0 ); + TInt udtDataPos( 4 + deviceDataSize ); + CDRMPermission* permission = CDRMPermission::NewLC(); CDRMCommonData *commonData = NULL; CDRMPointerArray *permissionArray = CDRMPointerArray::NewLC(); @@ -1634,11 +1663,19 @@ TInt size = 0; TInt dataLeft = 0; TPtr8 keyData(NULL,0,0); - + +#ifdef __DRM_OMA2 + if ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + maxUDTDataSize = 256; + deviceDataSize = 256; + udtDataPos = 4 + deviceDataSize; + } +#endif + // maintain knowledge about stateful rights not being restored TBool stateful = EFalse; - DRMLOG( _L( "CDRMRightsDB::RestoreContentFromFileL ->" ) ); // Indicate that the DB is updated @@ -1686,7 +1723,7 @@ // Check that the decryption works, if it doesn't then the // key is faulty User::LeaveIfError( aBackupFile.Size( readPos ) ); - if( readPos < KUdtDataPos+KMaxUDTDataSize+(KEncryptionKeySize*2) ) + if( readPos < udtDataPos+maxUDTDataSize+(KEncryptionKeySize*2) ) { // RFileLogger::Write(KLogDir, KLogName, EFileLoggingModeAppend, _L8("RestoreContentFromFileL : corrupt\n\r")); User::Leave(KErrCorrupt); @@ -1715,7 +1752,7 @@ //----------------------------------------------------------------------- // Duplicate file handle - readPos = KUdtDataPos+KMaxUDTDataSize; + readPos = udtDataPos+maxUDTDataSize; User::LeaveIfError( fileHandle.Seek( ESeekStart, readPos ) ); iMemStream.Close(); @@ -1812,7 +1849,6 @@ } } - // Encrypt the key if( keyExists ) { @@ -1878,9 +1914,6 @@ User::Leave( KErrGeneral ); } - - - if( insertPerm == -1 ) // Add everything no checks needed { for( TInt count = 0; count < permissions; count++ ) @@ -1937,7 +1970,6 @@ } - for( TInt count = 0; count < permissions; count++ ) { if( dataLeft < 4 ) @@ -2034,6 +2066,7 @@ { User::Leave( KErrPermissionDenied ); } + }; @@ -2187,6 +2220,13 @@ #endif // __DRM_OMA2 { #ifdef __DRM_OMA2 + + if ( ! ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) ) + { + User::Leave( KErrNotSupported ); + } + + const TInt KMaxUDTDataSize( 256 ); TBuf8 serialNumber; TBuf8 buffer; TUint8* ptr = const_cast(buffer.Ptr()); @@ -2357,6 +2397,12 @@ void CDRMRightsDB::CreateDummyUDTFileL() { #ifdef __DRM_OMA2 + + if ( ! ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) ) + { + User::Leave( KErrNotSupported ); + } + TFileName backupFile; RFile input; TInt fileSize = 4 + 256 + 256; @@ -2386,6 +2432,12 @@ void CDRMRightsDB::CleanUdtData() { #ifdef __DRM_OMA2 + + if ( ! ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) ) + { + return; + } + TFileName backupFile; #ifndef RD_MULTIPLE_DRIVE diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmhelper/src/drmhelper.cpp --- a/omadrm/drmhelper/src/drmhelper.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmhelper/src/drmhelper.cpp Tue May 11 16:28:38 2010 +0300 @@ -7033,21 +7033,27 @@ EXPORT_C TInt CDRMHelper::SupportedDRMMethods2( TInt& aDRMMethod, TDRMHelperOMALevel& aOMALevel) { -#ifndef __DRM_FULL - aDRMMethod = CDRMHelper::EForwardLock; -#else - aDRMMethod = - CDRMHelper::EForwardLock | - CDRMHelper::ECombinedDelivery | - CDRMHelper::ESeparateDelivery | - CDRMHelper::ESuperDistribution; + if ( !( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm1FullSupport ) ) ) + { + aDRMMethod = CDRMHelper::EForwardLock; + } + else + { + aDRMMethod = + CDRMHelper::EForwardLock | + CDRMHelper::ECombinedDelivery | + CDRMHelper::ESeparateDelivery | + CDRMHelper::ESuperDistribution; + aOMALevel = EOMA_1_0; + } + #ifdef __DRM_OMA2 - aOMALevel = EOMA_2_0; -#else - aOmaLevel = EOMA_1_0; + if ( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + aOMALevel = EOMA_2_0; + } #endif // __DRM_OMA2 -#endif // __DRM_FULL return KErrNone; } diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmfilter/group/HTTPFilterDRM.mmp --- a/omadrm/drmplugins/drmfilter/group/HTTPFilterDRM.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmfilter/group/HTTPFilterDRM.mmp Tue May 11 16:28:38 2010 +0300 @@ -46,6 +46,7 @@ END LIBRARY euser.lib ecom.lib http.lib bafl.lib estlib.lib efsrv.lib estor.lib cone.lib commonui.lib caf.lib +LIBRARY featmgr.lib #ifndef __DRM_NO_BB MACRO BLOCK_BY_BLOCK diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp --- a/omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmfilter/src/HTTPFilterDRMDataSupplier.cpp Tue May 11 16:28:38 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,10 @@ //------------------------------------------------------------------------ +#ifdef __DRM_FULL const TInt KMinContentSizeToGetTheURI = 520; +#endif + const TInt KDefaultSize( 2048 ); const TInt KWholeDataPart( -1 ); @@ -110,6 +114,8 @@ Attach( iMemBuf ); iDRMMessageParser->InitializeMessageParserL( *this ); + + FeatureManager::InitializeLibL(); } @@ -131,6 +137,9 @@ iDRMOma1DcfCreator = COma1DcfCreator::NewL(); Attach( iMemBuf ); + + FeatureManager::InitializeLibL(); + } // ----------------------------------------------------------------------------- @@ -183,6 +192,9 @@ delete iDRMOma1DcfCreator; iDRMOma1DcfCreator = NULL; } + + FeatureManager::UnInitializeLib(); + } // ----------------------------------------------------------------------------- @@ -456,6 +468,13 @@ #ifdef __DRM_FULL void CHTTPFilterDRMDataSupplier::SetEstimatedArrivalTime( TInt aXOmaHeaderVal ) { + + if ( !( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm1FullSupport ) ) ) + { + return; + } + // get the data part ContentAccess::CManager* manager = NULL; ContentAccess::TAgent agent; diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmrecognizer/group/RecDRM.mmp --- a/omadrm/drmplugins/drmrecognizer/group/RecDRM.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmrecognizer/group/RecDRM.mmp Tue May 11 16:28:38 2010 +0300 @@ -47,5 +47,6 @@ library EUSER.LIB library APMIME.LIB +library featmgr.lib SMPSAFE diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmrecognizer/src/RecDRM.cpp --- a/omadrm/drmplugins/drmrecognizer/src/RecDRM.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmrecognizer/src/RecDRM.cpp Tue May 11 16:28:38 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include #include "RecDRM.h" @@ -39,6 +40,8 @@ const TInt KMaxBufferLength=256; const TInt KDCFHeaderLength=3; + +#ifdef DRM_OMA2_ENABLED const TInt KLengthBoxSize = 4; const TInt KLengthBoxType = 4; const TInt KLengthBoxSize64 = 8; @@ -50,6 +53,7 @@ _LIT8(KRoapTriggerElement, "roap-trigger:roapTrigger"); // before OMA spec CR, ROAP Trigger namespace prefix was roap-trigger _LIT8(KRoapTriggerElement2, "roap:roapTrigger"); _LIT8(KRoapTriggerType, "application/vnd.oma.drm.roap-trigger+xml"); +#endif const TImplementationProxy ImplementationTable[] = { @@ -89,12 +93,14 @@ CApaDRMRecognizer::~CApaDRMRecognizer() { + FeatureManager::UnInitializeLib(); } CApaDataRecognizerType* CApaDRMRecognizer::CreateRecognizerL() { - return new (ELeave) CApaDRMRecognizer (); + FeatureManager::InitializeLibL(); + return new (ELeave) CApaDRMRecognizer (); } @@ -131,22 +137,25 @@ #endif #ifdef DRM_OMA2_ENABLED - // Recognize ROAP Trigger - if ( RecognizeRoapTrigger( aBuffer ) ) - { - return; - } - - // Recognize DCFv2 - if ( RecognizeODF( aBuffer ) ) - { - return; - } -#endif - // Recognize DCFv1 - TUint8 version = aBuffer[0]; - TUint8 contentTypeLen = aBuffer[1]; - TUint8 contentURILen = aBuffer[2]; + if( FeatureManager::FeatureSupported( KFeatureIdFfOmadrm2Support ) ) + { + // Recognize ROAP Trigger + if ( RecognizeRoapTrigger( aBuffer ) ) + { + return; + } + + // Recognize DCFv2 + if ( RecognizeODF( aBuffer ) ) + { + return; + } + } +#endif + // Recognize DCFv1 + TUint8 version = aBuffer[0]; + TUint8 contentTypeLen = aBuffer[1]; + TUint8 contentURILen = aBuffer[2]; if ( contentTypeLen < KMinContentTypeLen || contentURILen == 0 ) { @@ -177,6 +186,12 @@ #ifdef DRM_OMA2_ENABLED TBool CApaDRMRecognizer::RecognizeRoapTrigger( const TDesC8& aBuffer ) { + if( ! ( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) ) + { + return EFalse; + } + if ( aBuffer.FindF( KRoapTriggerElement() ) != KErrNotFound || aBuffer.FindF( KRoapTriggerElement2() ) != KErrNotFound ) { @@ -189,54 +204,61 @@ TBool CApaDRMRecognizer::RecognizeODF( const TDesC8& aBuffer ) { - if ( aBuffer.Size() < 24 ) return EFalse; - TPtrC8 ftypPrefix = aBuffer.Mid( 4, KFTypPrefix().Length() ); - if ( KFTypPrefix().CompareF( ftypPrefix ) == KErrNone ) - { - TPtrC8 odfPrefix = aBuffer.Mid( 8, KODFPrefix().Length() ); - if ( KODFPrefix().CompareF( odfPrefix ) == KErrNone ) + + if( ! ( FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) ) { - TBuf8<4> buffer; - TUint32 size; - TPtr8 ptr(NULL, 0); - TUint32 offset(20); - - // ODRM box header - buffer.Zero(); - buffer.Copy( aBuffer.Mid( offset, 4 )); - size = ReadUint32FromBlock( buffer, 0 ); - offset += KLengthBoxSize + KLengthBoxType + KLengthVersion + KLengthFlags; - - if (size == 1) - { - offset += KLengthBoxSize64; - } - if ( aBuffer.Size() < offset+4 ) return EFalse; - - // Discrete headers box header - buffer.Zero(); - buffer.Copy( aBuffer.Mid( offset, 4 )); - size = ReadUint32FromBlock( buffer, 0 ); - offset += KLengthBoxSize + KLengthBoxType + KLengthVersion + KLengthFlags; - if ( size == 1 ) - { - offset += KLengthBoxSize64; - } - if ( aBuffer.Size() < offset+1 ) return EFalse; - - // Content type - buffer.Zero(); - buffer.Copy( aBuffer.Mid( offset, 1 )); - if ( aBuffer.Size() < offset + 1 + buffer[0] ) return EFalse; - TPtrC8 mimeType = aBuffer.Mid( offset+1, buffer[0] ); - - iConfidence = ECertain; - iDataType=TDataType( mimeType ); - return ETrue; + return EFalse; } - - } - return EFalse; + + if ( aBuffer.Size() < 24 ) return EFalse; + TPtrC8 ftypPrefix = aBuffer.Mid( 4, KFTypPrefix().Length() ); + if ( KFTypPrefix().CompareF( ftypPrefix ) == KErrNone ) + { + TPtrC8 odfPrefix = aBuffer.Mid( 8, KODFPrefix().Length() ); + if ( KODFPrefix().CompareF( odfPrefix ) == KErrNone ) + { + TBuf8<4> buffer; + TUint32 size; + TPtr8 ptr(NULL, 0); + TUint32 offset(20); + + // ODRM box header + buffer.Zero(); + buffer.Copy( aBuffer.Mid( offset, 4 )); + size = ReadUint32FromBlock( buffer, 0 ); + offset += KLengthBoxSize + KLengthBoxType + KLengthVersion + KLengthFlags; + + if (size == 1) + { + offset += KLengthBoxSize64; + } + if ( aBuffer.Size() < offset+4 ) return EFalse; + + // Discrete headers box header + buffer.Zero(); + buffer.Copy( aBuffer.Mid( offset, 4 )); + size = ReadUint32FromBlock( buffer, 0 ); + offset += KLengthBoxSize + KLengthBoxType + KLengthVersion + KLengthFlags; + if ( size == 1 ) + { + offset += KLengthBoxSize64; + } + if ( aBuffer.Size() < offset+1 ) return EFalse; + + // Content type + buffer.Zero(); + buffer.Copy( aBuffer.Mid( offset, 1 )); + if ( aBuffer.Size() < offset + 1 + buffer[0] ) return EFalse; + TPtrC8 mimeType = aBuffer.Mid( offset+1, buffer[0] ); + + iConfidence = ECertain; + iDataType=TDataType( mimeType ); + return ETrue; + } + + } + return EFalse; } #endif diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmrohandler/group/crohandler.mmp --- a/omadrm/drmplugins/drmrohandler/group/crohandler.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmrohandler/group/crohandler.mmp Tue May 11 16:28:38 2010 +0300 @@ -75,6 +75,7 @@ LIBRARY flogger.lib LIBRARY sysutil.lib // SysUtil LIBRARY esock.lib +LIBRARY featmgr.lib // Feature Manager #ifdef RD_MULTIPLE_DRIVE LIBRARY platformenv.lib diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmrohandler/inc/CRoHandler.h --- a/omadrm/drmplugins/drmrohandler/inc/CRoHandler.h Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmrohandler/inc/CRoHandler.h Tue May 11 16:28:38 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-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" @@ -239,8 +239,9 @@ // initialised at instantiation DRM::CWbxmlRoapTriggerParser* iWbxmlTriggerParser; HBufC8* iParsedXmlTrigger; - TBool iPutRightsToInbox; // whether received RO is put into Inbox as an + TBool iPutRightsToInbox; // whether received RO is put into Inbox as an // entry or not. Initialized at instantiation. + TBool iFeatureManagerFound; // Feature Manager is succesfully initialized }; diff -r 04da681812a9 -r 457cd4423b8c omadrm/drmplugins/drmrohandler/src/CRoHandler.cpp --- a/omadrm/drmplugins/drmrohandler/src/CRoHandler.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/omadrm/drmplugins/drmrohandler/src/CRoHandler.cpp Tue May 11 16:28:38 2010 +0300 @@ -42,6 +42,7 @@ #include // for R_PUSHMISC_UNK_SENDER #include // for R_QTN_DRM_MGR_INB_TITLE #include // Disk space checking +#include // Feature Manager #include "CRoHandler.h" #include "RoMtmCli.h" // for CRightsObjectMtmClient @@ -398,7 +399,7 @@ ) : CPushHandlerBase(), iFirstTime( ETrue ), iPushMsg( NULL ), iMsvId( NULL ), - iPutRightsToInbox( ETrue ) + iPutRightsToInbox( ETrue ), iFeatureManagerFound( EFalse ) { } @@ -428,7 +429,14 @@ CRepository* repository( NULL ); TInt err( KErrNone ); + TInt ret( KErrNone ); + TRAP( ret, FeatureManager::InitializeLibL() ); + if ( !ret ) + { + iFeatureManagerFound = ETrue; + } + User::LeaveIfError( iFs.Connect() ); // create drm @@ -510,7 +518,12 @@ // session must be deleted last (and constructed first) delete iSession; - + + if ( iFeatureManagerFound ) + { + FeatureManager::UnInitializeLib(); + } + #ifdef _DRM_TESTING TRAP( r, WriteL( _L8( "~CRoHandler-End" ) ) ); #endif @@ -657,26 +670,36 @@ { case EOma1Ro: { - HandleRightsMessageL(); + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm1FullSupport ) ) + { + HandleRightsMessageL(); + } break; } #ifdef __DRM_OMA2 case EOma2RoapTrigger: case EOma2RoapTriggerRoAcquisition: - { - HandleRoapTriggerL(); - break; - } + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + HandleRoapTriggerL(); + } + break; case EOma2RoapTriggerMetering: - { - HandleMeteringTriggerSilentlyL(); + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + HandleMeteringTriggerSilentlyL(); + } break; - } case EOma2RoapPdu: - { - HandleRoapPduL(); + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + HandleRoapPduL(); + } break; - } #endif default: { @@ -1400,22 +1423,30 @@ switch( iMsgType ) { case EOma1Ro: - { - HandleRightsMessageL(); + { + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm1FullSupport ) ) + { + HandleRightsMessageL(); + } break; } #ifdef __DRM_OMA2 case EOma2RoapTrigger: case EOma2RoapTriggerRoAcquisition: - { - HandleRoapTriggerL(); + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + HandleRoapTriggerL(); + } break; - } case EOma2RoapPdu: - { - HandleRoapPduL(); + if ( iFeatureManagerFound && FeatureManager::FeatureSupported( + KFeatureIdFfOmadrm2Support ) ) + { + HandleRoapPduL(); + } break; - } #endif default: { diff -r 04da681812a9 -r 457cd4423b8c wmdrm/camese/httpfiltercamese/Src/httpfiltercamesedrmheader.cpp --- a/wmdrm/camese/httpfiltercamese/Src/httpfiltercamesedrmheader.cpp Tue Apr 27 16:56:11 2010 +0300 +++ b/wmdrm/camese/httpfiltercamese/Src/httpfiltercamesedrmheader.cpp Tue May 11 16:28:38 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include // - Album Download +#include #include "httpfiltercamesedrmheader.h" #include "httpfiltercamesedatasupplier.h" @@ -263,10 +264,23 @@ { if ( contentTypeVal.StrF().DesC().MatchF( KDataTypeCameseDRM ) != KErrNotFound ) - { - CAMESE_LOG( "CHttpFilterCameseDrmHeader::CheckResponseHeaders Found Drm Header" ); - StartDrmHeaderCaptureL( aTrans ); - } + { + CAMESE_LOG( "CHttpFilterCameseDrmHeader::CheckResponseHeaders Found Drm Header" ); + + TUid u = TUid::Uid( KFeatureIdFfWmdrmDlaSupport ); + TBool wmDrmDlaSupportOn = ETrue; + TRAPD(err, wmDrmDlaSupportOn = CFeatureDiscovery::IsFeatureSupportedL( u )); + + if(wmDrmDlaSupportOn) + { + StartDrmHeaderCaptureL( aTrans ); + } + else if(!err) + { + aTrans.Response().SetStatusCode( KErrCompletion ); + aTrans.Fail(); + } + } } } diff -r 04da681812a9 -r 457cd4423b8c wmdrm/camese/httpfiltercamese/group/httpfiltercamese.mmp --- a/wmdrm/camese/httpfiltercamese/group/httpfiltercamese.mmp Tue Apr 27 16:56:11 2010 +0300 +++ b/wmdrm/camese/httpfiltercamese/group/httpfiltercamese.mmp Tue May 11 16:28:38 2010 +0300 @@ -53,8 +53,9 @@ LIBRARY inetprotutil.lib LIBRARY esock.lib LIBRARY ecom.lib -LIBRARY charconv.lib -LIBRARY wmdrmdla.lib +LIBRARY charconv.lib +LIBRARY wmdrmdla.lib LIBRARY centralrepository.lib // central repository +LIBRARY featdiscovery.lib SMPSAFE