Monday, December 18, 2017

notifications - Get rid of 'battery-low' popup after some delay?


I'm using an Android phone (a Motorola Defy+ running CM9) with OsmAnd as a map solution mounted on my motorcycle (it just shows the map and a gpx-track as a driving hint).



It's not connected to a charger yet and I don't mind when it runs out of battery (I have spare ones).


However there's this "battery low" message popping up at 15% downwards. It covers a huge part of the map and stays there until you hit the OK button which does not work with gloves on and during the ride at all.


That remaining 15% still give >1h runtime which I want to enjoy withouth nagging popups!


Is there a way to hide it completely or get rid of it after some seconds automatically?


enter image description here



Answer



That is hard-coded into the framework am afraid.


Look in frameworks/base/core/java/android/os/Power.java


public static final int LOW_BATTERY_THRESHOLD = 10;


The alternative is to roll-your-own ROM to do this, there's a broadcast intent for battery low warnings (ACTION_BATTERY_LOW) but that's only for system signed apps AFAIK and cannot be intercepted.


The alternative is to listen for the ACTION_BATTERY_CHANGED broadcast and perhaps using Tasker, just to mute the battery warning sound...


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...