convergedconnectionhandler/cchclientapi/src/cchserviceimpl.cpp
branchRCL_3
changeset 11 6134b5029079
parent 9 bddb6d4447db
child 12 876a3df1f464
--- a/convergedconnectionhandler/cchclientapi/src/cchserviceimpl.cpp	Wed Mar 31 21:20:05 2010 +0300
+++ b/convergedconnectionhandler/cchclientapi/src/cchserviceimpl.cpp	Wed Apr 14 15:49:55 2010 +0300
@@ -136,10 +136,29 @@
 TInt CCchServiceImpl::Enable( TCCHSubserviceType aType )
     {
     CCHLOGSTRING( "CCchServiceImpl::Enable: IN" );
-	
-    iAsynchroniser->Enable(aType);
+    TInt error = KErrNone;
+    if (iCch.ConnectivityDialogsAllowed())
+        {
+        CCHLOGSTRING( "CCchServiceImpl::Enable: Async mode" );
+        iAsynchroniser->Enable(aType);
+        }
+    else
+        {
+        CCHLOGSTRING( "CCchServiceImpl::Enable: Sync mode" );
+        TServiceSelection selection( iServiceId, aType );
+        TRequestStatus status = KErrNone;
+        iCch.CchClient().EnableService( selection, status, EFalse );
+   
+        //even the cchclient api seems to be asynchronous, 
+        //this method is completed immediately
+        User::WaitForRequest( status );
+        error = status.Int();
+        }
+        
+    CCHLOGSTRING2( " CCchServiceImpl::Enable: return  %d", error );
+    
 	CCHLOGSTRING( "CCchServiceImpl::Enable: OUT" );
-    return KErrNone;
+    return error;
     }
 
 // ---------------------------------------------------------------------------