Bug 434291 - Low battery notification on my computer says my battery is at 16% when it’s at 15%
Summary: Low battery notification on my computer says my battery is at 16% when it’s a...
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: 23.08.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Erik Duisters
URL:
Keywords:
: 480717 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-11 16:56 UTC by ariasuni
Modified: 2026-01-24 09:34 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ariasuni 2021-03-11 16:56:09 UTC
SUMMARY


STEPS TO REPRODUCE
1. Connect your phone to your computer with KDE Connect
2. Wait for your battery to go to 15%
3. Observe the low battery notification on the computer

OBSERVED RESULT
Notification says my phone is at 16% battery while it’s not what my phone says.

EXPECTED RESULT
Notification says my phone is at 15% battery, same as my phone says.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
KDE Connect 20.12.3
Comment 1 TraceyC 2024-02-06 21:16:00 UTC
*** Bug 480717 has been marked as a duplicate of this bug. ***
Comment 2 TraceyC 2024-02-07 01:01:23 UTC
I was able to reproduce this on my system

## Steps to reproduce

Phone is connected to a laptop with kdeconnect
Set battery "Stamina Mode" on the phone to be activated at 70% battery
Waited for low battery notification from the phone
Bug confirmed. Battery on the phone was at 70%. 
Notification received on Plasma desktop reads "Battery at 71%"


## System details

kdeconnect 23.08.4

Operating System: Solus 4.5
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Kernel Version: 6.6.15-272.current (64-bit)
Graphics Platform: X11
Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
Manufacturer: Dell Inc.
Product Name: XPS 17 9710
Comment 3 aristsakas 2026-01-07 11:02:58 UTC
*** Bug 473743 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2026-01-20 11:07:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-android/-/merge_requests/602
Comment 5 Albert Vaca Cintora 2026-01-24 09:34:50 UTC
Git commit fe8a3c9ea30b2c6983aa902f5b8c1507cba9d613 by Albert Vaca Cintora, on behalf of Erik Duisters.
Committed on 24/01/2026 at 09:34.
Pushed by albertvaka into branch 'master'.

Fix battery level being incorrect when sending a THRESHOLD_EVENT_BATTERY_LOW event

Because ACTION_BATTERY_LOW intents do not have extras we were sending the previous battery charge level when sending a THRESHOLD_EVENT_BATTERY_LOW event to the desktop resulting in a "Low Battery" notification being show with an incorrect charge level.

This seems to be a change in Android behavior since API 26: they now first send ACTION_BATTERY_LOW and then ACTION_BATTERY_CHANGED, when it used to be the other way around.

M  +25   -20   src/org/kde/kdeconnect/Plugins/BatteryPlugin/BatteryPlugin.kt
M  +92   -45   tests/org/kde/kdeconnect/Plugin/BatteryPluginTest.kt

https://invent.kde.org/network/kdeconnect-android/-/commit/fe8a3c9ea30b2c6983aa902f5b8c1507cba9d613