htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.47k stars 441 forks source link

Wrong battery status on Termux #926

Open Glucy-2 opened 2 years ago

Glucy-2 commented 2 years ago

Battery reads 0.1% when charging and 0.0% when not charging. Charging: image image Not charging: image image Termux:API APP is installed and package termux-api is installed (pkg install termux-api) Phone model: OPPO Reno3, Android 10, rooted htop ver: 3.0.5 image

BenBE commented 2 years ago

Can you have a look at the status information provided in the two places where htop looks for them? https://github.com/htop-dev/htop/blob/main/linux/Platform.c#L629-L868 The first one is in /proc/acpi/battery//proc/acpi/ac_adapter and the second one is in /sys/class/power_supply. A copy of those values for the two situations might be good for further diagnosing the issue.

Glucy-2 commented 2 years ago

/sys/devices/platform/charger/power_supply/battery/capacity or /sys/class/power_supply/battery/capacity (is a link) image

BenBE commented 2 years ago

Are these the only files in these directories?

Glucy-2 commented 2 years ago

image All files in the directories (the second directory is linked to the first)