Only inhibit sleep if motion notifications are enabled, not just Bluetooth
This commit is contained in:
parent
074df0526f
commit
a6cd3679eb
|
@ -120,3 +120,7 @@ void MotionService::UnsubscribeNotification(uint16_t attributeHandle) {
|
||||||
else if (attributeHandle == motionValuesHandle)
|
else if (attributeHandle == motionValuesHandle)
|
||||||
motionValuesNoficationEnabled = false;
|
motionValuesNoficationEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MotionService::IsMotionNotificationSubscribed() const {
|
||||||
|
return motionValuesNoficationEnabled;
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace Pinetime {
|
||||||
|
|
||||||
void SubscribeNotification(uint16_t attributeHandle);
|
void SubscribeNotification(uint16_t attributeHandle);
|
||||||
void UnsubscribeNotification(uint16_t attributeHandle);
|
void UnsubscribeNotification(uint16_t attributeHandle);
|
||||||
|
bool IsMotionNotificationSubscribed() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NimbleController& nimble;
|
NimbleController& nimble;
|
||||||
|
|
|
@ -62,6 +62,10 @@ namespace Pinetime {
|
||||||
this->service = service;
|
this->service = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Pinetime::Controllers::MotionService* GetService() const {
|
||||||
|
return service;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t nbSteps = 0;
|
uint32_t nbSteps = 0;
|
||||||
uint32_t currentTripSteps = 0;
|
uint32_t currentTripSteps = 0;
|
||||||
|
|
|
@ -417,9 +417,9 @@ void SystemTask::UpdateMotion() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == SystemTaskState::Sleeping &&
|
if (state == SystemTaskState::Sleeping && !(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
|
||||||
!(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
|
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) ||
|
||||||
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) || bleController.IsConnected())) {
|
motionController.GetService()->IsMotionNotificationSubscribed())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user