// ---------------------------------------------------------------------------
// CLbtStratergyContainer::RunL
// ---------------------------------------------------------------------------
//
void CLbtStratergyContainer::RunL()
	{
	FUNC_ENTER("CLbtStratergyContainer::RunL");
	// request ecom framework for notification
	iEComSession->NotifyOnChange(iStatus);
	SetActive();
	
	RImplInfoPtrArray implArray;
	REComSession::ListImplementationsL(KLocAcquisitionStrategyInterfaceUid, implArray);
	CleanupClosePushL(implArray);

	CImplementationInformation* info = implArray[0];
	
	// If stratergy is already loaded, and if its
	// dll has changed then reload it
	if(info->Version() != iVersion && iStratergy )
	    {
	    // this will unload stratergy
	    delete iStratergy;
	    iStratergy = NULL;
	    // Load the dll again
	    iStratergy = CLbtStrategyBase::NewL(this);
	    iVersion = info->Version();
        }
    CleanupStack::PopAndDestroy(); // implArray
	}
Exemplo n.º 2
0
TInt VersionLinearOrderFunction(const CImplementationInformation& pluginA, 
                                const CImplementationInformation& pluginB)
	{
	if (pluginA.Version() == pluginB.Version())
		{
		return 0;
		}

	return (pluginA.Version() < pluginB.Version())? 1: -1;	
	}
// ---------------------------------------------------------------------------
// CLbtStratergyContainer::LoadStratergyL
// ---------------------------------------------------------------------------
//
void CLbtStratergyContainer::LoadStratergyL(MLbtTriggeringSupervisionObserver* aPtr)
	{
	FUNC_ENTER("CLbtStratergyContainer::LoadStratergyL");
	RImplInfoPtrArray implArray;
	REComSession::ListImplementationsL(KLocAcquisitionStrategyInterfaceUid, implArray);	
	if(implArray.Count() != 1)
		{
		implArray.ResetAndDestroy();
		// Leave if there are more than one or no 
		// implementation of stratergy
		User::Leave(KErrNotFound);
		}
	TCleanupItem arrayCleanup( RImpleInfoPtrArrayCleanup, &implArray );
	CleanupStack::PushL(arrayCleanup);
	CImplementationInformation* info = implArray[0];
	iStratergy = CLbtStrategyBase::NewL(aPtr);
	iVersion = info->Version();
	CleanupStack::PopAndDestroy(); // implArray
	
	iProperty.Set(KPSUidLbtStatusInformation, 
                  KLbtLocationTriggeringSupervisionStatus, 
                  ELbtLocationTriggeringSupervisionSuccessful);
                                     
  // request ecom framework for ecom change notification
	iEComSession->NotifyOnChange(iStatus);	
	SetActive();
	}
 TCFActionLoaderInfo( CImplementationInformation& aImplementationInfo,
     CCFActivatorEngineActionPluginManager& aManager ):
     iImplUid( aImplementationInfo.ImplementationUid() ),
     iImplVersion( aImplementationInfo.Version() ),
     iManager( aManager )
     {
     }
void CMMFControllerImplementationInformation::ConstructL(const CImplementationInformation& aImplInfo)
	{
	iUriSchemes = new(ELeave) CDesC8ArrayFlat(KDesCArrayGranularity);
	iUid = aImplInfo.ImplementationUid();
	iDisplayName = aImplInfo.DisplayName().AllocL();
	iVersion = aImplInfo.Version();

	// Parse the opaque data...
	TaggedDataParser::ParseTaggedDataL(aImplInfo.OpaqueData(), *this);
	}
//----------------------------------------------------------------------------
// CCFActionPlugInThread::CCFActionPlugInThread
//----------------------------------------------------------------------------
//
CCFActionPlugInThread::CCFActionPlugInThread(
	CCFActivatorEngineActionPluginManager& aActionPluginManager,
	CImplementationInformation& aImplInfo )
	: iPlugInUid( aImplInfo.ImplementationUid() ),
    iImplVersion( aImplInfo.Version() ),
	iActionPluginManager( &aActionPluginManager )
	{
    FUNC_LOG;

	}
void CheckForPhbkSyncPluginL()
	{
	test.Next(_L("Check for PhbkSync test plug-in"));

	RImplInfoPtrArray	implInfoArray;
	CleanupResetAndDestroyPushL(implInfoArray);
	REComSession::ListImplementationsL(KUidEcomCntPhBkSyncInterface, implInfoArray);
	//Find implementations of KUidEcomCntPhBkSyncInterface
	TInt availCount = implInfoArray.Count(); 
	TInt count;
	for(count = 0; count < availCount; count++)
		{
		const TUid firstImplementationFound = implInfoArray[count]->ImplementationUid();
		CImplementationInformation *info = implInfoArray[count];
		test.Printf(_L("\n"));
		test.Printf(_L("PhbkSync plugin #%i, Implementation UID 0x%08X version %i\n"),
			count + 1, info->ImplementationUid(), info->Version());
		test.Printf(_L("Plugin name = \"%S\"\n"), &(info->DisplayName()));
		}

	// is telephony's plug-in in the list?
	for(count = 0; count < availCount; count++)
		{
		const TUid firstImplementationFound = implInfoArray[count]->ImplementationUid();
		CImplementationInformation *info = implInfoArray[count];
		if(info->DisplayName() == KTestPluginName)
			{
			test.Printf(_L("\n"));
			test.Printf(_L("This test has now loaded the test plugin"));
			test.Printf(_L("\n"));
			availCount = 1;
			break;
			}		
		
		if(info->DisplayName() == KPluginName)
			{
			test.Printf(_L("\n"));
			test.Printf(_L("This test only works with Contacts the test plugin and not the original phonebooksync plugin."));
			test.Printf(_L("Depending on the build to removed the plugin in different ways:"));
			test.Printf(_L("hardware - delete the line \"ECOM_PLUGIN(phbksyncplugin.dll,1020428c.rsc)\" from phbksync.iby"));
			test.Printf(_L("winscw - delete phbksyncplugin.dll from %epocroot%/epoc32/release/winscw/udeb or similarly named directory"));
			test.Printf(_L("\n"));
			test(0);  // stop
			break;
			}
		}

	// only continue test if there is exactly one plug-in present
	test(availCount == 1);	

	CleanupStack::PopAndDestroy(&implInfoArray);
	}