This patch moves |BluetoothDaemonSocketConnector| into its own file,
renames it to |BluetoothDaemonConnector| and implements the new socket-
connector interface.
During restarts of the Bluetooth daemon, it can occur that Gecko tries
to send without having a connection to bluetoothd opened. This patch adds
a check to prevent this.
Bluedroid's A2DP manager is the same for Bluetooth v1 and v2, except
fixes for bug 1062697 and bug 1148311 in v1. This patch merges both
variants. The last remaining difference is a call to |DistributeSignal|,
which differs between both implementations.
The implementation of the Bluedroid HFP manager in Bluetoth v1 and v2
differs by a number of interface changes. This patch merges both variants
into a single one, were possible.
Bluedroid's OPP manager is the same for Bluetooth v1 and v2; except
for bug 1118177, which is fixed in v1. So with this patch, the v1
implementation is used for both variants.
During restarts of the Bluetooth daemon, it can occur that Gecko tries
to send without having a connection to bluetoothd opened. This patch adds
a check to prevent this.
This patch cleans up the inherited methods of Bluedroid's
|BluetooothSocket|. Methods of the same base class are grouped
within the file, and each method is labeled with 'override'.
With the current code, the Bluetooth result runnable is saved for
receiving before a command has been sent successfully. If sending
fails afterwards, the saved result runnable will still sit in the
result queue, and interfere with later, successful commands.
With this patch, the result runnable is saved only if the sending
was successful.
This patch removes the template parameters from
|SocketIORequestClosingRunnable| and moves its methods into
the C++ source file. All users have been adapted.
|ReceiveSocketData| receives socket data on the main thread. This
is a specific detail of the current socket classes, which should not
be required by future implementations.
This patch moves the receive method and the corresponding runnable
into socket classes.
This patch moves management of received socket I/O buffers from
|DataSocketIO| into the I/O classes. Each I/O class is responsible
for (de-)allocating buffers, and consuming them once data has been
received.
All current I/O classes forward their buffers to the main thread,
but other operations are possible. For example, received data can
be parsed and processed directly in the I/O thread.
This patch renames |SocketConsumerBase| to |DataSocket|, and for the
I/O classes |SocketConsumerIO| to |DataSocketIO|. |DataSocketIO| also
contains send and receive functionality from |SocketBaseIO|.
|DataSocket| is a virtual base class that represents a socket that
transfers data, without a particular constraints to what the data
represents. |DataSocketIO| is the corresponding helper class on the
I/O thread.