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