This tutorial is written for Samsung Galaxy Y GT-S5360 in particular but similar method of using Xposed Installer and a corresponding Xposed Module can work on other Android devices as well, but make sure to check the compatibility of your device and ROM with the Xposed Installer app and the Xposed module.
If you are sure of what you are looking for skip to "HOW TO" below
It so happens that your phone starts to show weird battery readings, one reboot and 30% battery is drained! What?!! And to make matters worse there are times when the phone shows 0% and shuts down even after hours of charging and you'll end up having to use the phone always plugged in. And you obviously blame the battery to be faulty.
But this paranormal behavior which turns your super smart phone into a computer without UPS is more than likely to have been caused by the failure of a chip, more precisely a fuel gauge chip that does the actual battery percentage estimation by either reading the cell voltage or current. Now this chip maybe integrated into the main-board of the phone, and the implementation usually varies with the manufacturer. Hence a simple battery swap might not solve the problem in most cases and the only option is to get it repaired, now that takes time and money.
Now if you are sure that it is not the battery that is faulty then you try the below method to prevent your phone from automatically shutting down on critical battery warnings when your phone's faulty fuel gauge chip gives a false reading of the battery level. Hence you'll be able to use it off the charger.
But this method calls for you to keep a track on your phone usage and battery consumption pattern since the reading would always show 0% or which ever value the faulty chip returns and cannot be counted on, and there is no use trying out different app or modules to get the reading correct as all of them receives the readings from the underlying kernel which is fed by the faulty chip. So even if your battery is 100% charged it could show 0%, 30%, or even 200% (just kidding), so what i am saying is that you could be doing something important and the battery actually runs low but you have no way of knowing it and could end up loosing unsaved data.
HOW TO
Below is the method in brief, and as usual the credit goes to the original developers of the Xposed Installer and the mod that is used.
NOTE: Your phone should be rooted for this method to work.
CAUTION: Prolonged use of this method by letting your battery completely drain out is not a good idea as deep discharging Li-ion batteries can seriously damage it.
DOWNLOADS:
Xposed Installer + Module + Readme on MediaFire
INSTRUCTIONS:
- Install the Xposed Installer app
(XposedInstaller-2.2-20131005.apk)
- Open Xposed Installer
- Select Framework -> Install Xposed framework -> Reboot
- Install the module to disable critical battery shutdown (disablecriticalbatteryshutdown_v1_44e63f.apk)
- Open Xposed Installer -> Modules -> enable Disable Critical Battery Shutdown module -> Reboot
(Similarly you can disable it anytime)
- Now you are done setting it up and now the phone wont power down on reaching critical battery level.
TO KNOW MORE:
Xposed Installer Repo
DisableCriticalBattreyShutdown Xposed MOD
This answer to a question on estimation from android.stackexchange.com will shed some light on how the battery percentage is actually measured.
Thanks