201037 PDK_4.0.a
authorhgs
Wed, 29 Sep 2010 13:09:05 +0300
changeset 65 001a94c71129
parent 57 5ebadcda06cb
child 67 16e4b9007960
201037
bluetoothengine/bteng/inc/btengserver.h
bluetoothengine/bteng/inc/btengsrvkeywatcher.h
bluetoothengine/bteng/src/btengserver.cpp
bluetoothengine/bteng/src/btengsrvkeywatcher.cpp
bluetoothengine/bteng/src/btengsrvpluginmgr.cpp
bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp
bluetoothengine/btsap/inc/BTSapMessage.h
bluetoothengine/btsap/inc/BTSapServerState.h
bluetoothengine/btsap/src/BTSapServerState.cpp
bluetoothengine/btsap/src/BTSapState.cpp
bluetoothengine/btsap/src/BTSapStateConnect.cpp
bluetoothengine/btxqservice/btxqservice.pro
bluetoothengine/btxqservice/inc/btxqserviceapi.h
btservices_plat/bt_xqservice_api/bt_xqservice_api.metaxml
btservices_plat/bt_xqservice_api/bt_xqservice_api.pri
btservices_plat/bt_xqservice_api/inc/btxqserviceapi.h
btservices_plat/btservices_plat.pro
--- a/bluetoothengine/bteng/inc/btengserver.h	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengserver.h	Wed Sep 29 13:09:05 2010 +0300
@@ -132,6 +132,15 @@
             { return iSettingsMgr; }
 
     /**
+     * Getter for key watcher instance.
+     *
+     * @since Symbian^3
+     * @return Pointer to instance of key watcher.
+     */
+    inline CBTEngSrvKeyWatcher* KeyWatcher() const
+            { return iWatcher; }
+    
+    /**
      * Getter for plug-in manager instance.
      *
      * @since Symbian^3
--- a/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Wed Sep 29 13:09:05 2010 +0300
@@ -79,6 +79,10 @@
      */
     virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
+public:
+    
+    TBool GetSspDebugModeKeyValue();
+    
 private:
 
     /**
--- a/bluetoothengine/bteng/src/btengserver.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -568,11 +568,17 @@
 //
 TInt CBTEngServer::DebugModeTimerCallBack( TAny* aPtr )
     {
+    TRACE_FUNC_ENTRY
     __ASSERT_ALWAYS(aPtr, PanicServer(EBTEngPanicArgumentIsNull) );
-    // Set our internal debug mode key to off. Ignore error, not critical here.
-    (void) RProperty::Set( KPSUidBluetoothTestingMode, KBTSspDebugmode, EFalse );
     CBTEngServer* server = (CBTEngServer*) aPtr;
-    TRAP_IGNORE( server->SettingsManager()->CheckSspDebugModeL( EFalse ) );
+    server->RemoveTimer( ESspDebugModeTimer );
+    if( server->KeyWatcher()->GetSspDebugModeKeyValue() )
+        {
+        // Set our internal debug mode key to off. Ignore error, not critical here.
+        (void) RProperty::Set( KPSUidBluetoothTestingMode, KBTSspDebugmode, EFalse );
+        }
+    TRAP_IGNORE( server->SettingsManager()->CheckSspDebugModeL( EFalse ) );    
+    TRACE_FUNC_EXIT
     return KErrNone;
     }
 
--- a/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -529,3 +529,16 @@
         }
     CleanupStack::PopAndDestroy( cenRep );
     }
+
+// ---------------------------------------------------------------------------
+// Gets the current value of ssp mode key. Return ETrue if BT is in SSP debug mode
+// ---------------------------------------------------------------------------
+//
+TBool CBTEngSrvKeyWatcher::GetSspDebugModeKeyValue()
+    {
+    TInt val;
+    // Getter failure is handled as Debug mode off
+    TInt err = iSspDebugModeKey.Get( val );
+    TRACE_INFO( ( _L( "CBTEngSrvKeyWatcher::GetSspDebugModeKeyValue err %d val %d" ), err, val) )
+    return ( !err && val );
+    }
--- a/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -81,9 +81,12 @@
 //
 CBTEngSrvPluginMgr::~CBTEngSrvPluginMgr()
     {
+    TRACE_FUNC_ENTRY
     iPluginInfoArray.Close();
     iPluginArray.ResetAndDestroy();
+    iUuidContainter.Close();
     REComSession::FinalClose();
+    TRACE_FUNC_EXIT
     }
 
 
--- a/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -471,7 +471,7 @@
                                    (TInt) aDebugMode );
             SetPowerStateL( EBTOff, EFalse );
             }
-        else
+        else if( !( iServer->IsTimerQueued( CBTEngServer::ESspDebugModeTimer ) ) )
             {
             // There are still existing connections, queue the
             // timer again for half the period.
--- a/bluetoothengine/btsap/inc/BTSapMessage.h	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btsap/inc/BTSapMessage.h	Wed Sep 29 13:09:05 2010 +0300
@@ -103,7 +103,8 @@
     EConnectionOK,
     EConnectionErrReject,
     EConnectionErrNotSupported,
-    EConnectionErrTooSmall
+    EConnectionErrTooSmall,
+    EConnectionOKOngoingCall
     };
     
 enum TValidationResult
--- a/bluetoothengine/btsap/inc/BTSapServerState.h	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btsap/inc/BTSapServerState.h	Wed Sep 29 13:09:05 2010 +0300
@@ -53,7 +53,9 @@
     {
     EConnectionError,
     EUserAccepted,
-    EUserRejected
+    EUserRejected,
+    EConnectionWithActiveCall,
+    EConnectionWithoutActiveCall
     };
 
 enum TSapConnectionState
@@ -70,6 +72,7 @@
 class RTelServer;
 class RMobilePhone;
 class MSapStatusObserver;
+class MSapCallStatusObserver;
 
 /*
 * An abstarct interface that defines a callback method
@@ -128,12 +131,68 @@
     RProperty iProperty;
     };
 
+/*
+* An abstarct interface that defines a callback method
+* for the Call state observer. CallStatusChangedL
+* is called by CBTCallStatusObserver when the call connection
+* state has changed. aStatus represents the new status value.
+*/
+class MSapCallStatusObserver
+    {
+    public:
+    virtual void CallStatusChangedL(TInt aStatus) = 0;
+    };
+
+/*
+* An observer that monitors KPSUidCtsyCallInformation
+* P&S key . The clients can call SubscribeCallStatusL in order to 
+* get a changed call status returned via 
+* MSapCallStatusObserver::CallStatusChangedL.
+*/ 
+class CBTSapCallStatusObserver : public CActive
+    {
+public:
+    /**
+    * Two-phased constructor.
+    */
+    static CBTSapCallStatusObserver* NewL();
+    /**
+    * Destructor.
+    */
+    virtual ~CBTSapCallStatusObserver();
+    
+    /**
+    * Starts listening KCTsyCallState P&S key.
+    * When the key value is changed, the new state is indicated
+    * through the observer interface (MSapCallStatusObserver).
+    */
+    void SubscribeCallStatusL(MSapCallStatusObserver* aObserver);
+      
+private:
+    /**
+    * Two-Phase constructor
+    */
+    void ConstructL();
+    
+    /**
+    * Default constructor
+    */
+    CBTSapCallStatusObserver();
+    
+    // From CActive
+    virtual void DoCancel();
+    virtual void RunL();
+      
+private:
+    MSapCallStatusObserver* iObserver;
+    RProperty iProperty;
+    };
 
 /**
 *  CBTSapServerState core class
 *
 */
-class CBTSapServerState : public CActive, MSapStatusObserver
+class CBTSapServerState : public CActive, MSapStatusObserver, MSapCallStatusObserver
     {
 private:
     class TState
@@ -149,6 +208,7 @@
         virtual TInt RejectSapConnection(TBTSapRejectReason aReason);
         virtual void SimCardStatusChanged(TCardStatus aCardStatus);
         virtual TInt ChangeState(TBTSapServerState& aNextState);
+        virtual TInt CallInactive();
 
         void NotifySapState(TSapConnectionState aState);
         void StartBTNotifier(TInt type);
@@ -206,6 +266,7 @@
         TInt RejectSapConnection(TBTSapRejectReason aReason);
         TInt ChangeState(TBTSapServerState& aNextState);
         void SimCardStatusChanged(TCardStatus aCardStatus);
+        TInt CallInactive();
 
     private:
         void CheckMaxMsgSize(TConnectionStatus& aMsgSizeStatus);
@@ -214,6 +275,8 @@
     private:
         TBool iConnectRequestOK;
         TCardStatus iCardStatus;
+        TBool iSendRespMessageDone;
+        TBool iMessageSizeNegotiationDone;
         RProperty iProperty;
         };
 
@@ -367,9 +430,15 @@
 
     TBTSapMessage& BTSapResponseMessage();
 
+    void SubscribeCallStatusL();
+    
+    void CancelSubscribeCallStatusL();
+    
     // From MSapStatusObserver
     void SapStatusChangedL(TInt aStatus);
-
+   
+    // From MSapCallStatusObserver
+    void CallStatusChangedL(TInt aStatus);
 private:
 
     void OpenSubscriptionModuleL();
@@ -420,6 +489,7 @@
     TBTSapMessage iResponseMessage;
     TBTSapMessage iRequestMessage;
     CBTSapStatusObserver* iStatusObserver;
+    CBTSapCallStatusObserver* iBTCallStatusObserver;
     TBool iStatesCreated;
     };
 
--- a/bluetoothengine/btsap/src/BTSapServerState.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btsap/src/BTSapServerState.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -20,6 +20,8 @@
 
 // INCLUDE FILES
 #include <e32property.h>
+#include <ctsydomainpskeys.h>
+#include <PSVariables.h>
 #include "BTSapDomainPSKeys.h"
 
 #include "BTSapServerState.h"
@@ -78,7 +80,7 @@
     }
     
 // ---------------------------------------------------------
-// CBTSapStatusObserver::StartObservingL()
+// CBTSapStatusObserver::SubscribeSapStatusL()
 //----------------------------------------------------------
 //
 void CBTSapStatusObserver::SubscribeSapStatusL(MSapStatusObserver* aObserver)
@@ -130,6 +132,102 @@
     }
 
 // ---------------------------------------------------------
+// CBTSapCallStatusObserver::CBTSapCallStatusObserver()
+//----------------------------------------------------------
+//
+CBTSapCallStatusObserver::CBTSapCallStatusObserver(): CActive(CActive::EPriorityStandard)
+    {                                
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::NewL()
+//----------------------------------------------------------
+// 
+CBTSapCallStatusObserver* CBTSapCallStatusObserver::NewL() 
+    {
+    CBTSapCallStatusObserver* self = new(ELeave) CBTSapCallStatusObserver();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+ 
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::ConstructL()
+//----------------------------------------------------------
+//   
+void CBTSapCallStatusObserver::ConstructL()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapCallStatusObserver::ConstructL")));
+    User::LeaveIfError(iProperty.Attach( KPSUidCtsyCallInformation, 
+            KCTsyCallState));
+    }
+
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::~CBTSapCallStatusObserver
+//----------------------------------------------------------
+//
+CBTSapCallStatusObserver::~CBTSapCallStatusObserver()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+    
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::SubscribeCallStatusL()
+//----------------------------------------------------------
+//
+void CBTSapCallStatusObserver::SubscribeCallStatusL(MSapCallStatusObserver* aObserver)
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapCallStatusObserver::SubscribeCallStatusL")));
+    
+    ASSERT(aObserver);
+    
+    iObserver = aObserver;
+    
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapCallStatusObserver::SubscribeCallStatusL() Exit")));
+    }
+    
+
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::DoCancel()
+// ---------------------------------------------------------
+//
+void CBTSapCallStatusObserver::DoCancel()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapCallStatusObserver::DoCancel")));
+    
+    iProperty.Cancel();
+    }
+
+// ---------------------------------------------------------
+// CBTSapCallStatusObserver::RunL()
+// ---------------------------------------------------------
+//
+void CBTSapCallStatusObserver::RunL()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapCallStatusObserver::RunL")));
+    
+    TInt btSapState;
+    TInt err = iStatus.Int();
+    
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    
+    if (!err)
+        {
+        err = iProperty.Get(btSapState);
+        if (!err)
+            {
+            iObserver->CallStatusChangedL(btSapState);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
 // CBTSapServerState::CBTSapServerState()
 // ---------------------------------------------------------
 //
@@ -169,6 +267,7 @@
     delete iSimCardStatusNotifier;
     delete iRequestHandler;
     delete iStatusObserver;
+    delete iBTCallStatusObserver;
 
     iSubscriptionModule.Close();
     iPhone.Close();
@@ -206,6 +305,7 @@
     iSocketHandler = CBTSapSocketHandler::NewL(*this, *iRequestHandler);
     iSimCardStatusNotifier = CBTSapSimCardStatusNotifier::NewL(*this);
     iStatusObserver = CBTSapStatusObserver::NewL();
+    iBTCallStatusObserver = CBTSapCallStatusObserver::NewL();
     
 	TState* state = new (ELeave) TStateInit(*this);
 	CleanupStack::PushL(state);
@@ -216,6 +316,46 @@
     }
 
 // ---------------------------------------------------------
+// CBTSapServerState::SubscribeCallStatusL()
+// ---------------------------------------------------------
+//
+void CBTSapServerState::SubscribeCallStatusL()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapServerState::SubscribeCallStatusL")));
+    if (!iBTCallStatusObserver->IsActive())
+        {
+        iBTCallStatusObserver->SubscribeCallStatusL(this);
+        }
+    }
+
+// ---------------------------------------------------------
+// CBTSapServerState::CancelSubscribeCallStatusL()
+// ---------------------------------------------------------
+//
+void CBTSapServerState::CancelSubscribeCallStatusL()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapServerState::CancelSubscribeCallStatusL")));
+    iBTCallStatusObserver->Cancel();
+    }
+
+// ---------------------------------------------------------
+// CBTSapServerState::CallStatusChangedL()
+// ---------------------------------------------------------
+//
+void CBTSapServerState::CallStatusChangedL(TInt aStatus)
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_INFO, BTSapPrintTrace(_L("[BTSap]  TStateConnect: callState: %d"), aStatus));
+
+    // If callState is EPSTelephonyCallStateNone or EPSTelephonyCallStateUninitialized, there's no ongoing call
+    TBool retVal = (aStatus != EPSCTsyCallStateNone) && (aStatus != EPSCTsyCallStateUninitialized);
+    if (retVal)
+        {
+        BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  CBTSapServerState::CallStatusChangedL() call ended")));
+        iStateArray[iCurrentState]->CallInactive();
+        }
+    }
+
+// ---------------------------------------------------------
 // CBTSapServerState::StartL()
 // ---------------------------------------------------------
 //
