mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-26 09:37:33 +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();
|
||||
}
|
||||
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();
|
||||
|
@ -8,10 +8,16 @@ import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.unknown.UnknownDeviceSupport;
|
||||
|
||||
public class ScannableDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user