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

MMWolverine

Inactive Recognized Contributor
Sep 12, 2012
1,953
4,504
153
Hey guys! I have a strange request. :silly: While most people want to get rid of battery notifications, I would like to have fully charged sound back. If I'm not mistaken, it should be "TW_Battery_caution.ogg", but on 100% there's a dead silence. Omega v35 XXLL5 JB 4.1.2 is my current rom, so if you could share me the code or point be in the right direction, I would be extremely thankful.
 

InfX

Senior Member
May 1, 2008
885
216
73
I am AFK now, but if you look at the jscript (that is well commented) you will easily see what method i am patching there. Ill likely be back in a few days.
 
  • Like
Reactions: MMWolverine

MMWolverine

Inactive Recognized Contributor
Sep 12, 2012
1,953
4,504
153
I am AFK now, but if you look at the jscript (that is well commented) you will easily see what method i am patching there. Ill likely be back in a few days.
Omega rom has pop-us and full battery sound disabled by default. So I would only need this charged "beep-beep" back, low battery works ok. Samsung 4.1.1 stock rom had this feature, could the code from there be copied to 4.1.2?
 

DSA

Senior Member
May 15, 2011
4,759
5,778
263
This is a simple mod

Read the supplied files...you will see there's about 3 differences in total...All you do is type or remove 'return void' in certain places and recompile
 
Last edited:
  • Like
Reactions: MMWolverine
G

GuestX00823

Guest
HI,

I have applied the patch but returned an error message stating that the file wasn't found when it was clearly there.

Attached is the file, Would you kindly, pretty please, apply the patch for moi?

thank you.
 

Attachments

InfX

Senior Member
May 1, 2008
885
216
73
HI,

I have applied the patch but returned an error message stating that the file wasn't found when it was clearly there.

Attached is the file, Would you kindly, pretty please, apply the patch for moi?

thank you.
The file it is unable to find is a smali file, after decompilation, and it is, indeed, not there. Your SystemUI.apk isn't nearly similar to what i am used to see. Even it's size is about 10 times smaller than usual. Sorry, but i cannot apply this on it.
 
G

GuestX00823

Guest
The file it is unable to find is a smali file, after decompilation, and it is, indeed, not there. Your SystemUI.apk isn't nearly similar to what i am used to see. Even it's size is about 10 times smaller than usual. Sorry, but i cannot apply this on it.
I noticed the difference in size before uploading it.

FYI my android version is 2.3.4
kernel is 2.6.32.9
build number is 4.0.2.A.0.58
running on Sony Ericsson Xperia mini Pro.

Hope there is some other way. thank u
 

InfX

Senior Member
May 1, 2008
885
216
73
Well, the patch is intented for Android 4.x, this kinda explains the systemui.apk being so different. I am sure it is doable on 2.x as well, but i no longer run it and have nothing to try & patch the same thing on it.
 

InfX

Senior Member
May 1, 2008
885
216
73
BatteryPatch.js said:
Extracting code...
==> Error, "temp\classes.dex", File not found, ODEXed ROM?
Do i really have to say more? Let me rephrase the error message...

BatteryPatch.js said:
I am trying to extract the code from the apk file... hmm, i don't see the file the code should be in and can't really do anything about it... the most obvious reason is an ODEXed ROM, is that the case?
So? ODEXed ROM? I bet it is. To do the same thing on an ODEXed ROM it would require (partial) deodexing, that, in turn, requires you to bring most of the odex files in, because of their dependencies chain. Wanna automate this? Ok, go on, i'll gladly update the first post with your updated script version ;)
 

diulalasing

Member
Dec 29, 2012
6
2
0
Does this disable crtically low warning?

Also does this only work for S3? or does it work for older androids like ace plus or ace 2 (2.3.6 gingerbread)

Thanks a lot
 

Asaru215

New member
Jul 28, 2012
2
0
0
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.


Will this work for the Galaxy tab 7 plus 6210. I have the stock rom for ICS. I keep reeving the error not letting me charge. What is the best rom for me to fix this because I purchased another battery and I have the same result. Could it be the sensor?
 

bit2

Member
Apr 21, 2012
27
15
0
Nice mod, thanks.
If somebody is interested what exactly is going on in PowerUI, here's the source for Android 4.2.2:
https://android.googlesource.com/pl...I/src/com/android/systemui/power/PowerUI.java

There's another approach though: modding the file containing the limits.
Somebody already mentioned it in the forum:
http://forum.xda-developers.com/showpost.php?p=12871372

The confg file (res/values/integers.xml) is in /system/framework/framework-res.apk, more precisely in the compiled resource bundle "resources.arsc".
The source of the original config (for Android 4.2.2) can be found here:
https://android.googlesource.com/pl...droid-4.2.2_r1/core/res/res/values/config.xml

The difference between this hack and the one in this topic is that one requires the unpacking of framework-res.apk (and decompilation of the resource bundle), modding and repacking, while the other requires unpacking of SystemUI.apk, decompilation of the DEX classes, patching the code, recompile into DEX and repack into an APK.

But since apktool used to have (a few) problems with properly decompiling (or decoding? ... whichever phrase you prefer) resources ... which of course results in messed up APKs once you put it all together again ... and since smali+baksmali are pretty much stable and dependable, it's a nobrainer which method is better (meaning more trustworthy / stable).
 
  • Like
Reactions: InfX and criscan

InfX

Senior Member
May 1, 2008
885
216
73
...modding the file containing the limits...
I am not sure there a modifiable limit for overheat exist there. Didn't take the time to actually look there, though.

In any case, even if it does, it would strongly suggest NOT modifying that limit, since it would be more than likely it would also configure the charging circuitry to keep charging above the normal thermal cut-off threshold, not just disable the pop-up. With a likely dire consequences for the battery.
 
  • Like
Reactions: RogueCoyote
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone