mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
Bug 1168446: Remove |Disconnect| from BlueZ's |BluetoothSocket|, r=shuang
The method |BluetoothSocket::Disconnect| is just a wrapper around |Close|. This patch replaces all invocations of |Disconnect| with |Close| and removes the method.
This commit is contained in:
parent
c67b1940c9
commit
8cfafc9225
@ -1150,12 +1150,12 @@ BluetoothHfpManager::Connect(const nsAString& aDeviceAddress,
|
||||
|
||||
// Stop listening because currently we only support one connection at a time.
|
||||
if (mHandsfreeSocket) {
|
||||
mHandsfreeSocket->Disconnect();
|
||||
mHandsfreeSocket->Close();
|
||||
mHandsfreeSocket = nullptr;
|
||||
}
|
||||
|
||||
if (mHeadsetSocket) {
|
||||
mHeadsetSocket->Disconnect();
|
||||
mHeadsetSocket->Close();
|
||||
mHeadsetSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -1202,7 +1202,7 @@ BluetoothHfpManager::Listen()
|
||||
kHeadsetAG,
|
||||
BluetoothReservedChannels::CHANNEL_HEADSET_AG)) {
|
||||
BT_WARNING("[HSP] Can't listen on RFCOMM socket!");
|
||||
mHandsfreeSocket->Disconnect();
|
||||
mHandsfreeSocket->Close();
|
||||
mHandsfreeSocket = nullptr;
|
||||
mHeadsetSocket = nullptr;
|
||||
return false;
|
||||
@ -1227,7 +1227,7 @@ BluetoothHfpManager::Disconnect(BluetoothProfileController* aController)
|
||||
MOZ_ASSERT(!mController);
|
||||
|
||||
mController = aController;
|
||||
mSocket->Disconnect();
|
||||
mSocket->Close();
|
||||
}
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
@ -1796,14 +1796,14 @@ BluetoothHfpManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
|
||||
mIsHsp = false;
|
||||
mHandsfreeSocket.swap(mSocket);
|
||||
|
||||
mHeadsetSocket->Disconnect();
|
||||
mHeadsetSocket->Close();
|
||||
mHeadsetSocket = nullptr;
|
||||
} else if (aSocket == mHeadsetSocket) {
|
||||
MOZ_ASSERT(!mSocket);
|
||||
mIsHsp = true;
|
||||
mHeadsetSocket.swap(mSocket);
|
||||
|
||||
mHandsfreeSocket->Disconnect();
|
||||
mHandsfreeSocket->Close();
|
||||
mHandsfreeSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -1990,7 +1990,7 @@ BluetoothHfpManager::ConnectSco(BluetoothReplyRunnable* aRunnable)
|
||||
}
|
||||
|
||||
// Stop listening
|
||||
mScoSocket->Disconnect();
|
||||
mScoSocket->Close();
|
||||
|
||||
mScoSocket->Connect(mDeviceAddress, kUnknownService, -1);
|
||||
mScoSocketStatus = mScoSocket->GetConnectionStatus();
|
||||
@ -2007,7 +2007,7 @@ BluetoothHfpManager::DisconnectSco()
|
||||
return false;
|
||||
}
|
||||
|
||||
mScoSocket->Disconnect();
|
||||
mScoSocket->Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2027,7 +2027,7 @@ BluetoothHfpManager::ListenSco()
|
||||
return false;
|
||||
}
|
||||
|
||||
mScoSocket->Disconnect();
|
||||
mScoSocket->Close();
|
||||
|
||||
if (!mScoSocket->Listen(NS_LITERAL_STRING("Handsfree Audio Gateway SCO"),
|
||||
kUnknownService, -1)) {
|
||||
|
@ -185,7 +185,7 @@ public:
|
||||
|
||||
if (mSocket->GetConnectionStatus() ==
|
||||
SocketConnectionStatus::SOCKET_CONNECTED) {
|
||||
mSocket->Disconnect();
|
||||
mSocket->Close();
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,12 +269,12 @@ BluetoothOppManager::ConnectInternal(const nsAString& aDeviceAddress)
|
||||
|
||||
// Stop listening because currently we only support one connection at a time.
|
||||
if (mRfcommSocket) {
|
||||
mRfcommSocket->Disconnect();
|
||||
mRfcommSocket->Close();
|
||||
mRfcommSocket = nullptr;
|
||||
}
|
||||
|
||||
if (mL2capSocket) {
|
||||
mL2capSocket->Disconnect();
|
||||
mL2capSocket->Close();
|
||||
mL2capSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ BluetoothOppManager::Listen()
|
||||
kObexObjectPush,
|
||||
BluetoothReservedChannels::CHANNEL_OPUSH_L2CAP)) {
|
||||
BT_WARNING("[OPP] Can't listen on L2CAP socket!");
|
||||
mRfcommSocket->Disconnect();
|
||||
mRfcommSocket->Close();
|
||||
mRfcommSocket = nullptr;
|
||||
mL2capSocket = nullptr;
|
||||
return false;
|
||||
@ -1533,13 +1533,13 @@ BluetoothOppManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
|
||||
MOZ_ASSERT(!mSocket);
|
||||
mRfcommSocket.swap(mSocket);
|
||||
|
||||
mL2capSocket->Disconnect();
|
||||
mL2capSocket->Close();
|
||||
mL2capSocket = nullptr;
|
||||
} else if (aSocket == mL2capSocket) {
|
||||
MOZ_ASSERT(!mSocket);
|
||||
mL2capSocket.swap(mSocket);
|
||||
|
||||
mRfcommSocket->Disconnect();
|
||||
mRfcommSocket->Close();
|
||||
mRfcommSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -1618,7 +1618,7 @@ void
|
||||
BluetoothOppManager::Disconnect(BluetoothProfileController* aController)
|
||||
{
|
||||
if (mSocket) {
|
||||
mSocket->Disconnect();
|
||||
mSocket->Close();
|
||||
} else {
|
||||
BT_WARNING("%s: No ongoing file transfer to stop", __FUNCTION__);
|
||||
}
|
||||
|
@ -36,10 +36,6 @@ public:
|
||||
bool Listen(const nsAString& aServiceName,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel);
|
||||
inline void Disconnect()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
inline void GetAddress(nsAString& aDeviceAddress)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user