Yesterday I received a 1650mHa battery for my HTC Kaiser, which is 300mHa more than the original 😎 . Since I use a phone that is non native Android, it is necessary to do a few spells to correctly read the battery in%. One of the easiest options is if you use a standard kernel, edit it with Atools by setting the new value for mHa on the battery, flash with the new NBH and dare. The other option is to use a non-standard kernel that does not lend itself to atools processing and make an ugly patch of the problem.
First let's explain a little theory and then move on to the patch. When you make changes to your kernel with atools you are fine-tuning the system in / sys / module / and then according to depends on your hardware. For me, the important file that is responsible for setting the battery is located in / sys / module / board_kaiser_battery / parameters / battery_capacity. It contains how many units is the amount of your battery and based on the number inside is calculated on how many % is your battery right now. I say units because we do not write a pure number in mHa but it is calculated based on the formula
mHa * 1.6 = units
In my case this means 1650 * 1.6 = 2640 units, that is, this will be the contents of our file. Speaking quickly, I drive one into my console
echo 2640 > /sys/module/board_kaiser_battery/parameters/battery_capacity
So far, things are crystal clear about what needs to be done, where and why. However, here comes the moment for the small detail, the file in the / sys directory resets its contents after each restart of the phone, which is not much of an offer. So the next step is to put it in the top row of the init on our Android.
Since I didn't put it in init, I want to wait a few days before doing it. When I drive it into the init I will quickly draw a small how to 🙂