Post callback to main thread to execute. In general we should avoid
running app's callback method from binder thread as the callback method
may block.
Also removed callback from advertisers on stop advertising callback.
This fixes the issue of not being able to restart adv for limited
advertising.
Bug: 17045567
Change-Id: I56cd2bdf4b1ad120a0358fa4065ad77be4bff144
Root cause of the issue:
Client registeration was done on caller's thread, while
onClientRegistered was called from binder thread. There is a slight
chance that onClientRegistered was called before registerClient
returned, causing a premature notifyAll before wait was called.
By forcing acquiring the same lock now it's guaranteed wait would
happen before onClientRegistered callback was executed.
Bug: 16707401
Change-Id: Ic60adec475085741d14ecd2d2bb462246f88da58
Fixes b/16528460
This allows Advertiser and Scanner to be reused after bluetooth recycle,
which follows same behavior for BluetoothAdapter.
Also prints manufacturer data array for ScanRecord.
Change-Id: I78bca40ac294433782a054bf2a00a775dac02d96
When a descriptor read/write operation fails with insufficient
authentication/encryption, it will automatically be tried again with
elevated security requirements. The first (failed) attempt should not be
reported to the application requesting the read/write, since it will get
the 2nd callback once the retry succeeds/fails.
Change-Id: Ia27b91afa63b6f9ffdc597d59c24d29f3d8a1008
Also removed different scan methods from IBluetoothGatt and make
BluetoothLeScanner and BluetoothLEAdvertiser singleton.
Change-Id: Ifa2e950b50f100f5507a6dace3bd70db18d7f9ca
Changed include:
1) Add serviceDataUuid to filter so it matches sanRecord and
AdvertiseData.
2) Add raw bytes to ScanRecord and make ScanResult take a ScanRecord
instead of raw bytes.
3) Change from setServiceUuid(List) to addServiceUuid(ParcelUuid).
4) Added include device name
5) Removed service not registered and added ADVERTISE_DATA_TOO_LARGE.
6) Fixed a few comments.
Change-Id: Ibbe07183b1293835c4a84728d1cd2d61e5d627d3
This change introduces two new callbacks for applications to better
handle LE notification flow control and transport congestion. The
notification callback is invoked when the remote platform confirms an
indication or when a local notification has been passed to the
controller. No new notifications should be sent until a callback is
received.
Congestion callbacks are triggered when a GATT operation cannot be sent
to the local Bluetooth controller. Repeatedly calling
writeCharacteristic() for example will eventually trigger a congestion
callback. Applications cannot send additional data until a further
callback is received, indicating that the congestion has cleared up.
Also made server callbacks "oneway" in the AIDL definition file.
Change-Id: I7fa3324712205c79efce58e5e3df8b80a265a442
When there's more than one characteristic with the same UUID in
a service, the descriptors for the non-zero instanceID characteristics
were being assigned to the zero instanceID one, so descriptor
fetching wouldn't work. This is particularly bad for HID devices
since separate reports would show up as multiple characteristics
with the same UUID but there'd be no way to identify them
without their descriptor attributes.
Change-Id: I92bb4be34aa941dd3c6750874bef2e8a261ded92
Signed-off-by: Mike J. Chen <mjchen@google.com>