This patch mainly covers:
1) Implement register/unregister client, connect/disconnect methods in BluetoothGatt object.
2) Add/Modify related webidls for 1).
3) Implement result handlers, notifications in BluetoothGattManager.
This patch adds proper selection of the Bluetooth backend. The backend
is configurable via environment property 'ro.moz.bluetooth.backend'. The
default value is still Bluedroid.
On systems that are not Android 4.2 or later, the code does not return
a backend. These systems should use BlueZ instead.
This patch is based on bug 1065336, patch [01] and bug 1124565,
patch [01]. It also contains an extra fix in 'moz.build' to set
the pre-processor constant 'MOZ_B2G_BT_DAEMON'.
This patch adds support for a random postfix for bluetoothd's socket
name. The postfix is re-generated for every instance of the daemon.
This prevents name collisions between mutliple sessions and malicious
programs from taking over the connection easily.
This patch is based on bug 1119746, patch [05].
Currently, Gecko connects to a running instance of bluetoothd when
it starts the daemon backend. This contains a race condition between
the startup of the daemon and the startup of Gecko.
This patch changes the initialization and cleanup of Bluetooth's
daemon backend so that the Bluetooth daemon connects to Gecko. The
daemon process is now started as part of the initialization and
quits during shutdown. The steps are strictly ordered, so no race
condition exists.
The initialization and cleanup procedures should now be compatible
with BlueZ 5.
This patch is based on bug 1119746, patch [04].
The class |BluetoothDaemonChannel| for the bluetoothd channels
supports reference counting. This patch fixes the respective
variable to use |nsRefPtr| instead of |nsAutoPtr|.
This patch is based on bug 1119746, patch [03]
As for Handsfree helpers, A2DP and AVRCP helpers might create naming
conflicts with other classes. Moving them into |BluetoothA2dpManager|'s
namespace resolves this problem.
There are several equal-named, but different, classes in the Bluetooth
namespace. The linker will pick only one of them, which leads to crashes
in the compiled program.
BluetoothOppManager.IsConnected() couldn't represent the connection status
of Opp profile since it only return true if there is an ongoing
file-transfer session.
This function was used to named |IsTransferring()| in Bug 827267, however,
it was renamed to |IsConnected()| when Bug 842948 landed.
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.