Commit Graph

64 Commits

Author SHA1 Message Date
Nigel Babu
7e1903b51c Backed out changeset a471c7c73409 (bug 1036234) for build bustage on A CLOSED TREE 2014-08-12 09:00:08 +05:30
Jamin Liu
c87d6c4079 Bug 1036234 - Implement pairing event handlers of BluetoothAdapter. r=btian, r=mrbkap
- EventHandler ondevicepaired;
- EventHandler ondeviceunpaired;
2014-08-12 10:49:59 +08:00
Thomas Zimmermann
92a362d3ac Bug 1048770: Rename |ConnectResultHandler| to |ConnectSocketResultHandler| (under bluetooth2/), r=btian
The linker mixes up |ConnectResultHandler| from BluetoothSocket.cpp
and BluetoothHfpManager.cpp. Consequently one of them gets removed
when linking libxul.so.

This patch works around the problem by renaming |ConnectResultHandler|
in BluetoothSocket.cpp to |ConnectSocketResultHandler|.
2014-08-08 09:58:18 +02:00
Thomas Zimmermann
5bcadb1e61 Bug 1048770: Fix member types of |BluetoothInterfaceRunnable{1,3}<>| (under bluetooth2/), r=btian
When sending a |BluetoothInterfaceRunnable3<>| to the main thread,
in the case of BluetoothSocketResultHandler, the connect and accept
operations transfer string objects by reference from the I/O thread.
When the reference is accessed, the actual string might be removed
already.

The patch fixes the problem by storing the strings as value in the
runnable object.
2014-08-08 09:58:17 +02:00
Jocelyn Liu
109a2d162b Bug 1036228 - Patch2: Handle pairing requests reported by bluedroid in bluetooth services. r=btian 2014-08-05 18:25:47 +08:00
Thomas Zimmermann
11e265c36c Bug 1045461: Fix HFP fallback code to work with latest Bluetooth changes (under bluetooth2/), r=btian
Recent patches to Bluetooth introduced asynchronous initialization of
profile manager. The code in hfp-fallback was not adapted then. This
patch updates the broken code.
2014-07-29 10:47:31 +02:00
Jocelyn Liu
68cec10ca7 Bug 1033898 - Patch1: Add BluetoothPairingEvent and BluetoothPairingHandlewebidls and their class implementations. r=btian, r=bz 2014-07-28 22:09:00 +02:00
Thomas Zimmermann
a4d154c381 Bug 1042691: Asynchronous |BluetoothAvrcpInterface::SetVolume| (under bluetooth2/), r=btian 2014-07-28 09:52:52 +02:00
Thomas Zimmermann
34f4929103 Bug 1042691: Asynchronous AVRCP response interfaces (under bluetooth2/), r=btian 2014-07-28 09:52:51 +02:00
Thomas Zimmermann
36fc86ade8 Bug 1042691: Asynchronous A2DP connect/disconnect (under bluetooth2/), r=btian 2014-07-28 09:52:51 +02:00
Thomas Zimmermann
abbdf7f4d9 Bug 1042691: Asynchronous init and cleanup of A2DP/AVRCP (under bluetooth2/), r=btian 2014-07-28 09:52:51 +02:00
Thomas Zimmermann
6c5cf788bd Bug 1042691: Add A2DP/AVRCP result-handler infrastructure (under bluetooth2/), r=btian 2014-07-28 09:52:50 +02:00
Jocelyn Liu
a6b9d588e3 Bug 1038632 - Patch2: Maintain device objects in BluetoothAdapter. r=btian 2014-07-25 15:21:44 +08:00
Thomas Zimmermann
f90b7b92ba Bug 1038645: Asynchronous |BluetoothHandsfreeInterface::PhoneStateChange| (under bluetooth2/), r=btian 2014-07-22 13:53:29 +02:00
Thomas Zimmermann
d83face693 Bug 1038645: Asynchronous Bluetooth Handsfree response methods (under bluetooth2/), r=btian 2014-07-22 13:53:29 +02:00
Thomas Zimmermann
047957b89c Bug 1038645: Asynchronous |BluetoothHandsfreeInterface::DeviceStatusNotification| (under bluetooth2/), r=btian 2014-07-22 13:53:29 +02:00
Thomas Zimmermann
d1a03f2f88 Bug 1038645: Asynchronous |BluetoothHandsfreeInterface::VolumeControl| (under bluetooth2/), r=btian 2014-07-22 13:53:28 +02:00
Thomas Zimmermann
051abd7a03 Bug 1038645: Asynchronous Bluetooth Handsfree voice-recognition functions (under bluetooth2/), r=btian 2014-07-22 13:53:28 +02:00
Thomas Zimmermann
8d89f772f2 Bug 1038645: Asynchronous Bluetooth Handsfree connection handling (under bluetooth2/), r=btian 2014-07-22 13:53:28 +02:00
Thomas Zimmermann
4748418d2c Bug 1038645: Asynchronous Bluetooth Handsfree init and cleanup methods (under bluetooth2/), r=btian 2014-07-22 13:53:28 +02:00
Thomas Zimmermann
005720e0e0 Bug 1038645: Add result-handler class for Bluetooth Handsfree profile (under bluetooth2/), r=btian 2014-07-22 13:53:27 +02:00
Thomas Zimmermann
5e7b83c8fb Bug 1038645: Asynchronous starting and stopping of profile managers (under bluetooth2/), r=btian
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-22 13:53:27 +02:00
Thomas Zimmermann
1fe5425619 Bug 1039216: Fix build break when building JB 4.2 (under bluetooth2/), r=btian 2014-07-02 17:42:21 +08:00
Thomas Zimmermann
51dbdb677a Bug 1037342: Close file descriptor in BluetoothSocket (under bluetooth2/), r=btian
Currently, BluetoothSocket leaks its file descriptor on close
operations. With this patch when Gecko closes an instance of
BluetoothSocket, the file descriptor is now closed as well.
2014-07-17 09:44:19 +02:00
Thomas Zimmermann
b85592772c Bug 1036977: Remove socket setup from BluetoothSocket (under bluetooth2/), r=btian
This patch removes all code related to socket setup from Bluedroid's
BluetoothSocket. The socket setup is handled by BluetoothInterface;
transparantly to its users.

