Commit Graph

87 Commits

Author SHA1 Message Date
Thomas Zimmermann
8139650d15 Bug 1048915: Integrate helper runnables into notification methods, r=shuang
Bluedroid callbacks were usually called on a separate thread that
was specific to this task. So Gecko's Bluetooth Core contained a
number of runnables for executing callback operations on the main
thread.

Since all notifications always run on the main thread, the extra
runnables are not required any longer. This patch integrates them
into the notification methods where possible.
2014-08-14 18:12:52 +02:00
Thomas Zimmermann
1e12e494c7 Bug 1048915: Use Bluetooth Core notifications, r=shuang
This patch connects backend and Gecko side of the notification
code. Gecko will now receive notifications instead of Bluedroid
callbacks.
2014-08-14 18:12:52 +02:00
Thomas Zimmermann
1bf25474df Bug 1048915: Implement Bluetooth Core notifications, r=shuang
This patch adds the Gecko-side of the Core notifications. The current
implementation of the notification methods has been copied from the
repsective Bluedroid callback methods, with only minor changes to adapt
them to Gecko data types.
2014-08-14 18:12:51 +02:00
Thomas Zimmermann
b0c0fbea91 Bug 1038591: Convert Bluedroid status codes and error handlers, r=shuang
This patch converts Bluedroid status codes in Gecko to the
backend-neutral data type |BluetoothStatus|. All error handlers
have been adapted. The Bluedroid type |bt_status_t| only remains
in |BluetoothInterface|.
2014-08-06 11:45:32 +02:00
Thomas Zimmermann
fc83fb066d Bug 1038591: Convert Bluetooth data types in |BluetoothInterface|, r=shuang
With this patch, |BluetoothInterface| is responsible for converting
all Bluetooth data types to Bluedroid types. All callers have been
adapted.
2014-08-06 11:44:47 +02:00
Thomas Zimmermann
b090a715f2 Bug 1046737: Use value to maintain Bluetooth bonding arrays, r=shuang
The Bluedroid code uses indices into global arrays while pairing
with devices. These arrays might get changed in between and the
indices become incorrect. The result is undefined.

The patch fixes the problem by using the value, a reply runnable,
directly for array lookups. No indices are required.

This bug was fixed in bluetooth2/ already, but not yet backported.
2014-08-01 10:26:20 +02:00
Thomas Zimmermann
a8403862c6 Bug 1029389: Asynchronous starting and stopping of profile managers, r=shuang
Profile managers use the new class |BluetoothProfileResultHandler|
to signal the result of initializing of cleaning up operations to
|BluetoothServiceBluedroid|. |BluetoothServiceBluedroid| proceeds
once all profile handlers have finished.

