Commit Graph

1788 Commits

Author SHA1 Message Date
Birunthan Mohanathas
52ec90b7f0 Bug 1235261 - Part 6: Rename AutoInfallibleTArray to AutoTArray. r=froydnj 2016-02-02 17:36:31 +02:00
Birunthan Mohanathas
9bed3781f9 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Nicholas Nethercote
9fb39bea5f Bug 1187151 (part 16) - Replace nsBaseHashtable::Enumerate() calls in dom/ with iterators. r=mccr8. 2016-01-28 14:38:38 -08:00
Phil Ringnalda
863943dfb7 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
f84f90b705 Bug 1235261 - Part 6: Rename AutoInfallibleTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Birunthan Mohanathas
f94b4ff6a2 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Kyle Huey
94f653c385 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Xidorn Quan
7f63ffdc57 Bug 1241901 part 2 - Use intptr_t to pass bluetooth service class instead of a pointer to heap. r=shawnjohnjr 2016-01-30 10:33:41 +11:00
Bill McCloskey
8916b1d998 Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
Jocelyn Liu
23b6b691dc Bug 1238825: Add "dom.bluetooth.webbluetooth.enabled" preference for WebBluetooth API development. r=btian, r=bz 2016-01-25 14:35:18 +08:00
Ben Tian
c4cd7394d4 Bug 1241382 - Revise default value of BluetoothAdapter.address and BluetoothDevice.address to empty string, f=wiwang, r=shuang 2016-01-22 14:34:25 +08:00
Carsten "Tomcat" Book
afa01d3dbf Merge mozilla-central to b2g-inbound 2016-01-21 12:30:56 +01:00
Thomas Zimmermann
31360028c5 Bug 1239979: Get pointers to Bluetooth managers during each shutdown, r=shuang
|BluetoothServiceBluedroid::StopInternal| stores pointers to Bluetooth
managers in a static array. This is only filled on the first call, but
pointers change when re-enabling Bluetooth.

This patch changes the code to use a non-static array, so pointers to
Bluetooth managers are looked-up on each call to the method.
2016-01-21 12:30:00 +01:00
Thomas Zimmermann
ad3eac5055 Bug 1239979: Cleanup |BluetoothSocket|'s internals when connections close, r=btian
With this patch, |BluetoothSocket| cleans up its internal state
whenever a connection gets closed, either intentionally or from
an error. The socket can then be reused for a new connection.

If we try to destruct an open Bluetooth socket, we'd probably
leak the file descriptor or transition into an undefined state.
The destructor now asserts that the socket is closed.
2016-01-21 12:30:00 +01:00
Thomas Zimmermann
d5d7703124 Bug 1239979: Store pointer to Bluetooth socket interface in |BluetoothSocket|, r=btian
|BluetoothSocket| currently stores the pointer to the socket interface
in a global static location. This pointer can become invalid if the
Bluetooth module get's disabled. Enabling Bluetooth again and calling
the socket interface would execute on undefined state. The current
implementation of the Bluedroid backend keeps the interface pointers
valid, so this problem doesn't happen in practice. It's still a bug,
though.

This patch changes |BluetoothSocket| to store the socket-interface
pointer internally. So it will acquire a new pointer for each socket.
2016-01-21 12:30:00 +01:00
Thomas Zimmermann
2f8ed4b678 Bug 1239979: Add |BluetoothSocket::Accept| method, r=btian
The new method |Accept| of |BluetoothSocket| encapsulates the code
for accepting from a passive socket. Having this method will allow
for storing the socket interface in |BluetoothSocket| itself.
2016-01-21 12:30:00 +01:00
Thomas Zimmermann
20b80f2d34 Bug 1239979: Close sockets when deinitializing Bluetooth profile managers, r=btian 2016-01-21 12:30:00 +01:00
Thomas Zimmermann
be31332dd7 Bug 1239979: Uninitialized Bluetooth profile managers explictly to release refs, r=shuang
The current Bluetooth profile managers remove themselves from a number
of observer lists in their destructors. But |nsIObserverService| keeps
it's own reference to the managers, so the destructors never run. Con-
sequently the Bluetooth module nevers cleans up correctly.

