featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp
branchRCL_3
changeset 6 5ffdb8f2067f
parent 0 08ec8eefde2f
child 8 fa9941cf3867
equal deleted inserted replaced
2:6862383cf555 6:5ffdb8f2067f
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   100     INFO_LOG1( "CFeatMgrSession::PanicClient(aPanic 0x%x)", aPanic);
   100     INFO_LOG1( "CFeatMgrSession::PanicClient(aPanic 0x%x)", aPanic);
   101 
   101 
   102 	aMessage.Panic( KPanicCategory, aPanic );
   102 	aMessage.Panic( KPanicCategory, aPanic );
   103     }
   103     }
   104 
   104 
       
   105 TBool CFeatMgrSession::IsWriteOperation( const TInt aFunction ) const
       
   106     {
       
   107         switch ( aFunction )
       
   108             {
       
   109             case EFeatMgrEnableFeature:
       
   110             case EFeatMgrDisableFeature:
       
   111             case EFeatMgrAddFeature:
       
   112             case EFeatMgrSetFeatureAndData:
       
   113             case EFeatMgrSetFeatureData:
       
   114             case EFeatMgrDeleteFeature:
       
   115             case EFeatMgrSWIStart:
       
   116             case EFeatMgrSWIEnd:
       
   117                 return ETrue;
       
   118             default:
       
   119                 return EFalse;
       
   120             }
       
   121     }
       
   122 
   105 // -----------------------------------------------------------------------------
   123 // -----------------------------------------------------------------------------
   106 // CFeatMgrSession::ServiceL
   124 // CFeatMgrSession::ServiceL
   107 // Calls request handling functions. Also traps any leaves and signals client if
   125 // Calls request handling functions. Also traps any leaves and signals client if
   108 // error occurs.
   126 // error occurs.
   109 // -----------------------------------------------------------------------------
   127 // -----------------------------------------------------------------------------
   110 //
   128 //
   111 void CFeatMgrSession::ServiceL( const RMessage2& aMessage )
   129 void CFeatMgrSession::ServiceL( const RMessage2& aMessage )
   112     {
   130     {
   113     FUNC_LOG
   131     FUNC_LOG
   114     
   132     // If plugins are not ready all request will be queued. 
   115     if ( !iFeatMgrServer.PluginsReady() )
   133     // During backup operation, all write request e.g. EnableFeature will be queued
       
   134     TInt msgCmd = aMessage.Function();
       
   135     if ( !iFeatMgrServer.PluginsReady() || ( iFeatMgrServer.BackupIsInProgress() && IsWriteOperation( msgCmd ) ) )
   116         {
   136         {
   117         INFO_LOG( "CFeatMgrSession::ServiceL() - plugins not ready" );
   137         INFO_LOG( "CFeatMgrSession::ServiceL() - plugins not ready or backup is in progress" );
   118         iList.AddLast( *CFeatMgrPendingRequest::NewL( aMessage ) );        
   138         iList.AddLast( *CFeatMgrPendingRequest::NewL( aMessage ) );        
   119         }
   139         }
   120     else
   140     else
   121         {
   141         {
   122         #if defined(FEATMGR_INFO_LOG_ENABLED)
   142         #if defined(FEATMGR_INFO_LOG_ENABLED)