1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-08-25 00:30:37 +02:00

add supportNavigation() to cooridinator

This commit is contained in:
Andreas Shimokawa 2021-11-18 13:36:57 +01:00
parent e7c048551f
commit 9ccd898d42
4 changed files with 11 additions and 1 deletions

View File

@ -386,4 +386,8 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
HeartRateCapability.MeasurementInterval.HOUR_1
);
}
public boolean supportsNavigation(GBDevice gbDevice) {
return false;
}
}

View File

@ -480,4 +480,6 @@ public interface DeviceCoordinator {
PasswordCapabilityImpl.Mode getPasswordCapability();
List<HeartRateCapability.MeasurementInterval> getHeartRateMeasurementIntervals();
boolean supportsNavigation(GBDevice mGBDevice);
}

View File

@ -149,6 +149,10 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
return 8;
}
public boolean supportsNavigation(GBDevice gbDevice) {
return true;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) {
// nothing to delete, yet

View File

@ -1238,7 +1238,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
registerReceiver(mAlarmClockReceiver, filter);
}
if (mOsmandAidlHelper == null) {
if (mOsmandAidlHelper == null && coordinator != null && coordinator.supportsNavigation(mGBDevice)) {
mOsmandAidlHelper = new OsmandEventReceiver(this.getApplication());
}