diff --git a/dom/bluetooth2/bluedroid/BluetoothSocket.cpp b/dom/bluetooth2/bluedroid/BluetoothSocket.cpp index 92546cf3c8a8..65bb4f371c5c 100644 --- a/dom/bluetooth2/bluedroid/BluetoothSocket.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothSocket.cpp @@ -815,6 +815,8 @@ BluetoothSocket::Connect(const nsAString& aDeviceAddress, int aChannel) MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_FALSE(mImpl, false); + SetConnectionStatus(SOCKET_CONNECTING); + mImpl = new DroidSocketImpl(XRE_GetIOMessageLoop(), this); // TODO: uuid as argument @@ -862,6 +864,8 @@ BluetoothSocket::Listen(int aChannel) MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_FALSE(mImpl, false); + SetConnectionStatus(SOCKET_LISTENING); + mImpl = new DroidSocketImpl(XRE_GetIOMessageLoop(), this); sBluetoothSocketInterface->Listen( diff --git a/dom/bluetooth2/bluedroid/BluetoothSocket.h b/dom/bluetooth2/bluedroid/BluetoothSocket.h index 0ca6818474be..775c40c18820 100644 --- a/dom/bluetooth2/bluedroid/BluetoothSocket.h +++ b/dom/bluetooth2/bluedroid/BluetoothSocket.h @@ -8,14 +8,14 @@ #define mozilla_dom_bluetooth_BluetoothSocket_h #include "BluetoothCommon.h" -#include "mozilla/ipc/UnixSocket.h" +#include "mozilla/ipc/SocketBase.h" BEGIN_BLUETOOTH_NAMESPACE class BluetoothSocketObserver; class DroidSocketImpl; -class BluetoothSocket : public mozilla::ipc::UnixSocketConsumer +class BluetoothSocket : public mozilla::ipc::SocketConsumerBase { public: BluetoothSocket(BluetoothSocketObserver* aObserver, @@ -51,6 +51,16 @@ public: void CloseDroidSocket(); bool SendDroidSocketData(mozilla::ipc::UnixSocketRawData* aData); + void CloseSocket() MOZ_OVERRIDE + { + CloseDroidSocket(); + } + + bool SendSocketData(mozilla::ipc::UnixSocketRawData* aMessage) MOZ_OVERRIDE + { + return SendDroidSocketData(aMessage); + } + private: BluetoothSocketObserver* mObserver; DroidSocketImpl* mImpl;