diff -r f56ec6ce2732 -r 6f9f6e99a23e mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp --- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Tue May 11 16:40:32 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Tue May 25 13:14:13 2010 +0300 @@ -27,6 +27,7 @@ #include #include #include +#include // for RProperty // for asf mimetype parsing #ifdef __WINDOWS_MEDIA @@ -39,6 +40,7 @@ #include "tobjectdescription.h" #include "mmmtpdplogger.h" #include "mmmtpdp_variant.hrh" +#include "cmmmtpdpaccesssingleton.h" using namespace ContentAccess; @@ -702,4 +704,36 @@ return drmStatus; } +EXPORT_C void MmMtpDpUtility::SetPSStatus( TMtpPSStatus aStatus ) + { + TBool changeScheduled = EFalse; + CMmMtpDpAccessSingleton::CancelActiveToIdleStatusChange(); // cancel any outstanding delay status change + + if ( aStatus == EMtpPSStatusReadyToSync ) + { + TInt mtpStatus; + RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus ); + + if ( mtpStatus == EMtpPSStatusActive ) + { + CMmMtpDpAccessSingleton::ActiveToIdleStatusChange(); + changeScheduled = ETrue; + } + } + + if ( !changeScheduled ) + DoSetPSStatus( aStatus ); + } + +void MmMtpDpUtility::DoSetPSStatus( TMtpPSStatus aStatus ) + { + TInt mtpStatus; + RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus ); + + if ( mtpStatus != aStatus ) + { + TInt err = RProperty::Set( KMtpPSUid, KMtpPSStatus, aStatus ); + PRINT3( _L("MM MTP <> CRequestProcessor::DoSetPSStatus err = %d, previous = %d, current = %d" ), err , mtpStatus, aStatus); + } + } // end of file