This patch adds an explicit uninit method to each profile manager. It
removes the manager from the observer lists.
2016-01-21 12:30:00 +01:00
Thomas Zimmermann
7a5255184b Bug 1239979: Init and uninit all Bluetooth profile managers, r=shuang
The use is init and deinit methods is currently inconsistent among
Bluetooth profile managers. This patch unifies all these methods and
integrates them into the Bluetooth service. Instances of the manager
classes are now unref'ed during Bluetooth shutdown.
2016-01-21 12:30:00 +01:00
Chris Lord
80a56dbdd0 Bug 1241117 - Fix mAppUuid access before assign in BluetoothGatt::Connect. r=joliu 2016-01-20 14:37:02 +00:00
Jocelyn Liu
4446c2ef5a Bug 1228546 - Implement peripheral mode support for GATT API. r=brsun, r=mrbkap 2016-01-15 09:50:54 +08:00
Thomas Zimmermann
c17fb051b9 Bug 1238991: Don't connect Bluetooth OPP manager before service channel is known, r=btian
The Bluetooth Opp manager requires the service channel of the remote
service to connect successfully. If the service channel isn't known,
it sends an SDP update request to get the value from the remote device.

The current code will still try to connect with an invalid service
channel. This patch fixes the issue by returning early after sending
the SDP update request.
2016-01-14 14:55:49 +01:00
Carsten "Tomcat" Book
0506fad16e merge mozilla-inbound to mozilla-central a=merge 2016-01-13 11:57:15 +01:00
Carsten "Tomcat" Book
659342fcae Merge mozilla-central to b2g-inbound 2016-01-12 11:58:12 +01:00
Carsten "Tomcat" Book
5ddb3f6b57 merge mozilla-inbound to mozilla-central a=merge 2016-01-12 11:54:38 +01:00
Ben Tian
77c98a6c24 Bug 1234974 - Handle null GetOwner() in |BluetoothAdapter::IsBluetoothCertifiedApp|, r=shuang 2016-01-12 15:53:59 +08:00
Ben Tian
c64fe64c8a Bug 1229697 - Cancel bond when user inputs empty pincode for pairing, r=shuang 2016-01-11 16:47:20 +08:00
Nathan Froyd
b20ff9fa3e Bug 1236561 - part 3 - make BluetoothConfigurationParameter.mValue a UniquePtr; r=btian 2015-12-06 10:41:42 -05:00
Nathan Froyd
4a4e2a5363 Bug 1236561 - part 2 - remove ObexHeaderSet::GetAuthChallenge; r=btian
We don't need to copy data in this case, and making this change enables
us to remove this use of nsAutoArrayPtr.
2015-12-06 10:28:04 -05:00
Nathan Froyd
3c8e039985 Bug 1236561 - part 1 - convert easy cases of nsAutoArrayPtr<T> to UniquePtr<T[]> in dom/bluetooth/; r=btian 2015-12-06 10:23:59 -05:00
Bruce Sun
a83e62cc4c Bug 1236724: Check the maximum length of each array in IPC; f=jhector, r=btian 2016-01-06 11:30:39 +08:00
Thomas Zimmermann
e3d12cccce Bug 1223722: Transfer arrays of Bluetooth UUIDs in |BluetoothValue|, r=brsun
Bluetooth's UUID arrays are sorted and stripped from duplicates. This code is
now executed in the client process. This reduces the amount of privilegued
code and accounts the required computation time to the process that actually
uses it.

