convergedconnectionhandler/cchclientapi/src/cchserviceimpl.cpp
branchRCL_3
changeset 11 bddb6d4447db
parent 0 a4daefaec16c
child 16 6134b5029079
equal deleted inserted replaced
10:7117cbf1600a 11:bddb6d4447db
    22 #include "cchserviceimpl.h"
    22 #include "cchserviceimpl.h"
    23 #include "cchlogger.h"
    23 #include "cchlogger.h"
    24 #include "cchimpl.h"
    24 #include "cchimpl.h"
    25 #include "cchclientobserver.h"
    25 #include "cchclientobserver.h"
    26 #include "cchclientserverinternal.h"
    26 #include "cchclientserverinternal.h"
       
    27 #include "cchserviceimplasynchroniser.h"
    27 
    28 
    28 #ifdef CCHAPI_USE_CCHUI
    29 #ifdef CCHAPI_USE_CCHUI
    29 #include "cchuiprivateapi.h"
    30 #include "cchuiprivateapi.h"
    30 #endif
    31 #endif
    31 
    32 
    77     if( iObserver )
    78     if( iObserver )
    78     	{
    79     	{
    79     	RemoveObserver();
    80     	RemoveObserver();
    80     	}
    81     	}
    81     delete iObserver;
    82     delete iObserver;
       
    83     delete iAsynchroniser;
    82     }
    84     }
    83 
    85 
    84 // ---------------------------------------------------------------------------
    86 // ---------------------------------------------------------------------------
    85 // CCchServiceImpl::ConstructL
    87 // CCchServiceImpl::ConstructL
    86 // Symbian 2nd phase constructor can leave.
    88 // Symbian 2nd phase constructor can leave.
    88 //
    90 //
    89 void CCchServiceImpl::ConstructL()
    91 void CCchServiceImpl::ConstructL()
    90     {
    92     {
    91     CCHLOGSTRING( "CCchServiceImpl::ConstructL: IN" );
    93     CCHLOGSTRING( "CCchServiceImpl::ConstructL: IN" );
    92     iObserver = CCchClientObserver::NewL( *this );
    94     iObserver = CCchClientObserver::NewL( *this );
       
    95     iAsynchroniser = CCchServiceImplAsynchroniser::NewL(iCch, iServiceId, iCchUi );
    93     CCHLOGSTRING( "CCchServiceImpl::ConstructL: OUT" );
    96     CCHLOGSTRING( "CCchServiceImpl::ConstructL: OUT" );
    94     }
    97     }
    95 // ---------------------------------------------------------------------------
    98 // ---------------------------------------------------------------------------
    96 // CCchServiceImpl::NewL
    99 // CCchServiceImpl::NewL
    97 // Two-phased constructor.
   100 // Two-phased constructor.
   132 //
   135 //
   133 TInt CCchServiceImpl::Enable( TCCHSubserviceType aType )
   136 TInt CCchServiceImpl::Enable( TCCHSubserviceType aType )
   134     {
   137     {
   135     CCHLOGSTRING( "CCchServiceImpl::Enable: IN" );
   138     CCHLOGSTRING( "CCchServiceImpl::Enable: IN" );
   136 	
   139 	
   137     TRequestStatus status = KErrNone;
   140     iAsynchroniser->Enable(aType);
   138 	TServiceSelection selection( iServiceId, aType );
   141 	CCHLOGSTRING( "CCchServiceImpl::Enable: OUT" );
   139     iCch.CchClient().EnableService( selection, status, EFalse );
   142     return KErrNone;
   140     //even the cchclient api seems to be asynchronous, 
       
   141 	//this method is completed immediately
       
   142 	User::WaitForRequest( status );
       
   143     CCHLOGSTRING( "CCchServiceImpl::Enable: OUT" );
       
   144     
       
   145     if ( iCch.ConnectivityDialogsAllowed() )
       
   146         {        
       
   147         TRAPD( err, iCchUi.ManualEnableResultL( 
       
   148             iServiceId, status.Int() ) );
       
   149         
       
   150         if( err != KErrNone )
       
   151             {
       
   152             return KErrNotReady;
       
   153             }
       
   154         }
       
   155     
       
   156     return status.Int();
       
   157     }
   143     }
   158 
   144 
   159 // ---------------------------------------------------------------------------
   145 // ---------------------------------------------------------------------------
   160 // CCchServiceImpl::Disable
   146 // CCchServiceImpl::Disable
   161 // ---------------------------------------------------------------------------
   147 // ---------------------------------------------------------------------------
   162 //
   148 //
   163 TInt CCchServiceImpl::Disable( TCCHSubserviceType aType )
   149 TInt CCchServiceImpl::Disable( TCCHSubserviceType aType )
   164     {
   150     {
   165     CCHLOGSTRING( "CCchServiceImpl::Disable: IN" );
   151     CCHLOGSTRING( "CCchServiceImpl::Disable: IN" );
   166     
   152   
   167     TRequestStatus status = KErrNone;
   153     iAsynchroniser->Disable(aType);
   168 	TServiceSelection selection( iServiceId, aType );
       
   169     iCch.CchClient().DisableService( selection, status );
       
   170     //even the cchclient api seems to be asynchronous, 
       
   171 	//this method is completed immediately
       
   172 	User::WaitForRequest( status );
       
   173     CCHLOGSTRING( "CCchServiceImpl::Disable: OUT" );
   154     CCHLOGSTRING( "CCchServiceImpl::Disable: OUT" );
   174     return status.Int();
   155     return KErrNone;
   175     }
   156     }
   176 
   157 
   177 // ---------------------------------------------------------------------------
   158 // ---------------------------------------------------------------------------
   178 // CCchServiceImpl::GetStatus
   159 // CCchServiceImpl::GetStatus
   179 // ---------------------------------------------------------------------------
   160 // ---------------------------------------------------------------------------