--- a/bluetoothengine/btsap/src/BTSapState.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btsap/src/BTSapState.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -54,6 +54,12 @@
     return KErrNotReady;
     }
 
+TInt CBTSapServerState::TState::CallInactive()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_ERROR, BTSapPrintTrace(_L("[BTSap]  TState: CallInactive: Not Ready#")));
+    return KErrNotReady;
+    }
+
 void CBTSapServerState::TState::SimCardStatusChanged(TCardStatus /*aCardStatus*/)
     {
     BTSAP_TRACE_OPT(KBTSAP_TRACE_ERROR, BTSapPrintTrace(_L("[BTSap]  TState: SimCardStatusChanged: Not Ready#")));
--- a/bluetoothengine/btsap/src/BTSapStateConnect.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btsap/src/BTSapStateConnect.cpp	Wed Sep 29 13:09:05 2010 +0300
@@ -30,7 +30,7 @@
 
 
 CBTSapServerState::TStateConnect::TStateConnect(CBTSapServerState& aServerState)
-    : TStateIdle(aServerState), iConnectRequestOK(EFalse), iCardStatus(ECardStatusReserved)
+    : TStateIdle(aServerState), iConnectRequestOK(EFalse), iCardStatus(ECardStatusReserved), iSendRespMessageDone(EFalse), iMessageSizeNegotiationDone(EFalse) 
     {
     }
 
@@ -43,15 +43,27 @@
 
     iStatus = &aStatus;
     TConnectionStatus connectionStatus = EConnectionErrReject;
-    if(!IsCallOngoing())
-        {   // SAP cannot be accepted if a call is ongoing or if no SIM is present
-        connectionStatus = EConnectionOK;
-        }
-
-    if (connectionStatus == EConnectionOK)
+    if (!iMessageSizeNegotiationDone)
         {
         CheckMaxMsgSize(connectionStatus);
         }
+    
+    if (connectionStatus == EConnectionOK || iMessageSizeNegotiationDone)
+        {
+        iMessageSizeNegotiationDone = ETrue;
+        if(IsCallOngoing())
+            {   // SAP cannot be accepted if a call is ongoing or if no SIM is present
+            connectionStatus = EConnectionOKOngoingCall;
+            }
+        else
+            {
+            connectionStatus = EConnectionOK;
+            }
+        }
+    else
+        {
+        iMessageSizeNegotiationDone = EFalse;
+        }
 
     if (connectionStatus == EConnectionOK)
         {
@@ -84,10 +96,23 @@
 #endif //__WINS__
 
         }
+    else if (connectionStatus == EConnectionOKOngoingCall) 
+        {
+        iConnectRequestOK = EFalse;
+        aStatus = KRequestPending; 
+        if (iSendRespMessageDone)
+            {
+            //start subscribe to CallStatusChange
+            iServerState.SubscribeCallStatusL();
+            }
+        else
+            {
+            User::RequestComplete(iStatus, EConnectionWithActiveCall);
+            }
+        }    
     else
         {
         iConnectRequestOK = EFalse;
-
         iResponseMessage.SetMsgID(EConnectResponse);
         iResponseMessage.AddParameter(EParaConnectionStatus, connectionStatus);
 
@@ -121,8 +146,25 @@
     BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap]  SM: TStateConnect: Complete")));
 
     TBTSapServerState nextState = EStateNotConnected;
-
-    if (aReason == EUserAccepted || aReason == EUserRejected)
+    if (aReason == EConnectionWithActiveCall)
+        {
+        if (!iSendRespMessageDone)
+            {
+            TInt connectionStatus = EConnectionOKOngoingCall;
+            iResponseMessage.SetMsgID(EConnectResponse);
+            iResponseMessage.AddParameter(EParaConnectionStatus, connectionStatus);
+            iServerState.BTSapSocketHandler().Send(iResponseMessage.Data());
+            iSendRespMessageDone = ETrue;
+            }
+        //wait in TStateConnect state, until call is released
+        nextState = EStateConnect;
+        }   
+    else if (aReason == EConnectionWithoutActiveCall)
+        {
+        //Enter TStateConnect state one last time, make a SAP connection
+        nextState = EStateConnect;
+        }   
+    else if (aReason == EUserAccepted || aReason == EUserRejected)
         {
         TInt connectionStatus = (aReason == EUserAccepted) ? EConnectionOK : EConnectionErrReject;
 
@@ -147,6 +189,8 @@
                 NotifySapState(ESapConnected);
                 }
             nextState = EStateIdle;
+            iSendRespMessageDone = EFalse;
+            iMessageSizeNegotiationDone = EFalse;
             }
         }
 
