diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java index 4f2883944..4ae5a37a7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java @@ -16,8 +16,12 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + +import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; @@ -26,9 +30,15 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; +import nodomain.freeyourgadget.gadgetbridge.model.ItemWithDetails; +import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService; +import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport; +import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper; public class QHybridCoordinator extends AbstractDeviceCoordinator { + + @NonNull @Override public DeviceType getSupportedType(GBDeviceCandidate candidate) { @@ -61,7 +71,7 @@ public class QHybridCoordinator extends AbstractDeviceCoordinator { @Override public boolean supportsActivityDataFetching() { - return false; + return true; } @Override @@ -112,12 +122,12 @@ public class QHybridCoordinator extends AbstractDeviceCoordinator { @Override public boolean supportsAppsManagement() { - return false; + return true; } @Override public Class getAppsManagementActivity() { - return null; + return ConfigActivity.class; } @Override @@ -137,7 +147,15 @@ public class QHybridCoordinator extends AbstractDeviceCoordinator { @Override public boolean supportsFindDevice() { - return true; + GBDevice connectedDevice = GBApplication.app().getDeviceManager().getSelectedDevice(); + if(connectedDevice == null || connectedDevice.getType() != DeviceType.FOSSILQHYBRID){ + return true; + } + ItemWithDetails vibration = connectedDevice.getDeviceInfo(QHybridSupport.ITEM_EXTENDED_VIBRATION_SUPPORT); + if(vibration == null){ + return true; + } + return vibration.getDetails().equals("true"); } @Override