Bug 943753 - Fix the incorrect condition for synchronous connection to support HSP. r=echou

We don't need to check SLC status for HSP.
This commit is contained in:
Jamin Liu 2013-12-02 16:38:51 +08:00
parent aa9fa6a12b
commit 4b34aee468
2 changed files with 9 additions and 5 deletions

View File

@ -384,6 +384,7 @@ BluetoothHfpManager::Reset()
mCMER = false;
mConnectScoRequest = false;
mSlcConnected = false;
mHspConnected = false;
mReceiveVgsFlag = false;
#ifdef MOZ_B2G_RIL
@ -1617,6 +1618,7 @@ BluetoothHfpManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
mHeadsetSocket = nullptr;
} else if (aSocket == mHeadsetSocket) {
MOZ_ASSERT(!mSocket);
mHspConnected = true;
mHeadsetSocket.swap(mSocket);
mHandsfreeSocket->Disconnect();
@ -1802,9 +1804,9 @@ BluetoothHfpManager::ConnectSco(BluetoothReplyRunnable* aRunnable)
return false;
}
// Make sure Service Level Connection established before we start to
// set up SCO (synchronous connection).
if (!mSlcConnected) {
// If we are not using HSP, we have to make sure Service Level Connection
// established before we start to set up SCO (synchronous connection).
if (!mSlcConnected && !mHspConnected) {
mConnectScoRequest = true;
BT_WARNING("ConnectSco called before Service Level Connection established");
return false;

View File

@ -102,8 +102,9 @@ public:
* This function set up a Synchronous Connection (SCO) link for HFP.
* Service Level Connection (SLC) should be established before SCO setup
* process.
* If SLC haven't been established, this function will return false and send a
* request to set up SCO ater HfpManager receive AT+CMER.
* If SLC haven't been established, this function will return false and
* send a request to set up SCO ater HfpManager receive AT+CMER, unless we are
* connecting HSP socket rather than HFP socket.
*
* @param aRunnable Indicate a BluetoothReplyRunnable to execute this
* function. The default value is nullpter
@ -188,6 +189,7 @@ private:
bool mCMER;
bool mConnectScoRequest;
bool mSlcConnected;
bool mHspConnected;
#ifdef MOZ_B2G_RIL
bool mFirstCKPD;
int mNetworkSelectionMode;