mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp
changeset 25 d881023c13eb
parent 0 a2952bb97e68
child 32 edd273b3192a
equal deleted inserted replaced
21:a05c44bc3c61 25:d881023c13eb
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <mtp/mtpprotocolconstants.h>
    19 #include <mtp/mtpprotocolconstants.h>
    20 #include <mtp/tmtptyperequest.h>
    20 #include <mtp/tmtptyperequest.h>
    21 #include <mtp/mmtpdataproviderframework.h>
       
    22 #include <mtp/tmtptypeevent.h>
    21 #include <mtp/tmtptypeevent.h>
    23 #include <mtp/mmtpconnection.h>
    22 #include <mtp/mmtpconnection.h>
    24 #include <mtp/mmtpobjectmgr.h>
    23 #include <mtp/mmtpobjectmgr.h>
    25 #include <e32property.h>
    24 #include <e32property.h>
    26 #include <MtpPrivatePSKeys.h>
    25 #include <mtpprivatepskeys.h>
    27 
    26 
    28 #include "crequestprocessor.h"
    27 #include "crequestprocessor.h"
    29 #include "crequestchecker.h"
    28 #include "crequestchecker.h"
    30 #include "mmmtpdplogger.h"
    29 #include "mmmtpdplogger.h"
    31 
    30 
    37 // -----------------------------------------------------------------------------
    36 // -----------------------------------------------------------------------------
    38 //
    37 //
    39 EXPORT_C CRequestProcessor::CRequestProcessor( MMTPDataProviderFramework& aFramework,
    38 EXPORT_C CRequestProcessor::CRequestProcessor( MMTPDataProviderFramework& aFramework,
    40     MMTPConnection& aConnection,
    39     MMTPConnection& aConnection,
    41     TInt aElementCount,
    40     TInt aElementCount,
    42     const TMTPRequestElementInfo* aElements ):
    41     const TMTPRequestElementInfo* aElements ) :
    43     CActive( EPriorityStandard ),
    42         CActive( EPriorityStandard ),
    44     iFramework( aFramework ),
    43         iFramework( aFramework ),
    45     iConnection( aConnection ),
    44         iConnection( aConnection ),
    46     iElementCount( aElementCount ),
    45         iElementCount( aElementCount ),
    47     iElements( aElements )
    46         iElements( aElements )
    48     {
    47     {
       
    48     // Note: It has been moved to specific operation handler
       
    49     // Some operations don't need add into active scheduler
    49     // CActiveScheduler::Add( this );
    50     // CActiveScheduler::Add( this );
    50     }
    51     }
    51 
    52 
    52 // -----------------------------------------------------------------------------
    53 // -----------------------------------------------------------------------------
    53 // CRequestProcessor::~CRequestProcessor
    54 // CRequestProcessor::~CRequestProcessor
    54 // Destructor
    55 // Destructor
    55 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    56 //
    57 //
    57 EXPORT_C CRequestProcessor::~CRequestProcessor()
    58 EXPORT_C CRequestProcessor::~CRequestProcessor()
    58     {
    59     {
    59 //    Cancel();
    60     // Note: It has been moved to specific operation handler
       
    61     // Some operations don't need add into active scheduler
       
    62     // Cancel();
    60     iNullBuffer.Close();
    63     iNullBuffer.Close();
    61     delete iRequestChecker;
    64     delete iRequestChecker;
    62     }
    65     }
    63 
    66 
    64 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
   388 // part of active object framework, provide default implementation
   391 // part of active object framework, provide default implementation
   389 // -----------------------------------------------------------------------------
   392 // -----------------------------------------------------------------------------
   390 //
   393 //
   391 EXPORT_C void CRequestProcessor::RunL()
   394 EXPORT_C void CRequestProcessor::RunL()
   392     {
   395     {
   393 
   396     // Do nothing
   394     }
   397     }
   395 
   398 
   396 // -----------------------------------------------------------------------------
   399 // -----------------------------------------------------------------------------
   397 // CRequestProcessor::DoCancel
   400 // CRequestProcessor::DoCancel
   398 // part of active object framework, provide default implementation
   401 // part of active object framework, provide default implementation
   399 // -----------------------------------------------------------------------------
   402 // -----------------------------------------------------------------------------
   400 //
   403 //
   401 EXPORT_C void CRequestProcessor::DoCancel()
   404 EXPORT_C void CRequestProcessor::DoCancel()
   402     {
   405     {
   403 
   406     // Do nothing
   404     }
   407     }
   405 
   408 
   406 // -----------------------------------------------------------------------------
   409 // -----------------------------------------------------------------------------
   407 // CRequestProcessor::RunError
   410 // CRequestProcessor::RunError
   408 // part of active object framework, provide default implementation
   411 // part of active object framework, provide default implementation
   409 // -----------------------------------------------------------------------------
   412 // -----------------------------------------------------------------------------
   410 //
   413 //
   411 EXPORT_C TInt CRequestProcessor::RunError( TInt aError )
   414 EXPORT_C TInt CRequestProcessor::RunError( TInt aError )
   412     {
   415     {
   413     PRINT1( _L( "MM MTP <> CRequestProcessor RunError = %d" ), aError );
   416     if ( aError != KErrNone )
       
   417         PRINT1( _L( "MM MTP <> CRequestProcessor RunError = %d" ), aError );
       
   418 
   414     TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) );
   419     TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) );
       
   420 
   415     return KErrNone;
   421     return KErrNone;
   416     }
   422     }
   417 
   423 
   418 EXPORT_C TBool CRequestProcessor::HasDataphase() const
   424 EXPORT_C TBool CRequestProcessor::HasDataphase() const
   419     {
   425     {