Since most of the socket setup is now hidden, a comment was added to
DroidSocketImpl that explains the connection phases in server and
client.
2014-07-16 10:25:10 +02:00
Thomas Zimmermann
8d81ad06e7 Bug 1036977: Handle socket setup for |Accept| in BluetoothInterface (under bluetooth2/), r=btian
This patch moves the accept phase of Bluedroid's |Listen| to the
implementation of BluetoothInterface. |BluetoothInterface::Accept|
handles Bluedroid's socket-setup messages and executes the result
handler with the received file descriptor and data.
2014-07-16 10:24:41 +02:00
Thomas Zimmermann
14b9c49fb9 Bug 1036977: Handle socket setup for |Connect| in BluetoothInterface (under bluetooth2/), r=btian
Bluedroid's internal socket setup transfers 2 messages and possibly
a file descriptor as the first data of a socket connection.

This patch moves the socket-setup code for the |Connect| call to
the implementation of BluetoothInterface. BluetoothSocket only
handles the socket setup of |Listen|, and general socket state.
2014-07-16 10:24:33 +02:00
Thomas Zimmermann
e0c157ebb2 Bug 1036977: Introduce connection status for Bluedroid sockets (under bluetooth2/), r=btian
In preparaton of moving the Bluedroid socket setup to BluetoothInterface,
this patch introduces connection states for Bluetooth sockets. There are
4 states,

  - Disconnected,
  - Listening,
  - Connecting, and
  - Connected.