@@ -156,6 +200,9 @@
 void CBTSapServerState::TStateConnect::Cancel()
     {
     NotifySapState(ESapNotConnected);
+    iSendRespMessageDone = EFalse;
+    iMessageSizeNegotiationDone = EFalse;
+    iServerState.CancelSubscribeCallStatusL();
     User::RequestComplete(iStatus, KErrCancel);
     }
 
@@ -182,7 +229,12 @@
         BTSAP_TRACE_OPT(KBTSAP_TRACE_INFO, BTSapPrintTrace(_L("[BTSap]  TStateConnect: callState: %d"), callState));
 
         // If callState is EPSTelephonyCallStateNone or EPSTelephonyCallStateUninitialized, there's no ongoing call
-        retVal = (callState != EPSCTsyCallStateNone) && (callState != EPSCTsyCallStateUninitialized);
+        // should EPSCTsyCallStateDisconnecting be treated as non active call status ???
+        // added it here for testing with SAP 1.0 supported carkit. Since there is delay for call status changes from EPSCTsyCallStateDisconnecting
+        // to EPSCTsyCallStateNone or EPSCTsyCallStateUninitialized. If we do not treat EPSCTsyCallStateDisconnecting as 
+        // Call Inactive status, SAP connection will be dropped and client connects to HFP profile instead. 
+        // could be removed and try if it works with SAP 1.1 clients.
+        retVal = (callState != EPSCTsyCallStateNone) && (callState != EPSCTsyCallStateUninitialized) && (callState != EPSCTsyCallStateDisconnecting);
         }
     else
         {
@@ -264,4 +316,15 @@
     iCardStatus = aCardStatus;
     }
 
+TInt CBTSapServerState::TStateConnect::CallInactive()
+    {
+    BTSAP_TRACE_OPT(KBTSAP_TRACE_FUNCTIONS, BTSapPrintTrace(_L("[BTSap]  SM: TStateConnect: CallInactive")));
+
+    if (*iStatus == KRequestPending)
+        {
+        User::RequestComplete(iStatus, EConnectionWithoutActiveCall);
+        }
+    return KErrNone;
+    }
+
 //  End of File  