The change also makes the IPDL interface a bit less fragile, as the client
does not expect sorted arrays from the chrome process. It's a detail of the
client's implementation that manifested itself in the interface.
2016-01-05 12:01:33 +01:00
Thomas Zimmermann
304d3cf3ed Bug 1223722: Transfer Bluetooth remote names in |BluetoothValue|, r=brsun 2016-01-05 12:01:33 +01:00
Thomas Zimmermann
479cd9d27d Bug 1223722: Transfer Bluetooth addresses in |BluetoothValue|, r=brsun 2016-01-05 12:01:33 +01:00
Thomas Zimmermann
3aa03c1a73 Bug 1232687: Start bluetoothd with HAL service interface, r=shuang
This patch replaces Bluetooth's internal implmentation for starting
bluetoothd with the portable one provided by the HAL module. Gonk-
specific workarounds are preserved within HAL.
2016-01-04 16:08:21 +01:00
Bruce Sun
b30f7f717c Bug 1234127: Change |BluetoothAdapter.pairingReqs| as a nullable object; r=btian, r=mrbkap 2015-12-21 16:48:47 +08:00
Tom Tung
06c4d46a6d Bug 1232941 - Register Observer and listen to NS_XPCOM_SHUTDOWN_OBSERVER_ID for GATT, r=shuang 2015-12-17 09:36:43 +08:00
Thomas Zimmermann
81084d7a4e Bug 1232670: Prepare Bluetooth PDU for sending after checking connection status, r=shuang
The PDU contains a pointer to the operation's result handler. If sending
fails, the result handler is supposed to handle an error. But the PDU
will go out of scope first and release the handler. The error delivery
then fails with a segmentation fault.
2015-12-16 13:27:47 +01:00
Ben Tian
229e8200e1 Bug 1230066 - Add missing STATUS_AUTH_REJECTED into enum BluetoothStatus,r=tzimmermann 2015-12-03 18:25:03 +08:00
Louis_Chang
b2a2023a68 Bug 1217778 - Ensure sBluetoothGattService is not null before accessing GattInterface in GattManager. r=jocelyn 2015-12-02 09:31:45 +08:00
Wes Kocher
630a557841 Merge inbound to central, a=merge 2015-12-01 15:43:33 -08:00
Jocelyn Liu
48a37281e6 Bug 1229290 - Pack/unpack UUIDs in a reverse order when adding characteristics and descriptors in GATT server API. r=brsun 2015-12-01 18:54:55 +08:00
Shawn Huang
a513a61d4f Bug 1186840 - [MAP] Implement MessageUpdate function, r=btian 2015-12-01 15:55:41 +08:00
Ben Tian
2f0ce4487f Bug 1228471 - use Endian.h to write filename and handleId into OBEX packet, r=shuang 2015-12-01 10:36:43 +08:00
Jocelyn Liu
463e5a355d Bug 1228519 - Fix RequestReadNotification for GATT Server API. r=brsun 2015-11-30 20:24:07 +08:00
Jocelyn Liu
95b7d3e033 Bug 1228521 - Fix PDU packing in |ServerSendResponseCmd| for GATT Server API. r=brsun 2015-11-30 20:23:04 +08:00
Jocelyn Liu
cda2b07179 Bug 1228909 - Fix PDU packing in |ClientSetAdvDataCmd| for GATT API. r=brsun 2015-11-30 20:21:52 +08:00
Thomas Zimmermann
c2bd52a594 Bug 1228946: Remove '#if 0' block from Bluetooth module, r=joliu
This is a cleanup patch for removing an '#if 0' that was landed in
the Bluetooth code.
2015-11-30 12:46:09 +01:00
Ben Tian
b99794a59f Bug 1228479 - Remove redundant blob handling in BluetoothMapRequestHandle::ReplyToFolderListing, r=shuang 2015-11-27 14:03:03 +08:00
Ben Tian
d77d11887e Bug 1227440 - Reject pin reply by cancelling bond to trigger BondStateChangedNotification, in order to inform gaia setting app, r=shuang 2015-11-26 16:31:42 +08:00