1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-16 05:37:51 +01:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service
cpfeiffer 50295864f5 Use a custom IntentListener callback instead of LocalBroadcastManager for ble profiles
The issue here is the following:

- we used intents in the generic BleProfile classes to notify about the results of e.g. certain read requests
- we used to send these results asynchronously via LocalBroadcastManager.sendBroadcast(), which always used the main thread for sending
- however, we noticed that reconnecting to devices sometimes failed because the results arrived too late and the next action in the BLE queue lacked the necessary information
- the fix was to use LocalBroadcastManager.setBroadcastSync(), so that the results arrive in time
- this unfortunately meant that they were not sent in the main thread anymore, and especially, this would send all pending intents that were previously queued via sendBroadcast() also in the "wrong" thread (in order to keep the order of events)

The fix is to use a custom IntentListener callback interface for synchronous notifications of ble profile results
*without* also causing other, previously queued intents to be sent.

Fixes #1218
2018-08-18 00:39:14 +02:00
..
btclassic Update license headers 2018-02-26 14:27:33 +01:00
btle Use a custom IntentListener callback instead of LocalBroadcastManager for ble profiles 2018-08-18 00:39:14 +02:00
devices Use a custom IntentListener callback instead of LocalBroadcastManager for ble profiles 2018-08-18 00:39:14 +02:00
receivers added time limited on auto-fetch, and removed the creation of multiple autoFetchReceivers 2018-07-01 22:57:48 +02:00
serial refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic 2018-03-31 16:21:25 +02:00
AbstractDeviceSupport.java Improve logging 2018-08-06 20:22:10 +02:00
DeviceCommunicationService.java Intercept alarm actions of the google clock application 2018-08-10 18:36:29 +02:00
DeviceSupport.java Update license headers 2018-02-26 14:27:33 +01:00
DeviceSupportFactory.java Watch 9: Initial support 2018-08-06 18:30:38 +02:00
NotificationCollectorMonitorService.java Update license headers 2018-02-26 14:27:33 +01:00
ServiceDeviceSupport.java refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic 2018-03-31 16:21:25 +02:00