mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-27 10:07:32 +01:00
Fix crash during discovery
This commit is contained in:
parent
81aef0bf35
commit
904007614d
@ -104,7 +104,8 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
|||||||
supportedDeviceName = getSupportedDeviceName();
|
supportedDeviceName = getSupportedDeviceName();
|
||||||
}
|
}
|
||||||
if (supportedDeviceName == null) {
|
if (supportedDeviceName == null) {
|
||||||
throw new RuntimeException(getClass() + " should either override getSupportedDeviceName or supports(GBDeviceCandidate)");
|
LOG.error(getClass() + " should either override getSupportedDeviceName or supports(GBDeviceCandidate)");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return supportedDeviceName.matcher(candidate.getName()).matches();
|
return supportedDeviceName.matcher(candidate.getName()).matches();
|
||||||
|
@ -8,10 +8,16 @@ import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.unknown.UnknownDeviceSupport;
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.unknown.UnknownDeviceSupport;
|
||||||
|
|
||||||
public class ScannableDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
public class ScannableDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||||
|
@Override
|
||||||
|
public boolean supports(GBDeviceCandidate candidate) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user