Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[batterynotifier] Rewrite battery notification logic. Fixes JB#38667
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