Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,397 Members 48,674 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] Disable low battery, battery temperature pop-ups and full battery notification

Tip us?
 
InfX
Old
(Last edited by InfX; 21st December 2012 at 01:30 PM.) Reason: see the "updates" section
#1  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
Plug [MOD] Disable low battery, battery temperature pop-ups and full battery notification

The reason for this little hack is the fact those 2 pop-ups can become an extreme double-annoyance while driving in hot weather. Imagine, your battery is below 15%, yet scorching hot, beyond the charging cut-off threshold. Connect a charger and you get bombarded with the "charging paused, battery temperature too high" pop-ups. Disconnect it and you get a low battery ones. This little patch deals with the issue by simply disabling the annoying pop-ups. It also disables the annoying battery full notification.

Please note, this doesn't modify any functionality, it just disables the pop-ups. The battery will not and should not charge when overheated.

Instructions:
  1. Download and unpack "BatteryPatch.zip", you should now have "Patch.js" jscript along with the "utils" directory.
  2. Fetch your "/system/app/SystemUI.apk" from the device, place it in the same directory, along with the "Patch.js".
  3. Apply the patch by launching "Patch.js" and push the patched SystemUI.apk back to the device.

Updates:
  1. Not every ROM seems to have the battery full notification and/or battery overheating popup. Patching those is now optional, the script will show a warning in case it fails to patch those instead of erroring out completely.
  2. There are some ROMs out there with showLowBatteryWarning method looking somewhat different from what i've seen on my S3. In order to try & let the patch work on more ROMs, the showLowBatteryWarning method is now being bypassed entirely. Hopefully, no ROM does anything important inside that method, besides showing the annoying low battery popups. In any case, as usual, you use the patch - you take the risk.

PS: For those willing and able to apply the patch manually, download the second zip and do a 3 way merge.
Attached Files
File Type: zip PowerUi.smali.Diffs.zip - [Click for QR Code] (16.4 KB, 768 views)
File Type: zip BatteryPatch.zip - [Click for QR Code] (1.46 MB, 1757 views)
File Type: zip BatteryPatch_Old.zip - [Click for QR Code] (1.46 MB, 341 views)
The Following 22 Users Say Thank You to InfX For This Useful Post: [ Click to Expand ]
 
InfX
Old
(Last edited by InfX; 11th December 2012 at 12:35 AM.)
#2  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
===> reserved <===
 
_neutron_
Old
#3  
Member
Thanks Meter 27
Posts: 80
Join Date: Jul 2012
Nice mod...just added it to my rom.. purposely drained the battery...no notification pop up (hopefully won't get the temp warning anyway)

Lovely work

Already given 8 thanks today...I will come back!
The Following User Says Thank You to _neutron_ For This Useful Post: [ Click to Expand ]
 
InfX
Old
#4  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
Quote:
Originally Posted by _neutron_ View Post
Nice mod...just added it to my rom.. purposely drained the battery...no notification pop up (hopefully won't get the temp warning anyway)

Lovely work

Already given 8 thanks today...I will come back!
Thanks. Temp warning should not be there any longer, too. But the rest of them (bad charger, overcurrent, stuff like that) are still there, i don't think killing those is a good idea.

The reason i did this was primarily the temperature warning. I've been looking all over the forum on how to disable it, but couldn't find any info, so i though, "what the hell, i can find it myself, it's not such a big deal"... during the search i've noticed the low bat one, too, and though "hmm, i hate that one too, lets kill it as well".

Thats about it.
The Following User Says Thank You to InfX For This Useful Post: [ Click to Expand ]
 
InfX
Old
#5  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
Just patched and tested the full battery notification as well, first post updated.
The Following User Says Thank You to InfX For This Useful Post: [ Click to Expand ]
 
_neutron_
Old
#6  
Member
Thanks Meter 27
Posts: 80
Join Date: Jul 2012
Lovely, gonna test this when I get home

Thanks for the update
 
ExTREmE99
Old
#7  
Senior Member
Thanks Meter 9
Posts: 230
Join Date: Jul 2006
Location: Bay Area, CA
sorry to sound like a total noob, but im completely new to apktool. was reading up on it and trying it, but im slightly confused. what options do you chose exactly when decompiling? i couldnt find the power smali file after decompiling
 
InfX
Old
#8  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
There are plenty of explanations/tutorials on this around the forum. About not having the smali after decompiling... any chance your rom is odexed? In this case you wont be getting any smali files, cause all the code is in the odex file, not the apk. You will have to deodex it in this case and, possibly, reodex it before placing it back on the device (not sure about it, specifically i am unsure how the odex dependecies work).

Sadly, i cannot provide a ready to use apk, there are too many versions being in use, especially considering the 15 toggles mod, the battery icon mod as well as many other visual mods also patch stuff inside this apk, increasing the number of variations even further. So, sorry, no ready to use apk.
 
baste07
Old
#9  
baste07's Avatar
Senior Member
Thanks Meter 270
Posts: 4,326
Join Date: Jun 2009
Location: Manila
Is there a flashable file?

Sent from my GT-I9300 using Tapatalk 2
 
InfX
Old
#10  
InfX's Avatar
Senior Member - OP
Thanks Meter 195
Posts: 809
Join Date: May 2008
Quote:
Originally Posted by baste07 View Post
Is there a flashable file?
Nope, and it is extremely hard to make. In fact, impossible, with the currently available CWM tools, as far as i know. It would be "for ROM version <insert_version_here> with 15 toggles and circle battery", "for ROM version <insert_version_here> without 15 toggles and green battery" etc etc etc kind of variations, and as i already mentioned, i doubt this is a viable option.

Anyone can prove me wrong and provide a way of writing a CWM script that would decompile (deodex if needed) an existing apk, apply a patch, recompile it and than replace it ? Out of all the things needed, i only know how to do the "replacing" part

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes