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.
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.
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.
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.
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.
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.
ObexHeaderSet::GetTarget copies the data associated with the
ObexHeaderId::Target id into a newly-allocated buffer. All callers of
this function, however, fail to free the buffer once they are done with it.
Instead of simply freeing the buffer in the caller, however, let's add
an API to ObexHeaderSet that gives direct access to the desired header.
Doing this means that we have direct access to the data--no copying
necessary--and we also make the caller slightly faster, since it no
longer has to verify that the appropriate header is there, followed by
re-searching for the header it already knows is there.
This patch improves the Bluetooth signal API by adding methods for
dealing with UUIDs and addresses directly. Callers have been converted
where possible.