contextframework/cfw/src/cfservices/cfecompluginmanager.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CCFEComPluginManager class description.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cfecompluginmanager.h"
       
    20 #include "cftrace.h"
       
    21 
       
    22 // MEMBER FUNCTIONS
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 // CCFEComPluginManager::~CCFEComPluginManager
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CCFEComPluginManager::~CCFEComPluginManager()
       
    29     {
       
    30     FUNC_LOG;
       
    31 
       
    32     iUidArray.Close();
       
    33     }
       
    34 
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // CCFEComPluginManager::AddToBlackList
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 EXPORT_C TInt CCFEComPluginManager::AddToBlackList( const TUid& aImplUid )
       
    41     {
       
    42     FUNC_LOG;
       
    43     INFO_1( "Adding implementation UID 0x%08x to blacklist", aImplUid.iUid );
       
    44 
       
    45     TInt err = iUidArray.InsertInSignedKeyOrder( aImplUid );
       
    46     if ( err == KErrAlreadyExists )
       
    47         {
       
    48         err = KErrNone; // Ignore duplicates
       
    49         }
       
    50 
       
    51     ERROR( err, "Failed to add UID to blacklist" );
       
    52     return err;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CCFEComPluginManager::RemoveBlackListed
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 EXPORT_C void CCFEComPluginManager::RemoveBlackListed(
       
    61     RImplInfoPtrArray& aImplInfoArray )
       
    62     {
       
    63     FUNC_LOG;
       
    64 
       
    65     TInt numUids = aImplInfoArray.Count();
       
    66     for( TInt i = numUids - 1; i >= 0 ; i-- ) // elements are removed from
       
    67         {  // array so it's safer to start from the end.
       
    68         CImplementationInformation* implInfo = aImplInfoArray[i];
       
    69         if ( iUidArray.FindInSignedKeyOrder( implInfo->ImplementationUid() )
       
    70              != KErrNotFound )
       
    71             {
       
    72             INFO_1( "Implementation UID 0x%08x is on blacklist", implInfo->ImplementationUid().iUid );
       
    73 
       
    74             delete implInfo;
       
    75             aImplInfoArray.Remove( i );
       
    76             }
       
    77         }
       
    78     }
       
    79 
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // CCFEComPluginManager::CCFEComPluginManager
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 EXPORT_C CCFEComPluginManager::CCFEComPluginManager()
       
    86     {
       
    87     FUNC_LOG;
       
    88 
       
    89     // Nothing to do
       
    90     }
       
    91