Long story short I was installing custom ROMs to my Android device and one thing that stays in place regardless of ROM I use is a wrong battery stats monitoring. The device always behaves like it's being charged, although it's not.
I've checked the
/sys/class/power_supply/battery and voila - there's no
/sys/class/power_supply/usb. According to some docs I've found that will make the system think it's connected to an external power source.
The question is what is responsible for creating this
battery file - is it a kernel, or a ROM (i.e. LineageOS, Resurrection Remix etc).
[UPD:] In the document I've provided they write about
/sys/class/, although here the
/sys/class/power_supply/*/ is mentioned as a Kernel interface. Should I assume that it's a Kernel issue then?
It's interesting though, that the stock ROM does show battery stats correctly, although nothing was added to
/sys/class/ and TWRP recovery I'm using shows battery charge as -1%.