2024-03-28 22:07:05 +01:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices.scannable;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
2024-03-30 10:02:18 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
2024-03-28 22:07:05 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
2024-03-28 22:58:30 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.unknown.UnknownDeviceSupport;
|
2024-03-28 22:07:05 +01:00
|
|
|
|
|
|
|
public class ScannableDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
2024-03-30 10:02:18 +01:00
|
|
|
@Override
|
|
|
|
public boolean supports(GBDeviceCandidate candidate) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2024-03-28 22:07:05 +01:00
|
|
|
@Override
|
|
|
|
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-28 22:58:30 +01:00
|
|
|
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
2024-03-28 22:07:05 +01:00
|
|
|
return new int[]{
|
|
|
|
R.xml.devicesettings_scannable
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isConnectable() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getManufacturer() {
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
@Override
|
|
|
|
public Class<? extends DeviceSupport> getDeviceSupportClass() {
|
2024-03-28 22:58:30 +01:00
|
|
|
return UnknownDeviceSupport.class;
|
2024-03-28 22:07:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDeviceNameResource() {
|
|
|
|
return R.string.devicetype_scannable;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getBatteryCount() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDefaultIconResource() {
|
|
|
|
return R.drawable.ic_device_scannable;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDisabledIconResource() {
|
|
|
|
return R.drawable.ic_device_scannable_disabled;
|
|
|
|
}
|
|
|
|
}
|