Experiencing a very odd issue with Android BLE on a pixel device.
Consider 2 separate applications (a typical app w/ a UI and an android background service with minimal UI). Both of these applications have a BLE library dependency, which is the BLE sdk I've written. This SDK contains 2 separate classes for connecting to 2 different types of devices (meaning I have 2 distinct classes that implement the BluetoothGattCallback interface).
All is fine and well, I can connect to each type of device from each respective application. HOWEVER, calling a gatt.disconnect in application A on device A not only disconnects device A, it is disconnecting device B (where the connection was established in application B).
I'm also explicitly verifying that each gatt is associated to only a single particular device (can see mDevice association in logs), and each gatt also has a different hash code indicating different instances of the gatt object across applications.
I guess I'm at a loss that the android OS seems to be causing the additional disconnect incorrectly. I can also verify that each device is registered on its own client interface via the callback logs that occur during the connect.
How does the android OS handle the fact that this library is included in 2 applications? I'm assuming that each app has its own "instance" of the library running in isolation.
Has anyone experienced this kind of issue (gatt.disconnect disconnects more than 1 device)?
from Android BLE gatt.disconnect disconnects a second device
No comments:
Post a Comment