All sockets start in Disconnected and transition to Connected via one
of the other states. Server socket transition through Listening, Client
sockets transition through Connecting. There is currently a lot of code
duplication in read and write methods. This will be cleaned up when the
connection setup is handled by BluetoothInterface.
2014-07-16 10:24:19 +02:00
Thomas Zimmermann
0a24c61f83 Bug 1036977: Convert Bluedroid Socket's Connect method to asynchronous design (under bluetooth2/), r=btian 2014-07-16 10:24:05 +02:00
Thomas Zimmermann
5f8dcc4959 Bug 1036977: Convert Bluedroid Socket's Listen method to asynchronous design (under bluetooth2/), r=btian 2014-07-16 10:23:52 +02:00
Thomas Zimmermann
693f376d92 Bug 1036977: Add result handler for Bluetooth Socket interface (under bluetooth2/), r=btian 2014-07-16 10:23:35 +02:00
Jocelyn Liu
2acb00d1df Bug 1006315: Revise BluetoothDevice.webidl and implement it for new WebBluetooth API. r=btian, r=bz 2014-07-14 10:47:19 +08:00
Thomas Zimmermann
1b51d02736 Bug 1033961: Asynchronous Bluedroid DUT and LE interfaces (under bluetooth2/), r=btian 2014-07-09 09:39:43 +02:00
Thomas Zimmermann
ec26f1ab37 Bug 1033961: Asynchronous authentification in Bluedroid (under bluetooth2/), r=btian 2014-07-09 09:39:31 +02:00
Thomas Zimmermann
5e10d6244b Bug 1033961: Asynchronous Bluedroid device bonding (under bluetooth2/), r=btian 2014-07-09 09:39:18 +02:00
Thomas Zimmermann
4f71ca5e0c Bug 1033961: Asynchronous discovery methods in Bluedroid (under bluetooth2/), r=btian 2014-07-09 09:39:04 +02:00
Thomas Zimmermann
83272ecf5c Bug 1033961: Asynchronous remote-service methods in Bluedroid (under bluetooth2/), r=btian 2014-07-09 09:38:49 +02:00
Thomas Zimmermann
110e090d93 Bug 1033961: Asynchronous Bluedroid device-property methods (under bluetooth2/), r=btian 2014-07-09 09:38:35 +02:00
Thomas Zimmermann
1048d1066e Bug 1033961: Asynchronous Bluedroid adapter methods (under bluetooth2/), r=btian 2014-07-09 09:38:20 +02:00
Thomas Zimmermann
beb3d46e7b Bug 1033961: Asynchronous Bluedroid starting and stopping (under bluetooth2/), r=btian 2014-07-09 09:38:06 +02:00
Thomas Zimmermann
749115a0d9 Bug 1033961: Split Bluedroid start/stop code (under bluetooth2/), r=btian
This patch prepares refactoring of the Bluedroid start and stop
code towards an asynchronous design.
2014-07-09 09:37:53 +02:00
Thomas Zimmermann
b8bec5f581 Bug 1033961: Add result handler for Bluetooth Core profile (under bluetooth2/), r=btian
The result-handler class contains a method for each interface
in the Core profile and a method for failed calls. The patch
also adds runnable classes that execute a result handler's
method on the main thread.
2014-07-09 09:37:40 +02:00
Shawn Huang
b248d966d6 Bug 1033273 - Part 2: Add InitHfpInterface/DeinitHfpinterface. r=btian 2014-07-03 00:05:00 -04:00
Ben Tian
431e479c90 Bug 1006314 - Patch 2/3: Implement BluetoothDiscoveryHandle, r=bz, r=echou 2014-07-02 11:16:37 +08:00
Ben Tian
291204e6a6 Bug 1033130 - [bluetooth2] Add missing including of BluetoothInterface.h in BluetoothA2dpManager.cpp, r=shuang 2014-07-02 10:36:28 +08:00
Jocelyn Liu
5c1c665d7a Bug 1031253 - Patch: Reject promise if StartStopGonkBluetooth failed. r=btian 2014-07-02 10:13:39 +08:00
Thomas Zimmermann
bdab8163ef Bug 1031185: Convert Bluetooth to use Bluedroid wrappers (under bluedroid2/), r=btian
This patch converts the Bluedroid backend to use the wrapper
classes. The affected interfaces are Core, Sockets, Handsfree,
A2DP, and AVRCP.
2014-07-01 17:50:46 +02:00
Thomas Zimmermann
3599b2ff1c Bug 1031185: Wrap Bluedroid interfaces in classes (under bluedroid2/), r=btian
This patch adds classes around all Bluedroid interfaces that are
currently used by Gecko. These are Core, Socket, Handsfree, A2DP,
and AVRCP.

All arguments and return values are still Bluedroid types and
constants. Future patches will convert them to interface-neutral
artifacts.
2014-07-01 17:50:30 +02:00
Jocelyn Liu
1a23e69aaa Bug 1006310 - Patch2: Revise SetName and SetDiscoverable to use Promise. r=btian, r=bz 2014-06-24 15:31:10 +08:00
Jamin Liu
eb8a5e3410 Bug 1020300 - Dispatch part of AdapterStateChangedCallback to main thread. r=btian 2014-06-20 12:07:23 +08:00