This patch merges BluetoothUtils.{cpp,h} from BlueZ and Bluedroid
backends. The resulting files of the same name are located in the
generic code's directory.
This change requires a rebuild of dependency information, so the
patch touches CLOBBER as well.
--HG--
rename : dom/bluetooth/bluedroid/BluetoothUtils.cpp => dom/bluetooth/BluetoothUtils.cpp
rename : dom/bluetooth/bluedroid/BluetoothUtils.h => dom/bluetooth/BluetoothUtils.h
This patch replaces |ToggleBtAck| with |AcknowledgeToggleBt| in
|BluetoothServiceBluedroid::AdapterStateChangedNotification| and
cleans up the remaining runnables used by this method.
All runnables need to be handled in the same patch, because the
order of operation must not be changed.
|AcknowledgeToggleBt| completes a Bluetooth start or stop operation
in the context of |BluetoothService|; That was done by |ToggleBtAck|
before.
This patch replaces |ToggleBtAck| with calls to |AcknowledgeToggleBt|
in |BluetoothServiceBluedroid| for all the trivial cases.
|ToggleBtAck| completes a start of stop operation on the main thread.
This patch moves the runnable's functionality into |BluetoothService|
and makes it available for methods running on the main thread.
This patch converts all interface runnables in Bluetooth's daemon
backend by generic result runnables. Init operator classes replace
unpack functions. Init operator classes will warn about unused data
at the end of a PDU.
This patch converts all notification runnables in Bluetooth's daemon
backend to use the generic implementation. Unpack functions are replaced
by init operator classes. The init operator classes also validate the
complete unpacking of a PDU and warn about unused trailing data.
A backend notification runnable in Bluetooth is used to transfer
a notification from the I/O thread to the main thread; an interface
runnable transfers and executes a result handler. Both are currently
implemented by the Bluetooth backends.
This patch adds new runnables that are independend from any backend
code or data structures.
This patch adds support for the Bluetooth daemon's Core module. It
provides the basic Bluetooth functionality, such as searching and
pairing with devices, and accessing device properties.
This patch adds the core interfaces and the Setup module for
the Bluetooth Daemon. The Setup module implements commands
for enabling and disabling Bluetooth profiles in the daemon.
The cast-and-assign pattern for retrieving file descriptors is prone to
SIGBUS signals on platforms that don't support unaligned memory access.
This patch fixes the problem by copying the received data directly.
|SocketMessageWatcher| currently allocates a large amount of memory
for holding ancillary data. The only actually transfered value is a
file descriptor. This patch fixes the buffer size accordingly.
The data class in |SocketIOSendTask| is now a template parameter, instead
of being hard-coded to |UnixSocketRawData|. The patch also adds soem minor
cleanups to the file.
Bluetooth profile managers just return an error if a profile interface is
not available. Doing so breaks the initialization and cleanup routines. This
patch changes the profile managers to still report an error, but signal
progress to the given result runnable.
Bluetooth's RSSI property is encoded as pointer to a signed 8-bit
value. Gecko currently interprets this as pointer to a 32-bit
value; so the result of dereferencing the pointer is undefined.
This patch fixes the bug by interpreting the RSSI property correctly.
This patch moves BluetoothInterface.{cpp,h} to the generic section
of Gecko's Bluetooth code, and the Bluedroid implementation into
the new files BluetoothHalImplementation.{cpp,h}.
BluetoothHalImplementation.{cpp,h} contains all Bluedroid-specific
code. The classes in BluetoothInterface.{cpp,h} are now interfaces
for Gecko.
--HG--
rename : dom/bluetooth/bluedroid/BluetoothInterface.cpp => dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
This patch moves BluetoothInterface.{cpp,h} to the generic section
of Gecko's Bluetooth code, and the Bluedroid implementation into
the new files BluetoothHalImplementation.{cpp,h}.
BluetoothHalImplementation.{cpp,h} contains all Bluedroid-specific
code. The classes in BluetoothInterface.{cpp,h} are now interfaces
for Gecko.
--HG--
rename : dom/bluetooth/bluedroid/BluetoothInterface.cpp => dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
Calling read on a socket that has been closed for reading by the
peer, read returns 0. The socket is still readable however, so
polling and reading will return constant results of 0 received
bytes.
With this patch, if a socket's peer shuts down reading or if
we reached the EOF, we stop watching the file descriptor for
readability. |SocketIOBase| will detect this case exactly once
and initiate the socket's shutdown.
All interfaces for Bluetooth profiles are now always available, so we
don't have to check for specific versions of Bluedroid. Instead, we
try to call the methods, and check their results.
The methods of |BluetoothAVRCPInterface| are now always available. On
Android versions before 18, which don't support AVRCP, they always
fail with STATUS_UNSUPPORTED.
The C++ compiler for Flatfish lacks support for initialized arrays of
C-string pointers. This patch fixes the problem by using a switch
statement for the string conversion of A2DP connection states.
The patch removes unused callbacks and helper runnables from the
Bluedroid implementation of BluetoothA2DPManager. It also removes
the last Bluedroid-specific code from BluetoothUtils.{cpp,h}.
The helper runnables where necessary to perform certain operations on
the main thread after having received a callback from Bluedroid. The
new notification methods already run on the main thread, so the helper
runnables can be replaced by direct calls.
This patch adds Bluetooth A2DP and AVRCP notifications to Gecko's
A2DP manager. The code has been taken from taken from the callback
implementations, and adapted to run on the main thread. No further
cleanups have been applied.
This patch adds A2DP and AVRCP notifications and callbacks to
Gecko's Bluedroid interface. Support for AVRCP depends on the
version of the Android base system and is only available on
versions 18, 19 or later.