From 46acb7681e9aec80d49c3c1a64fc0030d7171bec Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Sun, 26 Dec 2021 14:48:32 +0100 Subject: [PATCH] multi-device: only target connected devices --- .../gadgetbridge/service/DeviceCommunicationService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java index 42b1932d4..9ed27fea4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java @@ -512,7 +512,11 @@ public class DeviceCommunicationService extends Service implements SharedPrefere if(targetedDevice != null){ targetedDevices.add(targetedDevice); }else{ - targetedDevices.addAll(Arrays.asList(getGBDevices())); + for(GBDevice device : getGBDevices()){ + if(isDeviceInitialized(device)){ + targetedDevices.add(device); + } + } } for (GBDevice device1 : targetedDevices) { try {