Commit Graph

1038 Commits

Author SHA1 Message Date
Jamin Liu
65d64d181f Bug 929376 - Part 2: Move 'IsConnected' from BluetoothManager to BluetoothAdapter and allow it to be used on content process. r=shawnjohnjr 2014-08-26 18:50:35 +08:00
Ryan VanderMeulen
468fb8552d Backed out changesets d9cbdfbed1f5 and a38ad201299f (bug 929376) for bustage. 2014-08-25 10:46:22 -04:00
dannyliang
319a156073 Bug 1057309 - Fix BT build break in flatfish. r=tzimmermann 2014-08-25 00:00:00 -04:00
Jamin Liu
0bb7727ee9 Bug 929376 - Part 2: Move 'IsConnected' from BluetoothManager to BluetoothAdapter and allow it to be used on content process. r=shawnjohnjr 2014-08-25 03:53:00 -04:00
Eric Chou
bf4cc29d32 Bug 1013748 - Use StaticRefPtr to hold BluetoothService objects, f=shuang, r=tzimmermann, r=khuey 2014-08-25 17:53:37 +08:00
Thomas Zimmermann
15fbfb1a8a Bug 1053804: Replace |MainThreadTask| by |CloseScoRunnable|, r=shuang
|MainThreadTask| performs different operations on the main thread,
depending on a given command flag. There is only one command, CLOSE_SCO,
in use.

This patch removes the command infrastructure and replaces |MainThreadTask|
by |CloseScoRunnable|, which implements only this single operation.
2014-08-21 10:10:39 +02:00
Thomas Zimmermann
1360f1b2dd Bug 1053804: Cleanup Bluetooth Handsfree manager, r=shuang
This patch removes the unusued callback code from Bluetooth's
Handsfree manager.
2014-08-21 10:10:39 +02:00
Thomas Zimmermann
5e5bc1cd09 Bug 1053804: Integrate runnables into Handsfree notifications, r=shuang
A number of notifications dispatch runnables to the main thread for
invoking actions. This is not requireed, as notifications already
run on the main thread. This patch merges the runnable's code into
the respective notifications.
2014-08-21 10:10:39 +02:00
Thomas Zimmermann
43e680c63c Bug 1053804: Use Bluetooth Handsfree notifications, r=shuang
This patch replaces Handsfree callbacks by notifications. One
important change is that the first call to |BluetoothHandsfreeManager::Get|
now happens during initialization. Hence the Handsfree manager is now setup
immediately, instead of later at use.
2014-08-21 10:10:38 +02:00
Thomas Zimmermann
2bed41e8de Bug 1053804: Implement Bluetooth Handsfree notifications, r=shuang
The patch adds notifications support to the Handsfree manager. Each
notification's method is taken from the respective callback code, with
changes to the arguments' data types.
2014-08-21 10:10:38 +02:00
Thomas Zimmermann
71cdd30826 Bug 1053804: Add Bluetooth Handsfree notifications, r=shuang
The notification interface consists of virtual methods that are
invoked form the Bluetooth backend on certain events. The Handsfree
manager can implement the methods to handle these events.
2014-08-21 10:10:37 +02:00
Juan Gomez
a97c9bdb71 Bug 1054791 - [Flatfish][Build] Build failed in BluetoothInterface.cpp: 'bt_remote_version_t' does not name a type. r=tdz 2014-08-17 16:21:00 -04:00
Bobby Holley
7c7704aa07 Bug 1052052 - Hoist Auto*JSContext into nsContentUtils and kill nsCxPusher.{cpp,h}. r=gabor 2014-08-14 18:47:15 -07:00
Thomas Zimmermann
fae10bf968 Bug 1048915: Cleanup |BluetoothServiceBluedroid| and related functions, r=shuang
This patch removes unsued code from |BluetoothServiceBluedroid|, related
functions, and cleans up the file. It

 * removes callbacks,
 * removes callback helper tasks,
 * removes helper functions, and
 * cleans up global variables.
2014-08-14 18:12:52 +02:00
Thomas Zimmermann
8547aeba35 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
6131bf3961 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
4c463fc757 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
77156aef84 Bug 1048915: Add Bluetooth Core notifications, r=shuang
A notification is a callback from the Bluetooth backend to inform
Gecko about a event. Bluedroid uses function pointers for this, but
in Gecko we use method calls instead.

Gecko implements notification handlers for the Bluetooth backend. The
backend converts incomming events to Gecko types and forwards them to
the registered notification handler.
2014-08-14 18:12:51 +02:00
Thomas Zimmermann
3a1603152f Bug 1048915: Add infrastructure for Bluetooth notifications, r=shuang
This patch adds some runnable classes for running class methods on
the main thread. This is the base of the upcomming notification
mechanism for Bluetooth.
2014-08-14 18:12:51 +02:00
Vicamo Yang
d154baf8a2 Bug 1048098: remove redundant flushPermissions, flushPrefEnv from tearing down procedure. r=btian, r=echen 2014-08-08 18:28:58 +08:00
Jocelyn Liu
c8da47a765 Bug 1050494: Clear sBluetoothThread in BluetoothDBusService on shutdown to fix memory leak. r=shuang 2014-08-08 16:22:32 +08:00
Thomas Zimmermann
7a7fa414f1 Bug 1050299: Wrap BlutoothInterface array initializaton in preprocessor macro, r=shuang
This patch fixes array initialization in the |Convert| functions of
|BluetoothInterface|. Designated initializers are not supported by
all compilers, so we wrap them into a macro and only used them when
possible.
2014-08-07 16:51:14 +02:00
Thomas Zimmermann
5af38c1d79 Bug 992206: Cleanup interface of |BluetoothSocket|, r=shuang
This patch cleans up the interface of Bluedroid's |BluetoothScoket|
to look more similar the interface of |UnixSocketConsumer|, from
which it descends.
2014-08-07 11:37:50 +02:00
Thomas Zimmermann
c61a5628ae Bug 992206: Use |SocketIOShutdownTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:50 +02:00
Thomas Zimmermann
d4ab8f302f Bug 992206: Use |SocketIOSendTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
2a84992441 Bug 992206: Use |SocketIOTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
731665fb89 Bug 992206: Use |SocketIOBase| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
83d04e76a6 Bug 992206: Use |SocketIODeleteInstanceRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
9388876f6f Bug 992206: Use |SocketIORequestClosingRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
16d792817c Bug 992206: Use |SocketIOReceiveRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
a166e379f7 Bug 992206: Use |SocketIOEventRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
d2708be094 Bug 992206: Use |SocketIORunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:47 +02:00
Thomas Zimmermann
b8651b1768 Bug 992206: Use |SocketConsumerBase| for Bluetooth sockets, r=shuang 2014-08-07 11:37:47 +02:00
Thomas Zimmermann
9268476e14 Bug 992206: Cleanup fields in |DroidSocketImpl|, r=shuang
|DroidSocketImpl| contains several unused fields that are removed
by this patch.
2014-08-07 11:37:47 +02:00
Jocelyn Liu
ea23543f04 Bug 1047757: Call ClearOnShutdown(sBluetoothService) to fix memory leak. r=shuang 2014-08-07 14:01:24 +08:00
Thomas Zimmermann
4c49c527b7 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
c0139dd296 Bug 1038591: Convert Bluetooth AVRCP data types in |BluetoothAvrcpInterface|, r=shuang
With this patch |BluetoothAvrcpInterface| is responsible for converting all
Bluetooth data types to Bluedroid types. All callers have been adapted.
2014-08-06 11:45:22 +02:00
Thomas Zimmermann
2537fcb8d5 Bug 1038591: Convert Bluetooth A2DP data types in |BluetoothA2dpInterface|, r=shuang
With this patch |BluetoothA2dpInterface| is responsible for converting all
Bluetooth data types to Bluedroid types. All callers have been adapted.
2014-08-06 11:45:14 +02:00
Thomas Zimmermann
f15dfc8ccd Bug 1038591: Convert Bluetooth Handsfree data types in |BluetoothHandsfreeInterface|, r=shuang
With this patch |BluetoothHandsfreeInterface| is responsible for converting all
Bluetooth data types to Bluedroid types. All callers have been adapted.
2014-08-06 11:45:05 +02:00
Thomas Zimmermann
8feb4fd363 Bug 1038591: Convert Bluetooth Socket data types in |BluetoothSocketInterface|, r=shuang
With this patch |BluetoothSocketInterface| is responsible for converting all
Bluetooth data types to Bluedroid types. All callers have been adapted.
2014-08-06 11:44:56 +02:00
Thomas Zimmermann
18c28adada 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
Ed Morley
4f96f64e62 Backed out changeset 9281f9896ce0 (bug 1048098) for webapi test failures 2014-08-05 12:22:00 +01:00
Vicamo Yang
d84ab8839a Bug 1048098: remove redundant flushPermissions, flushPrefEnv from tearing down procedure. r=btian, r=echen 2014-08-05 16:19:06 +08:00
Thomas Zimmermann
54561d6b2a Bug 1045486: Rename |ConnectResultHandler| to |ConnectSocketResultHandler|, r=shuang
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-05 09:29:14 +02:00
Thomas Zimmermann
d2afb9b180 Bug 1045486: Fix member types of |BluetoothInterfaceRunnable{1,3}<>|, r=shuang
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-05 09:28:35 +02:00
Thomas Zimmermann
5499fdacaa 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
Nathan Froyd
9ea6c585f8 Bug 1042878 - part 2 - move MOZ_CAIRO_CFLAGS et al additions to C*FLAGS into moz.build; r=glandium 2014-07-24 11:55:33 -04:00
Thomas Zimmermann
ce5e0ada46 Bug 1045461: Fix HFP fallback code to work with latest Bluetooth changes, r=shuang
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:09 +02:00
Carsten "Tomcat" Book
f2360c7833 merge mozilla-inbound to mozilla-central a=merge 2014-07-23 15:50:58 +02:00
Thomas Zimmermann
084da9d46d Bug 1029390: Asynchronous |BluetoothAvrcpInterface::SetVolume|, r=shuang 2014-07-23 07:56:23 +02:00