Skip to content

Commit

Permalink
[batterynotifier] Rewrite battery notification logic. Fixes JB#38667
Browse files Browse the repository at this point in the history
Battery notifier uses deprecated context properties, triggers battery low
warnings too often, does not trigger not-enough-power alerts at all, and
in general is a bit unpredictable.

Use appropriate mce / usb-moded property tracking methods instead of
relying on statefs backed context properties.

Replace organically grown ad-hoc rules for showing/hiding notifications
with edge triggering state machine.

Track all notifications managed by battery notifier instead of relying on
"remember last 3 notifications launched less than 5 seconds ago" style
heuristics.

Instead of using varying battery level delays for idle/incall/active
scenarios, use fixed 30 minute interval which gets cut short if battery
level drops while device is in active use.

Use suspend proofed BackgroundActivity from nemo-keepalive for waking up
to repeat low battery alerts.

Instead of trying to co-manage charging notifications with usb mode agent,
handle charging notifications explicitly in battery notifier and hide the
notifications when they are expected to interfere with usb mode related
activity.

Drop legacy unit test code that has zero relevance after changes.

Charger type data is available in libmce-qt >= 1.2.0

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Aug 28, 2019
1 parent 69564d1 commit 07798de
Show file tree
Hide file tree
Showing 22 changed files with 487 additions and 1,568 deletions.
2 changes: 1 addition & 1 deletion rpm/lipstick-qt5.spec
Expand Up @@ -27,6 +27,7 @@ BuildRequires: pkgconfig(Qt5Sensors)
BuildRequires: pkgconfig(contentaction5)
BuildRequires: pkgconfig(mlite5) >= 0.2.19
BuildRequires: pkgconfig(mce) >= 1.22.0
BuildRequires: pkgconfig(mce-qt5) >= 1.2.0
BuildRequires: pkgconfig(keepalive)
BuildRequires: pkgconfig(dsme_dbus_if) >= 0.63.2
BuildRequires: pkgconfig(thermalmanager_dbus_if)
Expand All @@ -35,7 +36,6 @@ BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(libresourceqt5)
BuildRequires: pkgconfig(ngf-qt5)
BuildRequires: pkgconfig(contextkit-statefs) >= 0.2.7
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(usb-moded-qt5) >= 1.8
Expand Down

0 comments on commit 07798de

Please sign in to comment.