1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 11:35:48 +01:00

Send results of AbstractBleProfile synchronously

This should fix issues like a ConditionalWriteAction failing with an NPE when GBDevice.getFirmwareVersion() returns null even though the DeviceInfoProfile had already received the firmware version (but the intent notification has not been received yet).
This commit is contained in:
cpfeiffer 2018-08-06 20:51:28 +02:00
parent ec0d62f67b
commit cc3c70b161

View File

@ -53,7 +53,9 @@ public abstract class AbstractBleProfile<T extends AbstractBTLEDeviceSupport> ex
* @param intent the intent to broadcast
*/
protected void notify(Intent intent) {
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
// note: we send synchronously in order to keep the processing order of BLE events
// in BtleQueue and the reception of results.
LocalBroadcastManager.getInstance(getContext()).sendBroadcastSync(intent);
}
/**