iaupdate/IAD/enabler/src/iaenabler.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   Source code for enabling FF_IAUPDATE feature flag
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <featurecontrol.h>
       
    21 
       
    22 
       
    23 // MACROS
       
    24 #ifdef  _DEBUG
       
    25 #define TRACE( aText ) { RDebug::Print( _L(aText) ); }
       
    26 #define TRACE_P( aText, aParam ) {RDebug::Print( _L(aText), aParam );}
       
    27 #else
       
    28 #define TRACE( aText )
       
    29 #define TRACE_P( aText, aParam )
       
    30 #endif  //_DEBUG
       
    31 
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // Enables feature FF_IAUPDATE
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 void EnableIAUpdateL( )
       
    38     {
       
    39     RFeatureControl featureControl;
       
    40     TInt error( KErrNone );
       
    41 
       
    42     error = featureControl.Connect();
       
    43     TRACE_P( "[IAEnabler] Connection to the Feature Manager Server: %d.", error );
       
    44 
       
    45     User::LeaveIfError( error );
       
    46 
       
    47     // Enable FF_IAUPDATE.
       
    48     TUid iaupdatefeature;
       
    49     iaupdatefeature.iUid = KFeatureIdIAUpdate;
       
    50     error = featureControl.EnableFeature( iaupdatefeature );
       
    51     TRACE_P( "[IAEnabler] Enable feature status: %d.", error );
       
    52 
       
    53     featureControl.Close();
       
    54     }
       
    55 
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // Main function
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 GLDEF_C TInt E32Main()
       
    62     {
       
    63     CTrapCleanup* cleanup = CTrapCleanup::New();
       
    64     TInt error( KErrNone );
       
    65     TRAP( error, EnableIAUpdateL() );
       
    66     delete cleanup;
       
    67     return error;
       
    68     }