mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
DeviceCommunicationService: Notify device connections right away
As noted in #3676, having a lot of bluetooth classic devices might make the connection take some time, which would only send all the updates at the end. Send the updates right away for each device.
This commit is contained in:
parent
7fb0d19374
commit
9b285f16bf
@ -585,8 +585,6 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
return;
|
||||
}
|
||||
|
||||
final List<DeviceStruct> shouldGetNotifiedOfUpdate = new ArrayList<>();
|
||||
|
||||
for (GBDevice gbDevice : gbDevs) {
|
||||
if (!gbDevice.getDeviceCoordinator().isConnectable()) {
|
||||
// we cannot connect to beacons, skip this device
|
||||
@ -631,8 +629,6 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
}
|
||||
}
|
||||
|
||||
shouldGetNotifiedOfUpdate.add(registeredStruct);
|
||||
|
||||
try {
|
||||
final DeviceSupport deviceSupport = mFactory.createDeviceSupport(gbDevice);
|
||||
|
||||
@ -652,10 +648,8 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
} catch (Exception e) {
|
||||
GB.toast(this, getString(R.string.cannot_connect, e.getMessage()), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
for (final DeviceStruct struct : shouldGetNotifiedOfUpdate) {
|
||||
struct.getDevice().sendDeviceUpdateIntent(this);
|
||||
registeredStruct.getDevice().sendDeviceUpdateIntent(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user