Skip to content

Testing a proof-of-concept fix for the duplicate GATT service issue. - #36

Open
alwentiu wants to merge 1 commit into
AU-COVIDSafe:heraldfrom
alwentiu:herald
Open

Testing a proof-of-concept fix for the duplicate GATT service issue.#36
alwentiu wants to merge 1 commit into
AU-COVIDSafe:heraldfrom
alwentiu:herald

Conversation

@alwentiu

Copy link
Copy Markdown

This is related to Issue #33 (duplicate GATT service registered). I think there are two separate issues:

  • bluetoothGattServer in AdvertLoopTask is not closed properly when bluetooth adapter is powered off. It seems that in some phone models, the GATT server is not automatically closed when bluetooth is powered off. This was consistently observed in Samsung phones.
  • multiple SensorArray objects are created, in BluetoothMonitoringService, when bluetooth is powered off and on. This leads to a new instance of ConcreteBLETransmitter being created each time bluetooth is powered off/on.

The modifications I did:

  • In ConcreteBLETransmitter.kt, make sure services are cleard and GATT server closed (if it exists)
  • In BluetoothMonitoringService.kt, make sure no duplicate SensorArray objects are created.

DISCLAIMER: This modification is meant to demonstrate a diagnosis of the root cause of the issue; it is not meant as a definitive fix. Further tests will be required.

- In ConcreteBLETransmitter.kt, make sure services are cleard and GATT server closed (if it exists)
- In BluetoothMonitoringService.kt, make sure no duplicate SensorArray objects are created.

DISCLAIMER: This modification is meant to demonstrate a diagnosis of the root cause of the issue; it is not meant as a definitive fix.
@jimmo

jimmo commented Dec 18, 2020

Copy link
Copy Markdown

This fix looks good, but I think there might still be one extra step required to solve the duplicate RPAs.
Please see this comment -- theheraldproject/herald-for-android#107 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants