featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp
branchRCL_3
changeset 8 fa9941cf3867
parent 6 5ffdb8f2067f
child 9 667e88a979d7
equal deleted inserted replaced
6:5ffdb8f2067f 8:fa9941cf3867
   128 //
   128 //
   129 void CFeatMgrSession::ServiceL( const RMessage2& aMessage )
   129 void CFeatMgrSession::ServiceL( const RMessage2& aMessage )
   130     {
   130     {
   131     FUNC_LOG
   131     FUNC_LOG
   132     // If plugins are not ready all request will be queued. 
   132     // If plugins are not ready all request will be queued. 
   133     // During backup operation, all write request e.g. EnableFeature will be queued
   133     // During backup & restore operation, all write request 
       
   134     //  e.g. EnableFeature will return with KErrServerBusy
   134     TInt msgCmd = aMessage.Function();
   135     TInt msgCmd = aMessage.Function();
   135     if ( !iFeatMgrServer.PluginsReady() || ( iFeatMgrServer.BackupIsInProgress() && IsWriteOperation( msgCmd ) ) )
   136     if ( !iFeatMgrServer.PluginsReady() || ( iFeatMgrServer.BURIsInProgress()  && IsWriteOperation( msgCmd ) ) )
   136         {
   137         {
   137         INFO_LOG( "CFeatMgrSession::ServiceL() - plugins not ready or backup is in progress" );
   138         if ( iFeatMgrServer.BURIsInProgress() )
   138         iList.AddLast( *CFeatMgrPendingRequest::NewL( aMessage ) );        
   139             {
       
   140             INFO_LOG( "CFeatMgrSession::ServiceL() - backup/restore is in progress - no write operation allowed" );
       
   141             aMessage.Complete( KErrServerBusy );
       
   142             }
       
   143         else
       
   144             {
       
   145             INFO_LOG( "CFeatMgrSession::ServiceL() - plugins not ready" );
       
   146             iList.AddLast( *CFeatMgrPendingRequest::NewL( aMessage ) );
       
   147             }
   139         }
   148         }
   140     else
   149     else
   141         {
   150         {
   142         #if defined(FEATMGR_INFO_LOG_ENABLED)
   151         #if defined(FEATMGR_INFO_LOG_ENABLED)
   143             // check memory usage
   152             // check memory usage
   523     	    TPckgC<TInt> resPckg( getIdErr );
   532     	    TPckgC<TInt> resPckg( getIdErr );
   524             aMessage.WriteL( 0, resPckg );
   533             aMessage.WriteL( 0, resPckg );
   525             
   534             
   526     		break;
   535     		break;
   527     	    }
   536     	    }
   528     	    
   537 
   529 #ifdef EXTENDED_FEATURE_MANAGER_TEST
   538 #ifdef EXTENDED_FEATURE_MANAGER_TEST
       
   539     	    
       
   540         case EFeatMgrResourceMark:
       
   541             ResourceCountMarkStart();
       
   542             break;
       
   543             
       
   544         case EFeatMgrResourceCheck:
       
   545             ResourceCountMarkEnd(aMessage);
       
   546             break;
       
   547         
       
   548         case EFeatMgrResourceCount:
       
   549             {
       
   550             TInt retCode = CountResources();
       
   551             User::Leave(retCode);
       
   552             }
       
   553             break;
       
   554         
       
   555         case EFeatMgrSetHeapFailure:
       
   556             {
       
   557             RAllocator::TAllocFail mode = static_cast <RAllocator::TAllocFail> (aMessage.Int0());
       
   558             TInt failAllocNum = aMessage.Int1();
       
   559             if(mode == RHeap::EBurstFailNext || mode == RHeap::EBurstRandom || mode == RHeap::EBurstTrueRandom || mode == RHeap::EBurstDeterministic)
       
   560                 {
       
   561                 User::__DbgSetBurstAllocFail(RHeap::EUser, mode, failAllocNum, 20);
       
   562                 }
       
   563             else
       
   564                 {
       
   565                 User::__DbgSetAllocFail(RHeap::EUser, mode, failAllocNum);
       
   566                 }
       
   567             }
       
   568             break;
       
   569 
   530     	    // debug only API 
   570     	    // debug only API 
   531     	    // returns the size of the iNotifyFeatures array
   571     	    // returns the size of the iNotifyFeatures array
   532         case EFeatMgrNumberOfNotifyFeatures:
   572         case EFeatMgrNumberOfNotifyFeatures:
   533     	    {
   573     	    {
   534     	    TInt count = iNotifyFeatures.Count();
   574     	    TInt count = iNotifyFeatures.Count();
   588                 }
   628                 }
   589             }
   629             }
   590         }
   630         }
   591     }
   631     }
   592 
   632 
       
   633 TInt CFeatMgrSession::CountResources()
       
   634     {
       
   635     return User::CountAllocCells();
       
   636     }
   593 
   637 
   594 // ============================= LOCAL FUNCTIONS ===============================
   638 // ============================= LOCAL FUNCTIONS ===============================
   595 
   639 
   596 // ============================ MEMBER FUNCTIONS ===============================
   640 // ============================ MEMBER FUNCTIONS ===============================
   597 
   641