Don't launch canned message when waking screen or silencing notification (#9762)
* Don't launch canned message when waking screen or silencing notification * Add screen ifdefs * Get the #if right --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
co-authored by
Ben Meadors
parent
83cac93ca8
commit
857c7b3a3a
@@ -100,13 +100,28 @@ void InputBroker::processInputEventQueue()
|
|||||||
|
|
||||||
int InputBroker::handleInputEvent(const InputEvent *event)
|
int InputBroker::handleInputEvent(const InputEvent *event)
|
||||||
{
|
{
|
||||||
powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release
|
#if HAS_SCREEN
|
||||||
|
bool screenWasOff = false;
|
||||||
|
if (screen) {
|
||||||
|
screenWasOff = !screen->isScreenOn();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
powerFSM.trigger(EVENT_INPUT);
|
||||||
|
|
||||||
if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule &&
|
if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule &&
|
||||||
moduleConfig.external_notification.enabled && externalNotificationModule->nagging()) {
|
moduleConfig.external_notification.enabled && externalNotificationModule->nagging()) {
|
||||||
externalNotificationModule->stopNow();
|
externalNotificationModule->stopNow();
|
||||||
|
// If this turns off a notification, don't further process the event
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAS_SCREEN
|
||||||
|
if (screen && screenWasOff) {
|
||||||
|
// If the screen was off, it is in the process of turning on, and we just drop the event
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
this->notifyObservers(event);
|
this->notifyObservers(event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user