os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/invalidplugin.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 
    18 #include "invalidplugin.h"
    19 #include <featmgr/featureinfoplugin.h>
    20 #include "featmgrdebug.h"
    21 #include "efm_test_consts.h"
    22 #include <ecom/implementationproxy.h>
    23 #include <e32property.h>
    24 
    25 // Map the interface implementation UIDs to implementation factory functions
    26 const TImplementationProxy ImplementationTable[] =
    27     {
    28     IMPLEMENTATION_PROXY_ENTRY(0x10283708,	CFeatMgrInvalidPlugin::NewL),
    29     };
    30 
    31 // Exported proxy for instantiation method resolution.
    32 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
    33     {
    34     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
    35     return ImplementationTable;
    36     }
    37 
    38 CFeatMgrInvalidPlugin* CFeatMgrInvalidPlugin::NewL()
    39     {
    40     CFeatMgrInvalidPlugin* self = new(ELeave) CFeatMgrInvalidPlugin();
    41     CleanupStack::PushL(self);
    42     self->ConstructL();
    43     CleanupStack::Pop(self);
    44     return self;
    45     }
    46 
    47 CFeatMgrInvalidPlugin::~CFeatMgrInvalidPlugin()
    48     {
    49     }
    50 
    51 CFeatMgrInvalidPlugin::CFeatMgrInvalidPlugin()
    52     {
    53     }
    54 
    55 void CFeatMgrInvalidPlugin::ProcessCommandL( const FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    56 									  const TUint8 aTransId,
    57 									  TDesC8& /*aData*/ )
    58 	{
    59 	INFO_LOG2( "FeatMgrPlugin: Processing command: 0x%x, TransId: 0x%x",
    60 						 aCommandId, aTransId );
    61 
    62 	switch ( aCommandId )
    63 		{
    64 		case FeatureInfoCommand::ELoadFeatureInfoCmdId:
    65 			{
    66 			INFO_LOG( "FeatMgrPlugin: Processed ELoadFeatureInfoCmdId" );
    67 			User::Leave(KErrNotSupported);
    68 			}
    69 			break;
    70 		case FeatureInfoCommand::ELoadEnhancedFeatureInfoCmdId:
    71 			{
    72 			INFO_LOG( "FeatMgrPlugin: Processed ELoadEnhancedFeatureInfoCmdId" );
    73 			User::Leave(KErrNotSupported);
    74 			}
    75 			break;
    76 		default:
    77 			{
    78 			INFO_LOG1( "FeatMgrPlugin: Unknown Command: 0x%x", aCommandId );
    79 			User::Leave(KErrNotSupported);
    80 			}
    81 			break;
    82 		}
    83 
    84 	TInt retval(KErrNone);
    85 	TInt timeout( 50 ); // microseconds
    86 
    87 	// create new timer
    88 
    89 
    90 	if ( iTimer && !iTimer->IsActive() )
    91 		{
    92 		delete iTimer;
    93 		iTimer = NULL;
    94 		}
    95 
    96 	iTimer = CPluginTimer::NewL(timeout, *iResponseCallback, aCommandId, aTransId, retval,this);
    97 	}
    98 
    99 
   100 void CFeatMgrInvalidPlugin::ConstructL()
   101     {
   102     }
   103 
   104 void CFeatMgrInvalidPlugin::GenericTimerFiredL(
   105 	    MFeatureInfoPluginCallback& /*aService*/,
   106 	    FeatureInfoCommand::TFeatureInfoCmd /*aCommandId*/,
   107 	    TUint8 /*aTransId*/,
   108 	    TInt /*aRetVal*/)
   109 	    {
   110 	    }