Refactoring: centralize GBDevice creation

- created and provided by DeviceHelper
- passed from UI to service
- without UI, service uses DeviceHelper directly

=> Cleaner and less duplicated code
This commit is contained in:
cpfeiffer
2015-12-13 00:43:07 +01:00
parent 7cf1e0e004
commit f258e62633
10 changed files with 123 additions and 99 deletions

View File

@@ -3,6 +3,7 @@ package nodomain.freeyourgadget.gadgetbridge.model;
import android.support.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.devices.EventHandler;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
/**
@@ -60,6 +61,8 @@ public interface DeviceService extends EventHandler {
void connect();
void connect(GBDevice device);
void connect(@Nullable String deviceAddress);
void connect(@Nullable String deviceAddress, boolean performPair);