Commit Graph

1474 Commits

Author SHA1 Message Date
Thomas Zimmermann
364b0a0542 Bug 1168806: Configurable consumer thread for socket IPC classes, r=kmachulis
The consumer thread handles socket creation, destruction, and
data processing for socket IPC. Traditionally this has been
done on the main thread.

This patch extends the socket IPC classes to support arbitrary
consumer threads. The thread is configured when establishing a
connection, and performs all of the above operations until the
socket is closed.
2015-06-02 10:01:57 +02:00
Thomas Zimmermann
425da7831c Bug 1168806: Configurable I/O thread for socket IPC classes, r=kmachulis
The I/O thread sends and receives data on a file descriptor. This
has traditionally been performed on a single I/O thread.

This patch extends the socket IPC classes to support arbitrary I/O
threads. The thread is configured when a connection is established
and used until the socket gets closed.
2015-06-02 10:01:57 +02:00
Jamin Liu
a6ba4ea445 Bug 1170086 - Fix the parameter type of DispatchReplyError() in StartLeScan result handler. r=joliu 2015-06-02 13:55:12 +08:00
Thomas Zimmermann
0ff93d975f Bug 1168446: Don't store connection parameters in |BluetoothSocket|, r=shuang 2015-06-01 10:42:29 +02:00
Thomas Zimmermann
0d1b4b5d58 Bug 1168446: Change |BluetoothSocket::{ListenSocket,ConnectSocket}| interface, r=shuang
This patch changes |BluetoothSocket::{ListenSocket,ConnectSocket}| to
be similar to the corresponding interfaces in ipc/unixsocket.
2015-06-01 10:42:29 +02:00
Thomas Zimmermann
a8a663fc4c Bug 1168446: Remove |BluetoothSocket::GetSocketAddr|, r=shuang 2015-06-01 10:42:29 +02:00
Thomas Zimmermann
9ec8c10366 Bug 1168446: Remove |Disconnect| from BlueZ's |BluetoothSocket|, r=shuang
The method |BluetoothSocket::Disconnect| is just a wrapper around
|Close|. This patch replaces all invocations of |Disconnect| with
|Close| and removes the method.
2015-06-01 10:42:29 +02:00
Jocelyn Liu
e55bd11620 Bug 1163499 - Part 5: Support GATT profile when using Bluetooth daemon. r=tzimmermann 2015-05-27 00:05:00 -04:00
Jocelyn Liu
72f11918ec Bug 1163499 - Part 4: Add GATT and GATT client interfaces for Bluetooth daemon. r=tzimmermann 2015-05-27 04:53:00 -04:00
Jocelyn Liu
4a1c855999 Bug 1163499 - Part 3: Add GATT module for Bluetooth daemon. r=tzimmermann 2015-05-27 04:52:00 -04:00
Jocelyn Liu
86ca3f75c7 Bug 1163499 - Part 2: Add helpers for Bluetooth daemon GATT client support. r=tzimmermann 2015-05-27 00:03:00 -04:00
Jocelyn Liu
e9c7840743 Bug 1163499 - Part 1: Revise BluetoothGattInterface and result handler for daemon support. r=tzimmermann 2015-05-27 04:50:00 -04:00
Bevis Tseng
4dc1a2216d Bug 1114938 - Part 2.1: (Gonk) Refactor Stk Proactive Commands from IccProvider to IccService. r=echen 2015-04-27 16:01:56 +08:00
Thomas Zimmermann
92a42ffbe4 Bug 1167210: Replace |union sockaddr_any| with |struct sockaddr_storage|, r=kmachulis
Both types, |union sockaddr_any| and |struct sockaddr_storage|, provide
a sockaddr type that can hold any address. The latter is standardized by
POSIX, so we prefer it.
2015-05-27 13:49:07 +02:00
Jamin Liu
37bad3304d Bug 1168343 - Remove the improper MOZ_ASSERT in |BluetoothServiceBluedroid::BondStateChangedNotification|. r=shuang 2015-05-27 13:38:21 +08:00
Jamin Liu
06c6b86506 Bug 1168266 - Add few member functions of ObexHeaderSet for PBAP. r=shuang 2015-05-27 09:48:02 +08:00
Thomas Zimmermann
19b95544ab Bug 1167207: Remove |BluetoothDaemonChannel|, r=shuang
This patch integrates the functionality of |BluetoothDaemonChannel|
into |BluetoothDaemonConnection|. All users are adapted, the former
class is removed.
2015-05-26 18:29:02 +02:00
Thomas Zimmermann
d4f5bad1fa Bug 1166638: Use |ListenSocketConsumer| in |ListenSocket|, r=kmachulis, dlee, chucklee, shuang
This patch converts |ListenSocket| to forward events to an instance
of |ListenSocketConsumer|. All users are converted and the related
listener and consumer classes are removed.
2015-05-26 13:24:20 +02:00
Jamin Liu
27838b1c76 Bug 1165182 - Stop LE scans when Bluetooth adapter is disconnected from its owner. r=joliu 2015-05-26 10:33:47 +08:00
Jocelyn Liu
ff9f1eba0d Bug 1167070 - Overwrite BLE related flags to enable BLE functionalities in bluedroid for both bluetooth1 and bluetooth2. r=shuang 2015-05-22 20:07:00 -04:00
Shawn Huang
34ba9ed276 Bug 1166469 - Add HandleBackendError for hfp-fallback product, r=btian 2015-05-22 11:45:54 +08:00
Carsten "Tomcat" Book
6115ce9657 Merge mozilla-central to b2g-inbound 2015-05-21 15:19:27 +02:00
Carsten "Tomcat" Book
0adcc581e9 merge mozilla-inbound to mozilla-central a=merge 2015-05-21 14:56:34 +02:00
Thomas Zimmermann
c3aad11cb9 Bug 1164417: Add |ConnectionOrientedSocket::PrepareAccept| for accepting socket connections, r=kmachulis
With this patch, stream and listening sockets handle the setup of
accepted sockets internally. Sub-classes of |StreamSocket| don't
have to overload StreamSocket's |GetIO| any longer.
2015-05-21 13:34:37 +02:00
Thomas Zimmermann
c81d8f912a Bug 1164417: Store PDU consumer in |BluetoothDaemonConnection|, r=kmachulis 2015-05-21 13:34:37 +02:00
Thomas Zimmermann
a385885364 Bug 1164417: Add |UnixSocketConnector::Duplicate|, r=kmachulis
The new method |UnixSocketConnector::Duplicate| allows a socket
connector to duplicate itself. Listening sockets will used this
feature to create socket connectors for accepted connections.
2015-05-21 13:34:37 +02:00
Ben Tian
e738188cd8 Bug 1166587 - Check OBEX packet length before accessing it, r=shuang 2015-05-21 14:11:20 +08:00
Ben Hsu
9c7eb6a85b Bug 1147736 - Part 4: Deprecate NotifyError(Bluetooth). r=btian 2015-05-08 00:21:00 -04:00
Wes Kocher
8d022113f2 Merge m-c to inbound, a=merge 2015-05-20 18:30:33 -07:00
Bobby Holley
17dddddb65 Bug 1165162 - Serialize originSuffix into .origin. r=gabor,sr=sicking
We also provide an opt-out for the original behavior, and use it in various
consumers that look like they need fixing up. Most of the usage here is in
code with persistence considerations, where we may need some sort of migration
path.
2015-05-20 17:11:49 -07:00
Cameron McCormack
61b12520df Bug 1166575 - Silence uninitialized variable error in BluetoothHALInterface.cpp when building a debug B2G build. r=tzimmermann 2015-05-21 10:01:59 +10:00
Carsten "Tomcat" Book
a1b96b13aa merge mozilla-inbound to mozilla-central a=merge 2015-05-20 15:52:31 +02:00
Thomas Zimmermann
f3630711c2 Bug 1164425: Cleanup interfaces of |ListenSocket|, r=kmachulis
This patch removes |ListenSocket::GetSocketAddr|, which is unused
and not thread-safe. The |Listen| methods now return error codes.
2015-05-20 10:50:43 +02:00
Thomas Zimmermann
ca2120fb35 Bug 1164425: Rename |SocketBase::CloseSocket| to |SocketBase::Close|, r=kmachulis 2015-05-20 10:50:43 +02:00
Carsten "Tomcat" Book
24a87517b4 Backed out changeset 1e93024c9fec (bug 1164425) for bustage 2015-05-20 10:31:55 +02:00
Carsten "Tomcat" Book
1f415f3e51 Backed out changeset 17bd0777339a (bug 1164425) 2015-05-20 10:30:55 +02:00
Thomas Zimmermann
ab30c72531 Bug 1164425: Cleanup interfaces of |ListenSocket|, r=kmachulis
This patch removes |ListenSocket::GetSocketAddr|, which is unused
and not thread-safe. The |Listen| methods now return error codes.
2015-05-20 09:54:27 +02:00
Thomas Zimmermann
a0c499fc22 Bug 1164425: Rename |SocketBase::CloseSocket| to |SocketBase::Close|, r=kmachulis 2015-05-20 09:54:27 +02:00
Ben Tian
dba97a1dcd Bug 1162902 - Implement PBAP SetPhoneBook function, r=shuang 2015-05-20 14:40:01 +08:00
Jamin Liu
cf6eb0cfee Bug 1166215 - Cast 'BluetoothTypeOfDevice' to uint32_t before the BT signal is distributed to BluetoothAdapter. r=joliu 2015-05-20 14:29:25 +08:00
Ben Tian
72f886be9c Bug 1166176 - [cleanup] Simplify volume related code in OPP manager, r=shuang 2015-05-19 17:09:56 +08:00
Ben Tian
3a81b3b09f Bug 1166180 - [cleanup] Remove function |EnsureBluetoothHalLoad| in BluetoothServiceBluedroid, r=shuang 2015-05-19 17:02:01 +08:00
Thomas Zimmermann
aedad80f8c Bug 1161020: Remove old interface and implementation from socket-connector classes, r=kmachulis 2015-05-19 13:28:46 +02:00
Thomas Zimmermann
fef18979cc Bug 1161020: Use new socket-connector interface in socket classes, r=kmachulis
This patch converts the socket I/O classes to use the new interface
of the socket-connector classes. All sockets are now created and set
up by a socket connector.
2015-05-19 13:28:46 +02:00
Thomas Zimmermann
97a394946e Bug 1161020: Implement new socket-connector interface for Bluetooth sockets, r=btian 2015-05-19 13:28:46 +02:00
Thomas Zimmermann
d0a1137e40 Bug 1161020: Implement new socket-connector interface for Bluetooth daemon socket, r=shuang
This patch moves |BluetoothDaemonSocketConnector| into its own file,
renames it to |BluetoothDaemonConnector| and implements the new socket-
connector interface.
2015-05-19 13:28:46 +02:00
Thomas Zimmermann
8ece57532a Bug 1164498: Remove |DispatchBluetoothReply|, r=btian
This patch removes |DispatchBluetoothReply|. The only remaining user
is |BluetoothDBusService|, but it comes with its own implemenation of
the function.
2015-05-19 12:28:38 +02:00
Thomas Zimmermann
2e4712ef31 Bug 1164498: Remove |DispatchBluetoothReply| from |BluetoothHfpManger|, r=btian
This patch replaces |DispatchBluetoothReply| in |BluetoothHfpManager|
with corresponding calls to |DispatchReplySuccess| or |DispatchReplyError|.
2015-05-19 12:28:38 +02:00
Thomas Zimmermann
2cb840d86e Bug 1164498: Remove |DispatchBluetoothReply| from |BluetoothProfileController|, r=btian
This patch replaces |DispatchBluetoothReply| in |BluetoothProfileController|
with corresponding calls to |DispatchReplySuccess| or |DispatchReplyError|.
2015-05-19 12:28:38 +02:00
Thomas Zimmermann
316101c3d0 Bug 1164498: Remove |DispatchBluetoothReply| from |BluetoothServiceBluedroid|, r=btian
This patch replaces |DispatchBluetoothReply| in |BluetoothServiceBluedroid|
by corresponding calls to |DispatchReplySuccess| or |DispatchReplyError|.
2015-05-19 12:28:38 +02:00
Thomas Zimmermann
b4f2a0e204 Bug 1164498: Cleanup Bluetooth utility functions for dispatching replies, r=btian
This patch adds support for |DispatchReplySuccess| and |DispatchReplyError|
to Bluetooth v1.
2015-05-19 12:28:38 +02:00
Ryan VanderMeulen
50e913e2aa Merge inbound to m-c. a=merge 2015-05-18 16:32:50 -04:00
Andrea Marchesini
54e2145f4a Bug 1163388 - patch 2 - get rid of nsIDOMFile, r=ehsan 2015-05-18 14:52:26 +01:00
Andrea Marchesini
d92f2c8a0a Bug 1163388 - patch 1 - make nsIDOMFile an empty interface, r=ehsan 2015-05-18 14:51:54 +01:00
Jamin Liu
a57d926787 Bug 1098228 - Set Bluetooth discoverable to default value when BT state is BT_STATE_OFF. r=shuang 2015-05-18 09:27:23 +08:00
Neil Rashbrook
7d598ef37a Bug 1155963 Only allow NS_LITERAL_CSTRING to be used on compile-time literals r=froydnj,ehsan 2015-05-16 09:07:10 +01:00
Ben Tian
4094a46d23 Bug 1164314 - Fire devicefound in RemoteDevicePropertiesNotification only during discovery, r=shuang 2015-05-15 14:14:02 +08:00
Will Wang
e713bf349f Bug 1161888 - remove first CKPD flag and do not set |mDialingRequestProcessed| flag to avoid the redundant HFP_AT_RESPONSE_OK. r=shuang 2015-05-15 14:35:46 +08:00
Wes Kocher
89f9363855 Merge b2ginbound to m-c a=merge 2015-05-14 15:37:44 -07:00
Naoki Hirata
a09a0dc1c2 Backed out 4 changesets (bug 1147736)
Backed out changeset 80ad8826d772 (bug 1147736)
Backed out changeset 1f69ddad07bb (bug 1147736)
Backed out changeset 34aee78127f5 (bug 1147736)
Backed out changeset 8a8c735fb984 (bug 1147736)
2015-05-13 14:15:57 -07:00
Jamin Liu
087773fdb5 Bug 1163969 - Reject the stopLeScan request only if there's no ongoing LE Scan using the given handle. r=joliu 2015-05-13 15:58:22 +08:00
Bruce Sun
b69b9fef3a Bug 1163912: Set |Type| property of BluetoothDevice a initial value during LeScan; f=elin, r=jocelyn 2015-05-13 15:50:21 +08:00
Ben Tian
8b891e378e Bug 1159179 - Patch 3/3: [PBAP] Implement PBAP manger, r=shuang 2015-05-13 10:52:58 +08:00
Ben Tian
5c00861a05 Bug 1159179 - Patch 2/3: [PBAP] Revise profile disconnection when BT stops, r=shuang 2015-05-13 16:29:50 +08:00
Carsten "Tomcat" Book
b507388890 merge mozilla-central to mozilla-inbound 2015-05-12 17:07:10 +02:00
Andrea Marchesini
615fe38d14 Bug 1163387 - Rename FileImpl to BlobImpl, r=ehsan 2015-05-12 13:11:03 +01:00
Andrea Marchesini
08c931dc57 Bug 1159401 - Split Blob and File classes, r=bz 2015-05-12 13:09:51 +01:00
Jocelyn Liu
4c405d81df Bug 1162910 - Make bluetooth daemon as the default backend of BT APIv2. r=tzimmermann 2015-05-11 03:44:00 -04:00
Bruce Sun
20b75796db Bug 1162893 - Fix BluetoothGattWriteType serialization problem. f=elin, r=jocelyn 2015-05-11 16:43:53 +08:00
Ben Tian
07e3a20b12 Bug 1159179 - Patch 1/3: [PBAP] Add OBEX related functions, r=shuang 2015-05-07 17:07:58 +08:00
Ben Hsu
3c1dcfe94c Bug 1147736 - Part 4: Deprecate NotifyError(Bluetooth). r=btian 2015-05-08 00:21:00 -04:00
Shawn Huang
6b9deb5ebb Bug 1160127 - Send HFP/A2DP profile disconnection notification, r=btian 2015-05-11 11:47:31 +08:00
Ben Tian
9924d3f585 Bug 1156503 - Update device name from |RemoteDevicePropertiesNotification| during discovery, r=shuang 2015-04-30 16:48:39 +08:00
Thomas Zimmermann
01405a19a7 Bug 1162585: Set socket flags after socket has been created, r=kmachulis
This patch moves the code for setting socket flags in the socket I/O
classes to the few locations were sockets are created. Any other socket
setup is redundant and has been removed.
2015-05-08 09:45:42 +02:00
Thomas Zimmermann
11aef2cf1c Bug 1162524: Move |accept| out of |UnixSocketWatcher|, r=kmachulis
Calls to |accept| are now handled by the corresponding socket I/O
class. This makes the code more flexible. All callers have been
adapted.
2015-05-08 09:43:01 +02:00
Carsten "Tomcat" Book
1d66282062 Backed out changeset 0098029a7bdd (bug 1147736) 2015-05-06 17:02:31 +02:00
Bruce Sun
f556ed7f7c Bug 1161939 - Correct bitwise checking on GATT characteristic write properties. r=jocelyn 2015-05-06 18:15:30 +08:00
Ben Hsu
64470de269 Bug 1147736 - Part 4: Deprecate NotifyError(Bluetooth). r=btian 2015-04-27 23:31:00 -04:00
Thomas Zimmermann
6dbc71922d Bug 1161003: Don't send PDU when connection to Bluetooth daemon is closed, r=shuang
During restarts of the Bluetooth daemon, it can occur that Gecko tries
to send without having a connection to bluetoothd opened. This patch adds
a check to prevent this.
2015-05-06 10:00:02 +02:00
Thomas Zimmermann
bf325d916b Bug 1159267: Share BlueZ's HFP manager between Bluetooth v1 and v2, r=btian
Both implementations mostly differ in coding style and correctness
fixes. The last remaining differences are related to different
interfaces in Bluetooth v1 and v2.
2015-05-06 09:58:04 +02:00
Thomas Zimmermann
b046a2aff6 Bug 1159267: Share Bluedroid's A2DP manager between Bluetooth v1 and v2, r=btian
Bluedroid's A2DP manager is the same for Bluetooth v1 and v2, except
fixes for bug 1062697 and bug 1148311 in v1. This patch merges both
variants. The last remaining difference is a call to |DistributeSignal|,
which differs between both implementations.
2015-05-06 09:58:04 +02:00
Thomas Zimmermann
02dfb0bf12 Bug 1159267: Share Bluedroid's HFP manager between Bluetooth v1 and v2, r=btian
The implementation of the Bluedroid HFP manager in Bluetoth v1 and v2
differs by a number of interface changes. This patch merges both variants
into a single one, were possible.
2015-05-06 09:58:04 +02:00
Thomas Zimmermann
77ad1b350f Bug 1159267: Share Bluedroid's OPP manager between Bluetooth v1 and v2, r=btian
Bluedroid's OPP manager is the same for Bluetooth v1 and v2; except
for bug 1118177, which is fixed in v1. So with this patch, the v1
implementation is used for both variants.
2015-05-06 09:58:04 +02:00
Wes Kocher
2d15cbc4c0 Backed out changeset ffad198d409b (bug 1161003) for b2g windows build bustage 2015-05-05 13:15:42 -07:00
Thomas Zimmermann
96afbdc7ec Bug 1161003: Don't send PDU when connection to Bluetooth daemon is closed, r=shuang
During restarts of the Bluetooth daemon, it can occur that Gecko tries
to send without having a connection to bluetoothd opened. This patch adds
a check to prevent this.
2015-05-05 17:02:43 +02:00
Carsten "Tomcat" Book
cc3a50cf79 Merge mozilla-central to b2g-inbound 2015-05-04 15:26:45 +02:00
Jamin Liu
a721ed32bd Bug 1063444 - Implement LE scan related methods and LE device event. r=joliu, r=mrbkap 2015-05-04 18:59:02 +08:00
Andrew McCreight
57f46c9d71 Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrew McCreight
c979f253c0 Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Jocelyn Liu
0645784a7e Bug 1159685 - Fix BluetoothSspVariant argument passing for SspRequestNotification. r=shuang 2015-04-30 01:04:00 -04:00
Jocelyn Liu
e9ac933144 Bug 1159650 - Remove incorrect value assertions in BluetoothGattCharacteristic and BluetoothGattDescriptor. r=btian 2015-04-29 19:53:00 -04:00
Bruce Sun
e249860bd1 Bug 1159552 - Clear local arrays while discovering. r=jocelyn 2015-04-30 14:41:08 +08:00
Shawn Huang
99f3383c74 Bug 1143925 - Restart bluetoothd daemon automatically for API V2. r=tzimmermann 2015-04-30 05:46:00 -04:00
Shawn Huang
180dc51f66 Bug 1143925 - Avoid crash for HFP/A2DP manager during restart daemon. r=tzimmermann 2015-04-30 05:14:00 -04:00
Shawn Huang
23f371696b Bug 1143925 - Restart bluetoothd daemon automatically for V1 API. r=tzimmermann 2015-04-30 05:13:00 -04:00
Thomas Zimmermann
f0efefb121 Bug 1159709: Cleanup inherited methods of BlueZ's |BluetoothSocket|, r=kmachulis
This patch cleans up the inherited methods of BlueZ's |BluetooothSocket|.
Methods of the same base class are grouped within the file, and each
method is labeled with 'override'.
2015-04-30 12:55:37 +02:00
Thomas Zimmermann
0668ec0afd Bug 1159709: Cleanup inherited methods of Bluedroid's |BluetoothSocket|, r=kmachulis
This patch cleans up the inherited methods of Bluedroid's
|BluetooothSocket|. Methods of the same base class are grouped
within the file, and each method is labeled with 'override'.
2015-04-30 12:55:37 +02:00
Thomas Zimmermann
a1f27cda16 Bug 1159709: Inherit |BluetoothDaemonConnection| from |DataSocket|, r=kmachulis
|BluetoothDaemonConnection| sends and receives data. With this patch
it inherits from |DataSocket|, which provides the respective abstract
interfaces.
2015-04-30 12:55:37 +02:00
Thomas Zimmermann
680ee86ba7 Bug 1158818: Only store Bluetooth result runnable after command has been sent successfully, r=shuang
With the current code, the Bluetooth result runnable is saved for
receiving before a command has been sent successfully. If sending
fails afterwards, the saved result runnable will still sit in the
result queue, and interfere with later, successful commands.

With this patch, the result runnable is saved only if the sending
was successful.
2015-04-30 11:29:25 +02:00
Thomas Zimmermann
9d654e96e7 Bug 1159209: Remove template parameters from |DataSocketIO|, r=kmachulis
This patch removes the template parameters from |DataSocketIO| and
moves its methods into the C++ source file. All users have been
adapted.
2015-04-29 11:19:28 +02:00