--- a/bluetoothengine/btxqservice/btxqservice.pro	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/btxqservice/btxqservice.pro	Wed Sep 29 13:09:05 2010 +0300
@@ -36,7 +36,8 @@
 SERVICE.OPTIONS = embeddable \
     hidden
     
-libFiles.path = "!:\sys\bin"
+libFiles.path = "!:/sys/bin"
+
 DEPLOYMENT += libFiles
 
 HEADERS += inc/btxqaddrservice.h \
@@ -56,7 +57,6 @@
 
 BLD_INF_RULES.prj_exports += \
   "$${LITERAL_HASH}include <platform_paths.hrh>" \
-  "inc/btxqserviceapi.h  MW_LAYER_PLATFORM_EXPORT_PATH(btxqserviceapi.h)" \
   "rom/btxqservice.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(btxqservice.iby)"
   
   
\ No newline at end of file
--- a/bluetoothengine/btxqservice/inc/btxqserviceapi.h	Fri Sep 03 16:17:59 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Bluetooth-services APIs through Qt Service Framework
- *
- */
-
-#ifndef BTXQSERVICEAPI_H
-#define BTXQSERVICEAPI_H
-
-#include <qstring.h>
-
-/*!
- todo: this API may need to move to plat_ API folder of its destination package.
- */
-
-/*!
- The Bluetooth service name.
- */
-static const QString BluetoothServiceName("btxqservice");
-
-/*!
- The interface of showing the local Bluetooth device address in a dialog
- */
-static const QString BluetoothInterfaceShowLocalAddress("com.nokia.symbian.IShowLocalDeviceAddress");
-
-/*!
- The operation used for showing the local Bluetooth device address in a dialog
- */
-static const QString BluetoothShowLocalAddress("showBTAddr()");
-
-/*!
- The full service name of showing the local Bluetooth device address in a dialog
- */
-static const QString BluetoothServiceShowLocalAddress = 
-        BluetoothServiceName + "." + BluetoothInterfaceShowLocalAddress;
-
-/*!
- The interface of toggling Bluetooth power
- */
-static const QString BluetoothInterfaceTogglePower("com.nokia.symbian.ITogglePower");
-
-/*!
- The operation used for toggling the Bluetooth power
- */
-static const QString BluetoothTogglePower("togglePower()");
-
-/*!
- The full service name of toggling Bluetooth power
- */
-static const QString BluetoothServiceTogglePower = 
-        BluetoothServiceName + "." + BluetoothInterfaceTogglePower;
-
-/*!
- The interface of activating Bluetooth device test mode (DUT mode)
- */
-static const QString BluetoothInterfaceActivateDutMode("com.nokia.symbian.IActivateDutMode");
-
-/*!
- The operation used for activating the Bluetooth device test mode (DUT mode) 
- */
-static const QString ActivateDutMode("activateDeviceTestMode()");
-
-/*!
- The full service name of activating Bluetooth device test mode (DUT mode)
- */
-static const QString BluetoothServiceActivateDutMode = 
-        BluetoothServiceName + "." + BluetoothInterfaceActivateDutMode;
-
-/*!
- The interface of toggling Bluetooth SSP debug mode
- */
-static const QString BluetoothInterfaceToggleSspDebugMode("com.nokia.symbian.IToggleSspDebugMode");
-
-/*!
- The operation used for toggling the Bluetooth SSP debug mode 
- */
-static const QString ToggleSspDebugMode("toggleSspDebugMode()");
-
-/*!
- The full service name of toggling Bluetooth SSP debug mode
- */
-static const QString BluetoothServiceToggleSspDebugMode = 
-        BluetoothServiceName + "." + BluetoothInterfaceToggleSspDebugMode;
-
-#endif // BTXQSERVICEAPI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_xqservice_api/bt_xqservice_api.metaxml	Wed Sep 29 13:09:05 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="3c53dacd18832420468296bf6e888937" dataversion="2.0">
+  <name>bt_xqservice_api</name>
+  <description>The API for using Bluetooth Qt-Highway services.</description>
+  <type>c++</type>
+  <collection>bluetoothengine</collection>
+  <libs/>
+  <release category="platform" sinceversion="5.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_xqservice_api/bt_xqservice_api.pri	Wed Sep 29 13:09:05 2010 +0300
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description:
+#
+#
+
+symbian*: {
+    # Build.inf rules
+            BLD_INF_RULES.prj_exports += \
+          "$${LITERAL_HASH}include<platform_paths.hrh>" \
+          "bt_xqservice_api/inc/btxqserviceapi.h MW_LAYER_PLATFORM_EXPORT_PATH(btxqserviceapi.h)" 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_xqservice_api/inc/btxqserviceapi.h	Wed Sep 29 13:09:05 2010 +0300
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Bluetooth-services APIs through Qt Service Framework
+ *
+ */
+
+#ifndef BTXQSERVICEAPI_H
+#define BTXQSERVICEAPI_H
+
+#include <qstring.h>
+
+/*!
+ todo: this API may need to move to plat_ API folder of its destination package.
+ */
+
+/*!
+ The Bluetooth service name.
+ */
+static const QString BluetoothServiceName("btxqservice");
+
+/*!
+ The interface of showing the local Bluetooth device address in a dialog
+ */
+static const QString BluetoothInterfaceShowLocalAddress("com.nokia.symbian.IShowLocalDeviceAddress");
+
+/*!
+ The operation used for showing the local Bluetooth device address in a dialog
+ */
+static const QString BluetoothShowLocalAddress("showBTAddr()");
+
+/*!
+ The full service name of showing the local Bluetooth device address in a dialog
+ */
+static const QString BluetoothServiceShowLocalAddress = 
+        BluetoothServiceName + "." + BluetoothInterfaceShowLocalAddress;
+
+/*!
+ The interface of toggling Bluetooth power
+ */
+static const QString BluetoothInterfaceTogglePower("com.nokia.symbian.ITogglePower");
+
+/*!
+ The operation used for toggling the Bluetooth power
+ */
+static const QString BluetoothTogglePower("togglePower()");
+
+/*!
+ The full service name of toggling Bluetooth power
+ */
+static const QString BluetoothServiceTogglePower = 
+        BluetoothServiceName + "." + BluetoothInterfaceTogglePower;
+
+/*!
+ The interface of activating Bluetooth device test mode (DUT mode)
+ */
+static const QString BluetoothInterfaceActivateDutMode("com.nokia.symbian.IActivateDutMode");
+
+/*!
+ The operation used for activating the Bluetooth device test mode (DUT mode) 
+ */
+static const QString BluetoothActivateDutMode("activateDeviceTestMode()");
+
+/*!
+ The operation used for activating the Bluetooth device test mode (DUT mode) 
+ 
+ This API is deprecated and should be removed when the client has migrated to new API.
+ */
+static const QString ActivateDutMode("activateDeviceTestMode()");
+
+/*!
+ The full service name of activating Bluetooth device test mode (DUT mode)
+ */
+static const QString BluetoothServiceActivateDutMode = 
+        BluetoothServiceName + "." + BluetoothInterfaceActivateDutMode;
+
+/*!
+ The interface of toggling Bluetooth SSP debug mode
+ */
+static const QString BluetoothInterfaceToggleSspDebugMode("com.nokia.symbian.IToggleSspDebugMode");
+
+/*!
+ The operation used for toggling the Bluetooth SSP debug mode 
+ */
+static const QString BluetoothToggleSspDebugMode("toggleSspDebugMode()");
+
+/*!
+ The operation used for toggling the Bluetooth SSP debug mode.
+  
+ This API is deprecated and should be removed when the client has migrated to new API.
+ */
+static const QString ToggleSspDebugMode("toggleSspDebugMode()");
+
+/*!
+ The full service name of toggling Bluetooth SSP debug mode
+ */
+static const QString BluetoothServiceToggleSspDebugMode = 
+        BluetoothServiceName + "." + BluetoothInterfaceToggleSspDebugMode;
+
+#endif // BTXQSERVICEAPI_H
--- a/btservices_plat/btservices_plat.pro	Fri Sep 03 16:17:59 2010 +0300
+++ b/btservices_plat/btservices_plat.pro	Wed Sep 29 13:09:05 2010 +0300
@@ -19,4 +19,5 @@
 
 symbian*: { 
     include(bt_remote_device_setting_api/bt_remote_device_setting_api.pri)
+    include(bt_xqservice_api/bt_xqservice_api.pri)
 }