connectivitymodules/SeCon/services/pcd/src/sconinstqueue.cpp
changeset 40 b63e67867dcd
parent 19 2691f6aa1921
equal deleted inserted replaced
39:9905f7d46607 40:b63e67867dcd
     1 /*
     1 /*
     2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    46 // Constructor
    46 // Constructor
    47 // -----------------------------------------------------------------------------
    47 // -----------------------------------------------------------------------------
    48 //
    48 //
    49 CSConInstallerQueue::CSConInstallerQueue( RFs& aFs ) : CActive( EPriorityStandard ), iFs( aFs )
    49 CSConInstallerQueue::CSConInstallerQueue( RFs& aFs ) : CActive( EPriorityStandard ), iFs( aFs )
    50 	{
    50 	{
       
    51     CActiveScheduler::Add( this );
    51 	}
    52 	}
    52 	
    53 	
    53 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    54 // CSConInstallerQueue::ConstructL()
    55 // CSConInstallerQueue::ConstructL()
    55 // Initializes member data
    56 // Initializes member data
    56 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    57 //
    58 //
    58 void CSConInstallerQueue::ConstructL()
    59 void CSConInstallerQueue::ConstructL()
    59 	{
    60 	{
    60 	TRACE_FUNC_ENTRY;
    61 	TRACE_FUNC_ENTRY;
    61 	iInstaller = new (ELeave) CSConAppInstaller( this, iFs );
    62 	iInstaller = CSConAppInstaller::NewL( this, iFs );
    62 	CActiveScheduler::Add( iInstaller );
       
    63 	User::LeaveIfError( iTimer.CreateLocal() );
    63 	User::LeaveIfError( iTimer.CreateLocal() );
    64 	TRACE_FUNC_EXIT;
    64 	TRACE_FUNC_EXIT;
    65 	}
    65 	}
    66 	
    66 	
    67 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
   149 // Polls queue
   149 // Polls queue
   150 // -----------------------------------------------------------------------------
   150 // -----------------------------------------------------------------------------
   151 //
   151 //
   152 void CSConInstallerQueue::PollQueue()
   152 void CSConInstallerQueue::PollQueue()
   153 	{
   153 	{
   154 	TRACE_FUNC_ENTRY;
   154 	TRACE_FUNC;
   155 	// find and start next task if installer and BR is inactive
   155 	// find and start next task if installer and BR is inactive
   156 	if( !iInstaller->InstallerActive()
   156 	if( !iInstaller->InstallerActive()
   157 		&& !iBRQueueAddress->QueueProcessActive() )
   157 		&& !iBRQueueAddress->QueueProcessActive() )
   158 		{
   158 		{
   159 		//find next task
   159 		//find next task
   166 				iInstaller->StartInstaller( iQueue[i]->iTaskId );
   166 				iInstaller->StartInstaller( iQueue[i]->iTaskId );
   167 				i = iQueue.Count() + 1; // jump out from loop
   167 				i = iQueue.Count() + 1; // jump out from loop
   168 				}
   168 				}
   169 			}
   169 			}
   170 		}
   170 		}
   171 	TRACE_FUNC_EXIT;
       
   172 	}
   171 	}
   173 
   172 
   174 // -----------------------------------------------------------------------------
   173 // -----------------------------------------------------------------------------
   175 // CSConInstallerQueue::DoCancel()
   174 // CSConInstallerQueue::DoCancel()
   176 // Implementation of CActive::DoCancel()
   175 // Implementation of CActive::DoCancel()