Future patches will build upon this patch to create completely
asynchronous profile managers.
2014-07-15 10:56:53 +02:00
Thomas Zimmermann
b7cf66bb18 Bug 1029386: Asynchronous authentification in Bluedroid, r=shuang 2014-07-03 09:53:32 +02:00
Thomas Zimmermann
2cc9a7a92a Bug 1029386: Asynchronous Bluedroid device bonding, r=shuang 2014-07-03 09:53:20 +02:00
Thomas Zimmermann
f1e2cc8e0a Bug 1029386: Asynchronous discovery methods in Bluedroid, r=shuang 2014-07-03 09:53:06 +02:00
Thomas Zimmermann
0915ce4f89 Bug 1029386: Asynchronous Bluedroid device-property methods, r=shuang 2014-07-03 09:52:35 +02:00
Thomas Zimmermann
f107713f62 Bug 1029386: Asynchronous Bluedroid adapter methods, r=shuang 2014-07-03 09:52:19 +02:00
Thomas Zimmermann
815b1452e3 Bug 1029386: Asynchronous Bluedroid starting and stopping, r=shuang 2014-07-03 09:51:57 +02:00
Thomas Zimmermann
98ba5303e9 Bug 1029386: Split Bluedroid start/stop code, r=shuang
This patch prepares refactoring of the Bluedroid start and stop
code towards an asynchronous design.
2014-07-03 09:51:40 +02:00
Thomas Zimmermann
669bfb5ba3 Bug 1027030: Convert Bluetooth to use Bluedroid wrappers, r=shuang
This patch converts the Bluedroid backend to use the wrapper
classes. The affected interfaces are Core, Sockets, Handsfree,
A2DP, and AVRCP.
2014-06-27 15:45:26 +08:00
Shawn Huang
866fc1e206 Bug 1015819 - Part 1: [bluedroid] Restore CoD value based on SDP records. r=echou, f=btian 2014-06-20 00:48:00 -04:00
Shawn Huang
9ad8cab15e Bug 989976 - [bluedroid] Hit SIGBUS on unaligned access while doing AdapterPropertiesChangeCallback. r=echou 2014-06-17 01:38:00 -04:00
Eric Chou
850e16a6bc Bug 1015826 - Dispatch part of BondStateChangedCallback to main thread, r=tzimmermann 2014-05-29 11:24:09 +08:00
Eric Chou
cff877d6e0 Bug 1015826 - Dispatch part of RemoteDevicePropertiesCallback to main thread, r=tzimmermann 2014-05-29 11:24:07 +08:00
Eric Chou
8225d0bc96 Bug 1015826 - Use Atomic to ensure thread-safe, r=tzimmermann 2014-05-29 11:24:05 +08:00
Eric Chou
4d80c92f07 Bug 1015826 - Dispatch part of AdapterPropertiesCallback to main thread, r=tzimmermann
Please note that sSetPropertyRunnableArray[0] should be fired after
firing "PropertyChanged" to BluetoothAdapter, however this is not
guaranteed in current implementation. This patch also fixed this
potential problem.
2014-05-29 11:24:03 +08:00
Eric Chou
950f42083d Bug 1015826 - Remove unneccessary variable sIsBtEnabled to avoid racing issues, r=tzimmermann 2014-05-29 11:24:02 +08:00
Eric Chou
01819bb915 Bug 942104 - Notify BluetoothAdapter about discovery state changed (bluedroid), r=gyeh 2014-05-23 14:01:37 +08:00
Carsten "Tomcat" Book
b690bcda89 Backed out changeset 592a04d2e550 (bug 942104) 2014-05-22 11:46:16 +02:00
Eric Chou
3d9ccf1139 Bug 942104 - Notify BluetoothAdapter about discovery state changed (bluedroid), r=gyeh 2014-05-22 14:09:56 +08:00
Shawn Huang
d392ae1bcf Bug 1005901 - [bluedroid] Always do cleanup after disable. r=btian 2014-05-16 04:48:00 -04:00
Jamin Liu
7b702a00b1 Bug 1003663 - Handle the case that user turn off BT during the middle of BT reply. r=echou, f=shuang
- End the session if BT is turn off during the middle of BT profile connection.
- Clear static queues(array) when BT is on.
2014-05-08 19:20:15 +08:00
Jamin Liu
3531ecee08 Bug 1003657 - Don't keep reference in GetDefaultAdapterPathInternal() to avoid memory leak. r=echou, f=shuang 2014-05-06 11:45:51 +08:00
Ben Tian
09bf4cabff Bug 995061 - Patch 2/2: [bluedroid] apply macro to append named value in bluetooth service, r=echou 2014-04-11 11:52:58 +08:00
Ben Tian
f2f66e033a Bug 993275 - [Bluedroid] Ensure icon for audio service devices, r=echou 2014-04-14 09:50:47 +08:00
Thomas Zimmermann
57276d72d4 Bug 985949: Correctly forget pointer references in Bluedroid backend, r=echou
This patch fixes a regression from bug 967364. An nsRefPtr is now
correctly cleared by |forget| without causing a crash.
2014-03-24 10:44:29 +01:00
Thomas Zimmermann
c6ef63ecf9 Bug 979370: Remove |BluetoothService::IsEnabledInternal|, r=echou
The method |IsEnabledInternal| of |BluetoothService| is not used
any longer. This patch removes it.
2014-03-14 10:50:29 +01:00
Thomas Zimmermann
93465e4cfc Bug 979370: Move Bluetooth thread into BlueZ backend, r=echou
The Bluetooth thread is only necessary for starting and stopping
Bluetooth with the BlueZ backend. Bluedroid implements its multi-
threading internally.

This patch moves the Bluetooth thread into the BlueZ backend. Two
runnables implement the starting and stopping code. The methods
|StartInternal| and |StopInternal| of |BluetoothDBusService| each
create an instance of the respective runnable and send it to the
internal BT thread. The code in |BluetoothService| runs completely
on the main thread.

For the Bluedroid back end, the patch changes a number of thread
assertions.
2014-03-14 10:49:33 +01:00
Thomas Zimmermann
0fab75c57d Bug 978809: Remove sToggleBtMonitor from Bluedroid backend, r=echou
When enabling or disabling Bluetooth, the Bluedroid backend waits
on sToggleBtMonitor until a BT adapter has been activated. Once
the monitor gets notified, the backend sends a ToggleBtAck runnable
to the main thread.

This patch removes sToggleBtMonitor from the Bluetooth Bluedroid
backend. Instead of signalling the monitor's notification, the
Bluedroid handler function sends the ToggleBtAck directly.
2014-03-06 12:43:35 +01:00
Eric Chou
192419b765 Bug 976943 - Add error handing for connect/disconnect process, f=btian, r=gyeh 2014-03-06 19:26:22 +08:00
Thomas Zimmermann
b12b28f5be Bug 977146: Push ToggleBtAck into implementations of {Start|Stop}Internal, r=echou
The methods {Start|Stop}Internal for BlueZ and Bluedroid now send
ToggleBtAck to signal completeness of the operation.

The current patch allows for further cleanups in the BlueZ code. It
does not change the semantics or code flow.
2014-03-03 13:07:17 +01:00
Ben Tian
ab27a1bcd6 Bug 972732 - Patch 1/2: Remove bluez/linux and bluedroid/gonk folders, r=echou 2014-02-25 10:38:51 +08:00