Consent pairing event raises under the following conditions:
1. Local IO capabilities are DisplayYesNo and remote IO capabiltiies are DisplayOnly or NoInputNoOutput.
2. Call PairingConsent callback for "incoming" request.
This patch is try to directly reply pairing confirmation for consent cases.
How to test:
1. Initialize pairing request with IO capabilities-NoInputNoOutput as
headset role to b2g phone
2. Check pairing status of bluetooth headset
This patch removes the constant BLUEZ_DBUS_BASE_IFC from the file
RawDBusconnection.cpp. The constant is specific to BlueZ, and that's
where it's located now.
With this patch, the listen operation for Bluedroid sockets
runs on the I/O thread. The related interface is identical to
the one of |UnixSocketConsumer|.
With this patch, the connect operation for Bluedroid sockets
runs on the I/O thread. The related interface is identical to
the one of |UnixSocketConsumer|.
|sControllerArray| is only being used on the main thread, but
cleared on the I/O thread. During the BlueZ shutdown, we go
through the main thread, where we can clear |sControllerArray|;
moving the variable to main thread exclusively.
|sAdapterPath| is being accessed from within the main and the
I/O thread in a possible non-thread-safe way. This patch moves
all access to the I/O thread.
This patch prepares moving |sAdapterAdded| to the I/O thread. For
|GetServiceChannel| it gets pushed into task classes on the I/O
thread and the interface of these classes is cleaned up.
|sAuthorizedServiceClass| is being set on the main thread, but read
from within the I/O thread. Making the variable a static constant
array and moving all access to the I/O thread fixes potential race
conditions.
This patch was mostly generated with the following command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e '/WrapObject(JSContext/ {; N; s/\(WrapObject(JSContext *\* *a\{0,1\}[Cc]x\),\n\{0,1\} *JS::Handle<JSObject\*> a\{0,1\}[sS]cope/\1/ ; }' -i ""
and then reverting the changes that made to
dom/bindings/BindingUtils.h, since those WrapObject methods are not
the ones we're trying to change here, plus a bunch of manual fixups
for cases that this command did not catch (including all the callsites
of WrapObject()).
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
This patch adds an annotation to each assertion for non-main threads in
the BlueZ backend of Bluetooth. This should make is easy and obvious to
see in which context a method or function is expected to run.
The global variables in BluetoothDBusService.cpp are now annotated
for their multi-threading access. Some code still seems to access
some of these variables in an unprotected manner. Follow-up patches
should clean this up.
As a side effect, this patch makes several variables as constant,
which improves correctness of the code.
Until now, we had corner cases in Bluetooth where DBus messages might
have been received on connections that are shutting down. This can't
happen any longer and this patch replaces the respective tests with
assertions.
With this patch, the start code of Bluetooth's BlueZ back mostly
runs on the I/O thread. Only the loading of the BT firmware and
the blocking connection setup is done on the BT thread.
The stop code has been moved to the I/O thread, except for some
initial waiting and the final cleanup of the firmware. The code
doesn't wait for errors anymore when cleaning up the connection
to DBus. This makes it run completely non-blocking. The initial
waiting may later be replaced by something more sophisticated.