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
[battery] Allow to control charging hysteresis. JB#58372 #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bfb3c75
to
47a3e7e
Compare
|
Refactored to use MCE's settings API. The diff to look at is ff4f4e3..47a3e7e. |
|
Refactored the write side too, fixed D-Bus signal handling. |
|
Updated after dropping change to enum ordering on mce side. |
Unlike MCE, here we use the natural ordering for the ChargingMode enum, using first item for the default value (EnableCharging). Signed-off-by: Martin Kampas <martin.kampas@jolla.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No real issues with what is already here, but that charge-full-once and/or charge-full-after-connect discussion would affect what is needed here -> I'd like to see that resolved 1st.
| @@ -59,6 +73,18 @@ BatteryStatusPrivate::BatteryStatusPrivate(BatteryStatus *batteryInfo) | |||
| registerSignals(); | |||
|
|
|||
| // read initial values | |||
| NemoDBus::Response *chargingMode = m_mceInterface.call(MCE_CONFIG_GET, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we have had problems with exceeding max number of pending method calls during startup of some processes, and this 3 x { MCE_CONFIG_GET } could be handled via 1 x { MCE_CONFIG_GET_ALL }. For ref see displaysettings.cpp
...
| switch (mode) { | ||
| default: | ||
| case BatteryStatus::EnableCharging: | ||
| return MceChargingModeEnable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistency nit: return from default: here vs. return from outside switch in the above function. Both ways are just fine, but now there are two very similar methods that look different. Feel free to ignore ;-)
No description provided.