-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix #8885 (Unnecessary actions are performed by ExternalNotificationModule) #8886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
The current (and desired) behavior is that any input broker event, not just long press, would dismiss an ext. notification. My preference would be to handle it in the input broker rather than PowerFSM, honestly, as it is a strange place dispatch an action for an input event vs the input broker. I would be in favor of removing the PowerFSM call to consolidate. @jp-bennett has thought as well I'm sure |
|
I didn't quite understand the concept. Previously, there was a TODO in the powerFSM call section, which stated that we should NOT call powerFSM if it's a long press. I mixed this up - we should have done if (!INPUT_BROKER_IS_LONG_PRESS(event->inputEvent)) Previously, there was handling of externalNotificationModule->stopNow() here, which was also called again in the callback ExternalNotificationModule::handleInputEvent(const InputEvent *event) I understand that you believe we should completely abandon: |
|
Please check 2.7.16 (#8601) if it resolves your issue already. |
|
@mverch67 First in InputBroker::handleInputEvent Second time in ExternalNotificationModule::handleInputEvent itself I took the tag 2.7.16a597230 and added logs in these places: Log output: I think we should abandon one of the places where we check for nagging and try to call stopNow. Most likely, it would be more correct to keep the handling in ExternalNotificationModule::handleInputEvent. |
|
From the logic in the code I think Edit: another question is if is required at all as it seems that In general I think the InputBroker should not know anything about any other modules and solely interface with the notify mechanism to decouple the components according the publisher/subscriber design pattern. |
|
Yes, that's exactly why I want to get rid of the stopNow() call in InputBroker. That was the goal of the PR. int InputBroker::handleInputEvent(const InputEvent *event)
{
powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release
And I decided to add a condition: if (!INPUT_BROKER_IS_LONG_PRESS(event->inputEvent)) {
powerFSM.trigger(EVENT_INPUT);
} |
|
However I also disagree with that TODO in the PowerFSM conceptually. I think the PowerFSM should focus on power related actions being dispatched only. It doesn't make sense for that event to interact with the ext. notification module directly |
|
Architecturally InputBroker should not know about PowerFSM. Instead, PowerFSM should subscribe(observe) input events if it should switch its fsm based on it and make its own decisions when to do it. |
|
@thebentern and @mverch67 |
Yeah, now the separation of the two components is really clean, looks good except I would not expose in the interface, these should be really local to (and hidden inside) PowerFSM. |
Done |
Fix #8885