Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
In order to diagnose this I think we will need more information.
Can you clarify if this happens for a new Native C++ project without any changes to it? Would it be possible for you to share an Android Studio project where you see this issue?
Can you please also share the log files as requested in the instructions in
jo...@cisco.com <jo...@cisco.com> #3
vi...@google.com <vi...@google.com> #4
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
Description
We have an application which read characteristics for BLE peripherals which advertise a specific service ID. This service ID changes often. Scanning, connection, service discovery, and characteristic reading all work fine when the peripheral and central are not bonded. However, the list of BLE services seems to be cached/stale once bonded even after initiating service discovery and reading the latest services.
Once bonded, the sequence of events is:
<newServiceUuid>
<newServiceUuid>
onConnectionStateChange
called with successonServicesDiscovered
calledgetService(UUID.fromString(newServiceId)
returns nullservices
on the gatt object are services which are no longer advertised / were discovered during the first discovery attempt after bonding.It appears the onServiceChanged callback is not called either.
The stales service list seems to persist indefinitely until the devices are un-bonded, or we manually call
BluetoothGatt::refresh
via reflection. App/device restarts don't make any difference.Since the
refresh()
method onBluetoothGatt
resolves our issue, we're requesting that this method be made public so our application can call it without using reflection. Or please provide guidance as to how we should achieve this behavior otherwise.I found another filed issue that seems similar, but not exactly identical - https://issuetracker.google.com/issues/242755161 . We're able to find the
BluetoothDevice
in our case, just not fetch the service after service discovery (even though we searched for the device using a ScanFilter with the same service id).