I need to monitor some applications power consumption of my Samsung A8, programmatically. I'm doing this by accessing the files:
The problem is that the kernel update those files every 10 seconds, so it does not produce sufficient power samples measurement to my experiment. I want to reduce the update time produced by the kernel driver to increase the sample rate. Ideally the kernel would update the values every half second.
From this post: How does the Android estimate the battery level without a current sensor? I understood that I might find the name of the chip that measures the battery information by looking into a defconfig file. After searching for a while on the defconfigs from my kernel, I believe that the Fuel Gauge used is S2MU004 as specified in this file: https://github.com/prashantpaddune/universal7885/blob/e5ffd23305f0b09fe2bef3f8580df046dab232cc/arch/arm64/configs/exynos7885-jackpotlte_defconfig#L4415
But I'm still not sure about it. Would be the s2mu004-fuelgauge the name of the chip? If so, where can I find the driver? And then, someone can enlighten me on how to modify the driver to increase the sample rate?
Model: Samsung Galaxy A8 (SM-A530F)
Android Version: Android Pie (9)
Kernel: Quantum Kernel V4
Kernel version: 4.4.111-Quantum_pie.V4.0-A530F
Processor: Samsung Exynos Octa 7885
Magisk version: (used for root) 19.3