mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-03 17:02:13 +01:00
Add more granular smart wakeup support
Specifically: - Add position to smart wakeup support coordinator function - Add interface to stop smart alarm checkbox from being changed
This commit is contained in:
parent
01ef422812
commit
89b6ae9f24
@ -126,8 +126,10 @@ public class AlarmDetails extends AbstractGBActivity {
|
|||||||
timePicker.setCurrentMinute(alarm.getMinute());
|
timePicker.setCurrentMinute(alarm.getMinute());
|
||||||
|
|
||||||
cbSmartWakeup.setChecked(alarm.getSmartWakeup());
|
cbSmartWakeup.setChecked(alarm.getSmartWakeup());
|
||||||
int smartAlarmVisibility = supportsSmartWakeup() ? View.VISIBLE : View.GONE;
|
int smartAlarmVisibility = supportsSmartWakeup(alarm.getPosition()) ? View.VISIBLE : View.GONE;
|
||||||
cbSmartWakeup.setVisibility(smartAlarmVisibility);
|
cbSmartWakeup.setVisibility(smartAlarmVisibility);
|
||||||
|
boolean smartAlarmEnabled = !forcedSmartWakeup(alarm.getPosition());
|
||||||
|
cbSmartWakeup.setEnabled(smartAlarmEnabled);
|
||||||
|
|
||||||
cbSnooze.setChecked(alarm.getSnooze());
|
cbSnooze.setChecked(alarm.getSnooze());
|
||||||
int snoozeVisibility = supportsSnoozing() ? View.VISIBLE : View.GONE;
|
int snoozeVisibility = supportsSnoozing() ? View.VISIBLE : View.GONE;
|
||||||
@ -153,10 +155,21 @@ public class AlarmDetails extends AbstractGBActivity {
|
|||||||
cbSunday.setChecked(alarm.getRepetition(Alarm.ALARM_SUN));
|
cbSunday.setChecked(alarm.getRepetition(Alarm.ALARM_SUN));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean supportsSmartWakeup() {
|
private boolean supportsSmartWakeup(int position) {
|
||||||
if (device != null) {
|
if (device != null) {
|
||||||
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||||
return coordinator.supportsSmartWakeup(device);
|
return coordinator.supportsSmartWakeup(device, position);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The alarm at this position *must* be a smart alarm
|
||||||
|
*/
|
||||||
|
private boolean forcedSmartWakeup(int position) {
|
||||||
|
if (device != null) {
|
||||||
|
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||||
|
return coordinator.forcedSmartWakeup(device, position);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -210,7 +223,7 @@ public class AlarmDetails extends AbstractGBActivity {
|
|||||||
alarm.setUnused(false);
|
alarm.setUnused(false);
|
||||||
alarm.setEnabled(true);
|
alarm.setEnabled(true);
|
||||||
}
|
}
|
||||||
alarm.setSmartWakeup(supportsSmartWakeup() && cbSmartWakeup.isChecked());
|
alarm.setSmartWakeup(supportsSmartWakeup(alarm.getPosition()) && cbSmartWakeup.isChecked());
|
||||||
alarm.setSnooze(supportsSnoozing() && cbSnooze.isChecked());
|
alarm.setSnooze(supportsSnoozing() && cbSnooze.isChecked());
|
||||||
int repetitionMask = AlarmUtils.createRepetitionMask(cbMonday.isChecked(), cbTuesday.isChecked(), cbWednesday.isChecked(), cbThursday.isChecked(), cbFriday.isChecked(), cbSaturday.isChecked(), cbSunday.isChecked());
|
int repetitionMask = AlarmUtils.createRepetitionMask(cbMonday.isChecked(), cbTuesday.isChecked(), cbWednesday.isChecked(), cbThursday.isChecked(), cbFriday.isChecked(), cbSaturday.isChecked(), cbSunday.isChecked());
|
||||||
alarm.setRepetition(repetitionMask);
|
alarm.setRepetition(repetitionMask);
|
||||||
|
@ -319,7 +319,12 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(final GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,10 +332,17 @@ public interface DeviceCoordinator {
|
|||||||
int getAlarmSlotCount(GBDevice device);
|
int getAlarmSlotCount(GBDevice device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this device/coordinator supports alarms with smart wakeup
|
* Returns true if this device/coordinator supports an alarm with smart wakeup for the current position
|
||||||
* @return
|
* @param alarmPosition Position of the alarm
|
||||||
*/
|
*/
|
||||||
boolean supportsSmartWakeup(GBDevice device);
|
boolean supportsSmartWakeup(GBDevice device, int alarmPosition);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the alarm at the specified position *must* be a smart alarm for this device/coordinator
|
||||||
|
* @param alarmPosition Position of the alarm
|
||||||
|
* @return True if it must be a smart alarm, false otherwise
|
||||||
|
*/
|
||||||
|
boolean forcedSmartWakeup(GBDevice device, int alarmPosition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this device/coordinator supports alarm snoozing
|
* Returns true if this device/coordinator supports alarm snoozing
|
||||||
|
@ -151,11 +151,6 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -156,11 +156,6 @@ public class AsteroidOSDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -112,11 +112,6 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -118,11 +118,6 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -111,11 +111,6 @@ public class CasioGB6900DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
return 5; // 4 regular and one snooze
|
return 5; // 4 regular and one snooze
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -142,11 +142,6 @@ public class CasioGBX100DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -115,11 +115,6 @@ public class CasioGWB5600DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsAppsManagement(final GBDevice device) {
|
public boolean supportsAppsManagement(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -80,11 +80,6 @@ public class DomyosT540Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -105,11 +105,6 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -90,11 +90,6 @@ public class FlipperZeroCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getManufacturer() {
|
public String getManufacturer() {
|
||||||
return "Flipper devices";
|
return "Flipper devices";
|
||||||
|
@ -80,11 +80,6 @@ public abstract class GalaxyBudsGenericCoordinator extends AbstractBLClassicDevi
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -136,11 +136,6 @@ public class HPlusCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3; // FIXME - check the real value
|
return 3; // FIXME - check the real value
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -53,7 +53,7 @@ public class SG2Coordinator extends HPlusCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,11 +525,6 @@ public abstract class HuamiCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsFindDevice() {
|
public boolean supportsFindDevice() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -307,7 +307,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(final GBDevice device) {
|
public boolean supportsSmartWakeup(final GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,13 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return huaweiCoordinator.supportsSmartAlarm(device);
|
return huaweiCoordinator.supportsSmartAlarm(device, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
|
return huaweiCoordinator.forcedSmartWakeup(device, alarmPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -308,10 +308,19 @@ public class HuaweiCoordinator {
|
|||||||
public boolean supportsSmartAlarm() {
|
public boolean supportsSmartAlarm() {
|
||||||
return supportsCommandForService(0x08, 0x02) ;
|
return supportsCommandForService(0x08, 0x02) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean supportsSmartAlarm(GBDevice gbDevice) {
|
public boolean supportsSmartAlarm(GBDevice gbDevice) {
|
||||||
return supportsSmartAlarm() || getForceOption(gbDevice, PREF_FORCE_ENABLE_SMART_ALARM);
|
return supportsSmartAlarm() || getForceOption(gbDevice, PREF_FORCE_ENABLE_SMART_ALARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean supportsSmartAlarm(GBDevice gbDevice, int alarmPosition) {
|
||||||
|
return supportsSmartAlarm(gbDevice) && alarmPosition == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
|
return supportsSmartAlarm(device, alarmPosition) && alarmPosition == 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True if alarms can be changed on the device, false otherwise
|
* @return True if alarms can be changed on the device, false otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -112,8 +112,13 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return huaweiCoordinator.supportsSmartAlarm(device);
|
return huaweiCoordinator.supportsSmartAlarm(device, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
|
return huaweiCoordinator.forcedSmartWakeup(device, alarmPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -105,11 +105,6 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -102,11 +102,6 @@ public class ITagCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -188,12 +188,6 @@ public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsWeather()
|
public boolean supportsWeather()
|
||||||
{
|
{
|
||||||
|
@ -140,11 +140,6 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -92,7 +92,7 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,11 +108,6 @@ public class LefunDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return NUM_ALARM_SLOTS;
|
return NUM_ALARM_SLOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -140,11 +140,6 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -80,11 +80,6 @@ public class LiveviewCoordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -223,11 +223,6 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -139,7 +139,7 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,11 +115,6 @@ public class MiScale2DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -101,11 +101,6 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -109,11 +109,6 @@ public class NutCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -131,11 +131,6 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return PebbleUtils.hasHRM(device.getModel());
|
return PebbleUtils.hasHRM(device.getModel());
|
||||||
|
@ -84,11 +84,6 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -99,11 +99,6 @@ public class QC35Coordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -166,11 +166,6 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return isHybridHR();
|
return isHybridHR();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return this.isHybridHR();
|
return this.isHybridHR();
|
||||||
|
@ -89,11 +89,6 @@ public abstract class RoidmiCoordinator extends AbstractBLClassicDeviceCoordinat
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -107,12 +107,6 @@ public class SMAQ2OSSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -79,11 +79,6 @@ public class SoFlowCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -98,11 +98,6 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -213,7 +213,7 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class SonySWR12DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,11 +113,6 @@ public class SuperCarsCoordinator extends AbstractDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getManufacturer() {
|
public String getManufacturer() {
|
||||||
return "Brand Base";
|
return "Brand Base";
|
||||||
|
@ -207,7 +207,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(final GBDevice device) {
|
public boolean supportsSmartWakeup(final GBDevice device, int position) {
|
||||||
return supports(getTestDevice(), TestFeature.SMART_WAKEUP);
|
return supports(getTestDevice(), TestFeature.SMART_WAKEUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,11 +88,6 @@ public class TLW64Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -118,11 +118,6 @@ public class UM25Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -125,11 +125,6 @@ public class VescCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -81,11 +81,6 @@ public class VibratissimoCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -94,11 +94,6 @@ public class VivomoveHrCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -104,11 +104,6 @@ public class WaspOSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -116,10 +116,6 @@ public class Watch9DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 3; // FIXME - check the real value
|
return 3; // FIXME - check the real value
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
|
@ -131,7 +131,7 @@ public class WithingsSteelHRDeviceCoordinator extends AbstractDeviceCoordinator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
public boolean supportsSmartWakeup(GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSmartWakeup(final GBDevice device) {
|
public boolean supportsSmartWakeup(final GBDevice device, int position) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,11 +87,6 @@ public class XWatchCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -129,11 +129,6 @@ public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSmartWakeup(GBDevice device) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsRealtimeData() {
|
public boolean supportsRealtimeData() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -125,7 +125,7 @@ public class ZeppOsAlarmsService extends AbstractZeppOsService {
|
|||||||
if (alarm.getEnabled()) {
|
if (alarm.getEnabled()) {
|
||||||
alarmFlags = FLAG_ENABLED;
|
alarmFlags = FLAG_ENABLED;
|
||||||
}
|
}
|
||||||
if (coordinator.supportsSmartWakeup(getSupport().getDevice()) && alarm.getSmartWakeup()) {
|
if (coordinator.supportsSmartWakeup(getSupport().getDevice(), alarm.getPosition()) && alarm.getSmartWakeup()) {
|
||||||
alarmFlags |= FLAG_SMART;
|
alarmFlags |= FLAG_SMART;
|
||||||
}
|
}
|
||||||
alarmMessage = new byte[]{
|
alarmMessage = new byte[]{
|
||||||
|
Loading…
Reference in New Issue
Block a user