Analyzing the Standby drain from Android OS - OnePlus 3 Guides, News, & Discussion

Let me keep this short and to the point. As numerous other users, I am also extremely bothered by the huge Android OS drain while on standby. On average, standby drain is 3% - 4% per hour,which is unacceptable. Let me describe my condition and my findings.
My setup
Stock OpenBeta 10 - 12, stock kernel, with Magisk and greenify. Dual sim (Airtel + Jio). 4G mobile data always active on Jio. Drain remains same if I disable both/ one of the sims, turn off data, or switch to flight mode.
What I tried
Used this command from a PC to check if any rogue app is using too much CPU. It once showed me Google drive was constantly using 6% CPU, but it was an one time bug, rebooting fixed it and never showed up again. Clearly, active usage was not problem, only the standby.
Code:
adb shell top -m 20 -s cpu
Then I checked BetterBatteryStats and I always see such alarming "Wake (Screen Off)" times. As you can see in screenshot in attachment. It is almost 50% of total standby. It might seem if the wakelocks are due to Google Play Services or GoogleQuickSearchBox, but no! Google's app take wakelock only if the phone is already awake, the primary reason of waking up has to be checked by this tool called Battery Historian by Google
To use it,
Download the repository as Zip file from https://github.com/google/battery-historian
Install python 2.7 and add python to your path.
Unzip Battery Historian after downloading as ZIP and go to scripts folder.
Run these two commands in cmd with phone connected in USB Debugging mode
Code:
adb shell dumpsys batterystats > batterystats.txt
python historian.py batterystats.txt > batterystats.html
If you cant get python running, skip the second command and upload the txt file here.
Now you will have a HTML file, possibly around 4-5MB. Opening it takes a bit of time to fully load in browser, like 1-2mins. Be patient.
In this graph, compare your screen, wake_lock* and wake_reason rows. In my case, the wake reason is almost always QCOM SMD-MODEM or QCOM SMD-MPM. And loads of wakelock from RILJ_ACK. Both of these point to possible screw ups from OnePlus at proper optimization of the radio interface.
I am not exactly sure what this means as I don't have much expertise on the kernel level, instead I am an app developer. I highly suspect it is a bug at the firmware/radio level.
I urge everyone to post their own findings and also help in fixing the problem with proper explanation if anyone possesses the kernel level expertise. I have also included my own battery stats in the attachments, if anyone is interested in further investigation

RESERVED

Related

[Q] Android OS (kernel) Eating up Phone resources?

Hello,
Below is the message i wrote on the google support forum, but i havnt gotten a single reply yet, so i turn to you guys, in hope that you're able to help me
I have been experiencing this issue on and off for the past month or two. The issue being, that something called "Android OS", in the battery usage list, is eating up all my battery.
An example is, currently my phone has been unplugged for 1h30m(im down to 69% battery life remaining after i unplugged it at fully charged 100%) where the battery usage is ranked as follows:
Android OS: 72%
Display:18%
Wi-Fi: 2%
Cell standby 2%
Android System 2%
and so on and so forth.
The reason why i wrote (kernel) in the title of this question, is, that with the app "Powertutor" i have been shown that the main "app" or proccess eating up my battery, when this "Android OS" is eating up my battery as shown in the Battery Usage list, is the Kernel. Right now is shows the kernel is using 84,3% of the energy usage, Handscent has been using 3.1% and so on.
Often a reboot will bring the phone back to normal and the Android OS issue goes away for a while. A friend of mine, however, who has the exact same phone as I, has this issue, almost all the time, and a mere reboot doesnt seem to do the trick for him. His phone only lasts 6-7 hours tops, where it most of the time is just idle, and he isnt using the phone at all. While mine, when the Android OS issue isnt present, last up to 20 hours on a single charge, when i dont use it much.
When the Android OS process is eating up all the power, the phone grows really hot as well, and the difference is easilly felt. So when i feel that my phone is hot like that, i automaticly think "oh, time for a reboot".
I've been unable to find any info regarding this issue on the internet, and therefore I'm unsure what to do to fix it for real. Tried several factory setting resets on my friends phone, tried not installing many new apps, formatting the SD card, formatting the phone from bootloader (still testing his phone to see if this worked properly)things like that, but always, the issue returned, as on my phone where it only pops up once every other day.
Hopefully, someone will be able to help, or shred some light on the case.
Thank you,
Chris
Device: Nexus One
Carrier: AT&T Phone Version, Danish Carrier Bibob
Country / Language: Denmark / English
OS / Browser / build number (if applicable): Android 2.2 Froyo / Native / FRF91
Having Exchange sync on, by any chance? Try turning it off for a day, see if it helps.
Jack_R1 said:
Having Exchange sync on, by any chance? Try turning it off for a day, see if it helps.
Click to expand...
Click to collapse
"Exchange sync" being exactly what? The basic sync function on the phone that can be enables and disabled? The basic sync with your google account?
If thats the case, then yea im having that on all the time, so that it may sync whenever it wants to. The sync icon doesnt appear that often though, so cant see how this could be the reason why. But if you come back to me and tell me that this is what you meant, i will definetly give it a try
Thx for responding
No, Exchange sync means - MS Exchange account (in addition to your default Google account) that syncs calendar/email/both with Exchange server.
I'm guessing again that that is something extra you must install / set up, which i have not done. The only two accounts i have that can sync are my facebook and my default google account. I never sync the facebook one though.
Edit:
Update:
Reinstalled Watchdog Lite today, since my phone has been exceptionally sluggish, and SeePU graph keeps showing a full graph on cpu usage. I've had to reboot it twice today, in hopes of it returning to normal state. It does for a while, but then returns to a slow state where Android OS uses like 80% of the battery.
I made Watchdog Lite monitor the base android processes as well, and right now it keeps warning me that the "Base System", "Linux Process" uses up 89,6% of the CPU and 10,3MB of RAM, while nr 2 on the list is Android System, Foreground, with 3,8% and 27 MB.
I feel like the state of my phone is worsening, and I'll prolly do a full factory reset(again)/format of everything within a few days if i cant find the root of the issue this time around.
Please help I love my phone and i want it to be healthy again.
chris6647 said:
Hello,
...
Click to expand...
Click to collapse
"OS" is an abbreviation for "Operating System". That means ALL of the background stuff that eats battery and CPU time that isn't attributable to a process or function easily understood by the typical user. This includes, yes, the Linux kernel, but also all the other background things that your phone does in order to continue functioning in a normal synchronized state...
Your phone has a CPU. The kernel has a process scheduler, which swaps different programs in and out of the CPU in order to make it look like it is running more than one thing at a time. Each clock cycle consumes some amount of the power from the battery, so if it assigns 10 cycles to process A, 10 cycles to process B, and then waits for 20 cycles for I/O synchronization, then HALF of the power consumed in those last 40 cycles (attributable to CPU) will be "Android OS". Clear?
lbcoder said:
"OS" is an abbreviation for "Operating System". That means ALL of the background stuff that eats battery and CPU time that isn't attributable to a process or function easily understood by the typical user. This includes, yes, the Linux kernel, but also all the other background things that your phone does in order to continue functioning in a normal synchronized state...
Your phone has a CPU. The kernel has a process scheduler, which swaps different programs in and out of the CPU in order to make it look like it is running more than one thing at a time. Each clock cycle consumes some amount of the power from the battery, so if it assigns 10 cycles to process A, 10 cycles to process B, and then waits for 20 cycles for I/O synchronization, then HALF of the power consumed in those last 40 cycles (attributable to CPU) will be "Android OS". Clear?
Click to expand...
Click to collapse
Alright, I was wondering exactly what it meant when it just said Android OS, just that seemed like quite a broad description.
But what your saying is that it may be other applications that is actually eating up the power, just the kernel assigning the power to the program, and therefore the Battery Usage shows the kernel/Android OS as the culprit?
If its the case that its an app then, that through the kernel is triggering the usage that drains my phone, then how come my friend had this issues with an almost "naked" phone? He had installed just a few apps and still ran into this issue.
Am i understanding what you're telling me correctly?
chris6647 said:
Alright, I was wondering exactly what it meant when it just said Android OS, just that seemed like quite a broad description.
But what your saying is that it may be other applications that is actually eating up the power, just the kernel assigning the power to the program, and therefore the Battery Usage shows the kernel/Android OS as the culprit?
If its the case that its an app then, that through the kernel is triggering the usage that drains my phone, then how come my friend had this issues with an almost "naked" phone? He had installed just a few apps and still ran into this issue.
Am i understanding what you're telling me correctly?
Click to expand...
Click to collapse
It's not normal, something is causing it. Most likely some poorly written app or some other weird thing is causing the "Android OS" (which I assume is likely the virtual machine itself) to do bad things.
khaytsus said:
It's not normal, something is causing it. Most likely some poorly written app or some other weird thing is causing the "Android OS" (which I assume is likely the virtual machine itself) to do bad things.
Click to expand...
Click to collapse
Today the linux process "init" has been hogging up all my phones resources, as in 77%+ of all the CPU usage :/
Was wondering if rooting my phone and installing/ flashing some custom rom would solve the issue for sure? Or should I send the phone back to the states for at checkup or repair? (dont think this is needed but now I ask anyway)
Is there an app that could track down exactly what is sucking my phone dry? Cus all that I've found are those broad references or processes :/
Thx for all your responses
Same problem here:
http://forum.xda-developers.com/showthread.php?t=826507
http://www.google.mw/support/forum/p/android/thread?tid=7da0c666e8ffbc36&hl=en
Seems like there is no solution available yet...
chris6647 said:
Today the linux process "init" has been hogging up all my phones resources, as in 77%+ of all the CPU usage :/
Was wondering if rooting my phone and installing/ flashing some custom rom would solve the issue for sure? Or should I send the phone back to the states for at checkup or repair? (dont think this is needed but now I ask anyway)
Is there an app that could track down exactly what is sucking my phone dry? Cus all that I've found are those broad references or processes :/
Thx for all your responses
Click to expand...
Click to collapse
There is no solution, because you can't track the app that is causing the system to hang.
You can uninstall all the latest installed/updated apps and install them one by one, using Titanium - and that'll pinpoint the offender.

Battery drains on Maclaws CM11

I'm opening this thread to clean up the Dev thread, since the most probable cause of battery drains are software/configuration related.
Here's my own experience with this matter.
Most of the drains I've seen are related to Location settings and Google Now. It seems Google's Location Reporting and Location History keep pinging WiFi for the location at a fairly high rate, so keeping the phone Awake and/or the WiFi running all the time. An usual indication of this is that in BetterBatteryStats you get:
1) Screen On % very low
2) WiFi On 100% of the time
3) WiFi Running 100% of the time.
4) Awake with moderate-to-high %.
To test it, here's what should be done:
1) Get BetterBatteryStats (BBS), enable Root, install it as system app (in advanced settings). Reboot.
2) Disable WiFi and GPS completely, preferably leaving Data Network also off. You may go all the way and just turn on airplane mode.
3) Leave the phone idle for at least 1h and check that there is no battery drain.
If you get any considerable drain (more than 5%/h), check Kernel Wakelocks and Partial wakelocks, or try again with 2G networks only. You may have a baseband problem. Consider this step as your "control group" as it ensures nothing in the hardware or in the ROM is wrong.
If there is no drain, enable WiFi and GPS again, but make sure all this settings are UNCHECKED:
1) Settings->WiFi-> Advanced: "Network notification", "Keep wifi on during sleep" set to "Never", "Scanning always available".
2) Settings->Location->Google Location Reporting: "Location Reporting" set to off and "Location History" set to off. Or just disable Location completely.
3) Check Settings->Security -> Device Administrators -> Disable at least Android Device Manager. If you can, disable everything else in this screen, such as Airdroid, Cerberus, etc
4) App drawer -> Google Settings -> Search -> Set Google Now to Off. You can also configure Android Device Manager here.
Leave the phone idle again for 1h and check BBS. In theory you shouldn't need to recharge completely, just enable the watchdog in BBS. Always check the wakelocks too.
You should get this on BBS:
1) Screen On % very low
2) WiFi On 100% of the time
3) WiFi Running with low % (anything less than 50% is ok, depending on Sync settings and background apps)
4) Awake with low %.
5) Deep Sleep with almost 100%
Go back enabling stuff as needed, one by one, leave the phone idle and check BBS. Rinse and repeat until you find the culprit.
One thing, make sure you do this after letting the phone sync some of the stuff. Don't do this immediately after a setting up a Google account.
Some people also reported that doing a factory reset solves the drains. It's always recommended anyway.
Any other hints are also appreciated.
For people with trouble making BBS work, Try getting the latest version, enable Root in Settings->Advanced and them System App, also in Settings-> Advanced.
Also:
1) When the phone is charging it WILL BE AWAKE WITH BOTH CORES, ALL THE TIME. Depending on the governor used, both cores may even stay at full speed (aka 1GHz). This is BY DESIGN and stock ROMs does that too. So any measurement while the phone is charging is useless.
2) Most "calibration" procedures are myths and don't have any effect. Erasing batterystats.bin also does nothing to increse battery life or remove drains (but may solve some charging issues, still unclear).
Very interesting.. Good thread and good options to test our battery drain ! thanks for the post.
I'll try this when I get home from school, thanks.
Weird thing happened last night, I thought the battery drain was gone when I recalibrated, but my phone discharged over night, weird thing is my settings show the phone didn't go to sleep once during the entire night, even though it was on airplane mode and I had already used it for like 3 or 4 hours with no apparent brain
There is a lot of battery drain only when WiFi in on. Even if the phone is idle.
I'm on:
Maclaw CM 11.0 [20131210]
I8190XXAMJ2
I'll do the exact tests and post my results.
Do you get notifications with wifi set to never during sleep?
RodHQ said:
I'll try this when I get home from school, thanks.
Weird thing happened last night, I thought the battery drain was gone when I recalibrated, but my phone discharged over night, weird thing is my settings show the phone didn't go to sleep once during the entire night, even though it was on airplane mode and I had already used it for like 3 or 4 hours with no apparent brain
Click to expand...
Click to collapse
Use the 1st step I wrote above with BBS. Check Kernel Wakelocks and Partial Wakelocks. You will be able to pinpoint exaclty what is keeping your phone awake.
I was about to start a thread on the same topic but my problem is with Carbon Rom 4.4.2 . The phone never goes into deep sleep and is awake 100% of the time. I'm attaching what I see as the culprit in B.B.S. I already disabled sync and yet the wakeclocks are sync related I hope anyone can help me with this.
i just changed to peagusq everything is fine
BBS How-to
ArtCar said:
I was about to start a thread on the same topic but my problem is with Carbon Rom 4.4.2 . The phone never goes into deep sleep and is awake 100% of the time. I'm attaching what I see as the culprit in B.B.S. I already disabled sync and yet the wakeclocks are sync related I hope anyone can help me with this.
Click to expand...
Click to collapse
Maybe BBS How-to will help you
http://forum.xda-developers.com/showpost.php?p=15869904&postcount=3
If not than post screens and collected dumps on BBS thread
gimme link to maclaw 4.4.2 for s advance
Sent from my GT-I9070 using xda app-developers app
Link
Here you are
http://maclaw.pl/downloads/
same here
eswarvf said:
i just changed to peagusq everything is fine
Click to expand...
Click to collapse
+1
ArtCar said:
I was about to start a thread on the same topic but my problem is with Carbon Rom 4.4.2 . The phone never goes into deep sleep and is awake 100% of the time. I'm attaching what I see as the culprit in B.B.S. I already disabled sync and yet the wakeclocks are sync related I hope anyone can help me with this.
Click to expand...
Click to collapse
Notice that the Count is 0 on both GoogleServices related wakelocks. To me this seems that Chrome and something else (maybe G+?) are trying to sync (perhaps the first one?) but are not getting enough network time/bandwidth to do so. I suggest you connect to an wifi, turn on the sync, and leave the phone awake for a while (try not to use the network very much). See if that solves. If not, backup and factory reset are your friends.
rcoacci said:
Notice that the Count is 0 on both GoogleServices related wakelocks. To me this seems that Chrome and something else (maybe G+?) are trying to sync (perhaps the first one?) but are not getting enough network time/bandwidth to do so. I suggest you connect to an wifi, turn on the sync, and leave the phone awake for a while (try not to use the network very much). See if that solves. If not, backup and factory reset are your friends.
Click to expand...
Click to collapse
I fixed my problem by switching back to dalvik and now my phone only looses about 5% battery overnight.

SprintHiddenMenu aka System Programu Battery Usage

Hi All,
I am a new Nexus 5 owner on T-Mobile and noticed that the phone was getting very poor battery life running stock Android 4.4.4, at least compared to my old Galaxy Nexus (which almost caught fire due to a charging port gone bad).
After rooting and installing the XPosed BatteryStats module and GSam Battery Monitor it appeared that SprintHiddenMenu aka System Programu was having a significant impact on the phone in terms of battery life when the phone should be asleep. Unfortunately revoking the excessive privileges with the 'App Settings' xposed module had little effect on CPU usage.
Eventually I decided to backup the apk to sdcard, remount /system read/write (`mount -o remount,rw /system`), delete /system/app/SprintHiddenMenu.apk and other cache & data files (found with `find / -iname '*hidden*'`), and reboot the phone.
The result has been a phenomenal increase in battery life so far (less than a day granted), going from greater than %5 battery consumption per hour to around or less than %1 per hour when sleeping.
Configuration is with location reporting set to off and battery saving mode, Droid Wall set to block some apps (including Kernel), and Greenify prevents various background apps. Network type is set to LTE and appears to be using very little CPU. Kernel now consumes more CPU on sleep than Android System (SprintHiddenMenu's category). DS Battery Saver might help to extend this further by disabling all network use and periodically wake for traffic.
For unrooted phones experiencing bad battery life you can try to Force Stop the System Programu app and test how that effects longevity. The service will restart on boot, however there is probably an app that can prevent that.
Wasn't able to find this info anywhere else so hope that helps some people that are frustrated with their Nexus 5 battery use.
Cheers!
I installed the xposed module for battery stats. Did the System Progamu show up in the wakelock details? It is listed in my included packages when I click Android System in GSam, but it hasn't been showing up in the wakelock.
PsychDrummer said:
I installed the xposed module for battery stats. Did the System Progamu show up in the wakelock details? It is listed in my included packages when I click Android System in GSam, but it hasn't been showing up in the wakelock.
Click to expand...
Click to collapse
I am not sure, wish I had taken a screenshot, but if your Android System use is higher than Kernel it is likely due to System Programu. Honestly I have no desire to install it again and check. I think it showed up with DS Battery Saver logs and is at the top of the list for Manage in GSam under Android System when it is causing high battery usage. Should have checked Net Logs also for more info on what was being sent.
A little rant about this program, best case it is trying to send usage statistics to the vendor (use of what? everything on the phone? how do I disable that? no opt-in or opt-out?). Worse case it is an intentional built-in back door and monitoring system, the app has access to everything on the phone and virtually no user interface other than jumping through hoops to create them. If I were a government agency trying to extract data or a malicious person designing a method to circumvent security I would look at System Programu.
Or even if it really is a misbehaving app designed as a developer tool then it was totally destroying my battery life, and as a developer I have no use for it.
YMMV though, simply perform a Force Stop on System Programu and see if your battery life is better when sleeping.
*Edit:
And maybe I am entering into crazy guy territory but I find it interesting that SprintHiddenMenu and System Programu both start with the letter S and end with the U. su indeed....
alphamerik said:
I am not sure, wish I had taken a screenshot, but if your Android System use is higher than Kernel it is likely due to System Programu. Honestly I have no desire to install it again and check. I think it showed up with DS Battery Saver logs and is at the top of the list for Manage in GSam under Android System when it is causing high battery usage. Should have checked Net Logs also for more info on what was being sent.
A little rant about this program, best case it is trying to send usage statistics to the vendor (use of what? everything on the phone? how do I disable that? no opt-in or opt-out?). Worse case it is an intentional built-in back door and monitoring system, the app has access to everything on the phone and virtually no user interface other than jumping through hoops to create them. If I were a government agency trying to extract data or a malicious person designing a method to circumvent security I would look at System Programu.
Or even if it really is a misbehaving app designed as a developer tool then it was totally destroying my battery life, and as a developer I have no use for it.
YMMV though, simply perform a Force Stop on System Programu and see if your battery life is better when sleeping.
*Edit:
And maybe I am entering into crazy guy territory but I find it interesting that SprintHiddenMenu and System Programu both start with the letter S and end with the U. su indeed....
Click to expand...
Click to collapse
I'm just trying to figure out if I have the issue in the first place. If I leave my phone overnight, it only goes down by about 2-3% in 8 hours. During the day though is when the drain during sleep becomes higher.
PsychDrummer said:
I'm just trying to figure out if I have the issue in the first place. If I leave my phone overnight, it only goes down by about 2-3% in 8 hours. During the day though is when the drain during sleep becomes higher.
Click to expand...
Click to collapse
Best way to figure out if it is having an effect on your battery life is just to Force Stop and see what happens, collect new battery stats.
It is a useless app, some people use it for the RTN functionality, which I have no use, and it was clearly trying to do stuff that I was not asking it to.
alphamerik said:
Best way to figure out if it is having an effect on your battery life is just to Force Stop and see what happens, collect new battery stats.
It is a useless app, some people use it for the RTN functionality, which I have no use, and it was clearly trying to do stuff that I was not asking it to.
Click to expand...
Click to collapse
If you're not on Sprint I don't think there's any issue with just deleting the .apk. Lol
Lethargy said:
If you're not on Sprint I don't think there's any issue with just deleting the .apk. Lol
Click to expand...
Click to collapse
From what I have read this actually provides the RTN menus on GSM phones that automatically work on CDMA networks like Sprint. It smells like evil though with all that extra functionality.
If I remember right the app was LG branded, and exists on phones other than the Nexus 5.
alphamerik said:
From what I have read this actually provides the RTN menus on GSM phones that automatically work on CDMA networks like Sprint. It smells like evil though with all that extra functionality.
If I remember right the app was LG branded, and exists on phones other than the Nexus 5.
Click to expand...
Click to collapse
I deleted it from my ROM as I'm in Australia and have no need for it
It was causing a pointless wakelock on my device which is why I removed it in the first place.
alphamerik said:
Best way to figure out if it is having an effect on your battery life is just to Force Stop and see what happens, collect new battery stats.
It is a useless app, some people use it for the RTN functionality, which I have no use, and it was clearly trying to do stuff that I was not asking it to.
Click to expand...
Click to collapse
I don't think it ever runs on my phone. I tried to force close it and it's greyed out. I've been checking for the past couple of hours and it seems like it's not running. I did try to greenify before force close, but I de-greenified it. So I guess it might come back when something triggers it. However, my Android system does use more than the kernel.

[MOD][TOOL] MaxLife v1.0.9c - Battery Lifetime Extender

If your are using LP or MM and having issues, please check out the detailed guide from @the_poolee, right below the downloads
This is a native program for Android that addresses the wear done on Lithium-ion batteries by prolonged elevated voltage, high-resistance, and high heat charging. With lithium-ion batteries it is recommended to not quite charge to full capacity or keep the battery on the charger at an elevated voltage for lengths of time because making this a regular practice will rapidly degrade the battery.
Using apps that alert you that charging has completed or is 90% complete may be helpful but aren't always practical or convenient, such as over night charging, or as in my case a phone case with built in battery that charges itself and the phone at the same time, but it charges much more slowly and keeps the phones battery voltage elevated even after the phone has reached 100%.
I created MaxLife to make the handling of said situation convenient and entirely automatic. MaxLife runs as a background system service that interacts with the power_supply subsystem. Using a value chosen by you for the target battery percentage (or 90% default if not provided) monitors how far along your charge is until either you've disconnected the power source or your battery has charged to the target level you set. Upon reaching the target it stops the charging of the battery (even though the charger IS still connected) and suspends charging for a minimum of 15 minutes. After 15 minutes have passed however it still will not restart charging until the battery has fallen below your desired charge level.
This is perfect for trading a small amount of the battery's capacity for a longer and more reliable life of operation. Aside from keeping your battery's charge capped at the desired level it also beats the shortcomings of having to leave your phone unplugged overnight by assuring that it will be charged to the chosen percentage when you're ready to use it not leaving you with a potentially discharged battery due to overnight idle drain (whatever the cause may be e.g. wakelocks).
Prerequisites:
• init.d support
• custom recovery
• Qualcomm device
• A fairly complete busybox install. Toolbox and toybox won't cut it.
INSTALLATION:
Setting it up is simple. At the bottom of this post will be a recovery flashable zip. It installs two files onto your system partition: the MaxLife binary and an init.d script. To choose your target battery percentage first install the package, and use the settings editor described below (title of that section is in bold) (default is 85 in init script and tool is hard coded to 90 if no value or an invalid one is supplied).
New Feature:
Built in settings editor
Optional settings file
Live settings changes (no reboots)
Auto-BattStat Reset
Charge Rate Control
MaxLife now accepts a second argument to set the rate of charge (by changing the input current that is accepted). Valid values are slow, normal, and turbo. If no second argument is supplied in the init.d script or on the command line MaxLife defaults to "normal" (which means no change, system default). The default value in the installer zip is "slow".
slow- Will take somewhat longer to charge, but the battery will remain much cooler during charging and it places less stress on it, prolonging its operational life.
normal- Nothing is adjusted. Equivalent to leaving the option blank.
turbo- Fast charging for those scenarios where time is valuable and you need to get as much into your battery as fast as you can. Hotter charging temperature and more stress/risk to battery and charging components. Recommended to be used sparingly.
This parameter can be set in the init.d script just like the percentage setting.
NEW BUILT-IN SETTINGS EDITOR
There is also now a very straightforward and self-explanatory GUI with MaxLife for settings management now.
To change the settings override/live settings file from MaxLife itself from the command line, just use a terminal app and (as root/superuser) run:
Code:
maxlife set 70 slow
or
Code:
maxlife set slow 70
The options after set can be in either order and equally valid. If your settings are invalid you will get an error message saying so, otherwise it'll display an output of the newly applied settings. REMEMBER: It only takes options in lower case.
IMPORTANT:
If you do edit 91bms, please be sure your text editor is saving the file using UNIX text format. Other formats break the installation. I use the built in editor in ES File Explorer as my editor of choice because it let's you see what format you are saving text files in.
Uninstall:
Delete /system/etc/init.d/91bms and /system/bin/maxlife
This tool is very safe in its interactions with your device, but I am not liable for anything that happens to your device.
It is tested and confirmed working on the Moto G and ZTE Speed both running 4.4.4; however it was designed with the goal of Lollipop/Marshmallow compatibility as well as compatibility with any Qualcomm chip set, so if anyone wants to help test and confirm all and any aspects of compatibility feel free to lend a hand.
LICENSE:
By downloading and/or using MaxLife, you are showing that you accept the terms of this license.
This project is my own proud work, so please be respectful and do not redistribute, sell, modify, or reverse engineer the MaxLife binary and the data contained therein in any form or manner without first acquiring my permission and also giving due credit upon redistribution after receipt of my permission.
This software is being provided free of charge with no guaranteed nor implied warranty. I also hold no responsibility or liability for any damages direct or indirect that come to your person, property, or device from the use of MaxLife.
I also retain the right to modify the terms of this license at any time without having to give any notice of modification.
ENJOY!!!
MaxLife v1.0.9c Unified:
(UNINSTALL older GUI like normal app first)
https://drive.google.com/file/d/0B_hgNZE_j5sVVkJPM2hnWFVId1E/view?usp=drivesdk
If your are using LP or MM and having issues, please click below to open a detailed guide from @the_poolee
From the_poolee:
Well as our beloved @elrod16 seems rather hesitant to upgrade to later android versions, he asked me to do a post regarding proper setting for Maxlife in LP/MM. I should clarify beforehand that I'm no dev nor do I have any coding knowledge. I just happened to find a solution for a persistent issue that most of us on LP/MM faced. And if it matters, I'm currently on CM13 (Android 6.0.1 Marshmallow), with Maxlife v1.0.7. I don't have Xposed or other addons, except for Greenify, working in Root mode. So here it goes....
The first and foremost thing to remember is that Maxlife doesn't have any front end UI with quick toggles @elrod16 seems to be working on it). But it doesn't mean that the actual stuff that works behind screens is completely hidden from root level apps like Greenify and native Doze in MM. And therein lies the core problem.
Since CM13 got some issues with init.d(as per my understanding, it doesn't have it), I used the terminal commands. The charging rate setting and even charge level setting, all worked. My sole issue, then, was that under an unattended night-charge session, the charging went beyond the set values. Since everything was okay in the short-run trial, I assumed something was messing up in the extended session. I couldn't think of anything other than Greenify and Doze at that moment.
In Greenify for MM, there are Shallow Hibernation and Aggressive Doze options. And of course, Automatic Hibernation is also there. Like any other battery - life - caring - guy out there, I had all of these options turned ON. Talking about Doze, it is another factor that may mess with proper Maxlife working. But as per my understanding, doze mode doesn't kick in when connected to a charger. The extra Doze setting in Greenify is just an extension of the normal Android back-end doze,wherein Aggressive Doze puts the device into doze faster than usual, but again, not when charging. Besides, @elrod16 had done some tweaks to ensure that Maxlife is not suspended unnecessarily in Doze(via wakelock). So doze cannot be the culprit. Even then, I tried turning each one off, and voila, guess what, as soon as I turned off Automatic Hibernation in Greenify, Maxlife settings persisted - charging never went beyond the set limits - even through full night charge sessions. I just solved the issue then and there. But I should add that for guys using Greenify in Xposed mode, the behaviour may be different.
In a nutshell, my observation is that apps like Greenify may interfere with Maxlife and hence, make sure that all of them are disabled, or at least, their automatic modes are disabled. Doze may not have been the problem child in my case, but even then, try turning off such Aggressive doze options or instant doze modifiers, if nothing else works.
NOTE: auto charge resume may not work with portable chargers because they often power down after the connection is dropped.
Also any relevant feature suggestions, bug reports, or other design suggestions are always welcome.
Changelog:
v1.0.9c- Split the engine and GUI into separate downloads until this issue with flashable updates and the GUI is resolved. The engine has also been tweaked so that resource hungry apps running in the forground are less likely to make MaxLife miss its target because it was forced to wait for its turn to run. It adjusts its niceness and I/O priority to accomplish this.
v1.0.9a- Now every 10 boots MaxLife forcea the battery guage to synchronize with the battery's internal reading to prevent drift in readings from not allowing full charge cycles.
v1.0.8a- Graphic user interface added with bug in mode setting in test version of UI fixed.
v1.0.7- Rolled the charge delay back to 15 minutes. Improved the wakelock code so that during the charge delay time if you disconnect your device from the charger it'll release the wakelock but continue counting the delay. Old versions the wakelock stayed on during the charge delay whether the device was connected or not.
v1.0.6- Lowered the charge waiting delay to 3 min. MaxLife now keeps the device from suspending while connected to a power source. This is experimental and aimed at fixing the issues with deep sleep. MaxLife has its own settings editor now for the live settings feature. Eliminates any possibility of the file being saved in DOS format.
V1.0.5a- Fixed a bug in a block of code shared between MaxLife and MaxOpt where data wasn't being thoroughly validated before being used.
v1.0.5- Now whenever the settings are changed using the new "on the fly" way, an update of the new settings is written out to logcat, just useful for individual debugging or troubleshooting. This message is at the Verbose priority/level/filter in logcat.
v1.0.4b- When launched from a terminal app (such as for testing) MaxLife now prints out the settings it initially detected and will use. There is also a new way of configuring the settings that also allows "live" changes, changes that will take effect without a reboot or restarting the tool.
v1.0.3- MaxLife now automatically resets your system battery usage stats when it hits the charging cutoff set point. The settings app battery page should no longer endlessly fill up.
v1.0.2- Added a kernel level suspend block (rather than app runtime PowerManagerService.Wakelocks) to fix issue of the tool missing the charge cutoff from deep sleep. Suspend block is released as soon as charging is stopped or charge cutoff is met. Changed default percentage in init.d script to 85.
v1.0.1b- Fixed a small mistake in the installer zip layout.
v1.0.1- Introduced charge speed setting. Details above in post in "New Feature" section.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
I always leave my phone to charge overnight. Flashing it now on Exodus 5.1.1.
For me it didn't worked , charging didn't stoped at 90%
---------- Post added at 01:48 AM ---------- Previous post was at 01:47 AM ----------
Resurrection remix custom rom lp 5.1.
Xt1033 Dual Sim.
BhavikRB said:
For me it didn't worked , charging didn't stoped at 90%
---------- Post added at 01:48 AM ---------- Previous post was at 01:47 AM ----------
Resurrection remix custom rom lp 5.1.
Xt1033 Dual Sim.
Click to expand...
Click to collapse
Was the phone booted? Also some devices the charging icon may stay on but the device is in fact not accepting charge and the percentage wont rise.
Running "ps | grep maxlife" in Terminal app should show if it is running. If it isnt running try running "maxlife 90“ or such in the terminal and see if it does launch or returns an error.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
If anyone is having any issues with this tool please inform me of the issue, your ROM, kernel, and any other charging/power management apps you have installed. Troubleshooting/debugging is an interactive process, no program is perfect, but providing me with your bug reports and helping me test new updates and fixes gets us one step closer and helps me provide the functionality you were looking for.
On the other hand if this program did help you, please hit the thanks button and help keep motivation to continue development strong thanks everyone
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Hi, suscribed to your topic for following ...will surely try your tool soon and keeping you informed...
Thanks for your work and keep your motivation strong
After flashing the 91bms is not in the int.d file
Ohhdayumm said:
After flashing the 91bms is not in the int.d file
Click to expand...
Click to collapse
It looks like i made a goof when packaging the installer zip. The link in the OP has already been updated, see if that one flashes correctly for ya.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
elrod16 said:
It looks like i made a goof when packaging the installer zip. The link in the OP has already been updated, see if that one flashes correctly for ya.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Click to expand...
Click to collapse
no problem Ill try it when I have time today and I'll tell you if it works thanks for the work!
Hi thanks for the script! It does work the charging stopped at 89%
This only works on moto g?
Ohhdayumm said:
This only works on moto g?
Click to expand...
Click to collapse
No, in theory it should work on a variety of Qualcomm based devices. I can confirm that the ZTE Speed is definitely supported.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Which value do you recommend for better battery life?
abeloman said:
Which value do you recommend for better battery life?
Click to expand...
Click to collapse
For the best battery longevity I'd probably use "70 slow" but for a good balance of longevity and capacity I'd probably use either "85 slow" or the default settings.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Its really working
@elrod16 :
And if you want to remove it totally ? Enough to let it in place and change value to 100, for example ? (just an idea, i'm testing it for moment, don't want to remove it yet )
One more : Nice, that selection of charging modes...just a little bit difficult for those who don't know how to edit a file. GUI, maybe, or best solution, integration in a kernel and settings avaible in Kernel Adiutor (or any other apk) ???
satanas17 said:
@elrod16 :
And if you want to remove it totally ? Enough to let it in place and change value to 100, for example ? (just an idea, i'm testing it for moment, don't want to remove it yet )
One more : Nice, that selection of charging modes...just a little bit difficult for those who don't know how to edit a file. GUI, maybe, or best solution, integration in a kernel and settings avaible in Kernel Adiutor (or any other apk) ???
Click to expand...
Click to collapse
Hey thanks for testing! To effectively disable it without removing any files you could change the settings to "100 normal" and to actually uninstall it, delete /system/etc/init.d/91bms and /system/bin/maxlife. Those two files are the whole mod.
I would like to make GUI's for my different mods I've posted :/ but alas, my phone is my development environment, so if it can't be made with GCC I can't do it. However....I think Tasker App Factory could be able to cook something up that could handle a simple task like editing those settings, so when time allows, I will probably go that route. Thanks for the input and suggestions
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Working perfectly on Resurrection Remix LP Final Build. Thank You.
Moto G XT1033
elrod16 said:
Hey thanks for testing! To effectively disable it without removing any files you could change the settings to "100 normal" and to actually uninstall it, delete /system/etc/init.d/91bms and /system/bin/maxlife. Those two files are the whole mod.
I would like to make GUI's for my different mods I've posted :/ but alas, my phone is my development environment, so if it can't be made with GCC I can't do it. However....I think Tasker App Factory could be able to cook something up that could handle a simple task like editing those settings, so when time allows, I will probably go that route. Thanks for the input and suggestions
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Click to expand...
Click to collapse
You"re welcome
One more suggestion :
Put the tips for uninstall in OP...
elrod16 said:
This is a native program for Android that addresses the wear done on Lithium-ion batteries by prolonged elevated voltage, high-resistance, and high heat charging. With lithium-ion batteries it is recommended to not quite charge to full capacity or keep the battery on the charger at an elevated voltage for lengths of time because making this a regular practice will rapidly degrade the battery.
Using apps that alert you that charging has completed or is 90% complete may be helpful but aren't always practical or convenient, such as over night charging, or as in my case a phone case with built in battery that charges itself and the phone at the same time, but it charges much more slowly and keeps the phones battery voltage elevated even after the phone has reached 100%.
I created MaxLife to make the handling of said situation convenient and entirely automatic. MaxLife runs as a background system service that interacts with the power_supply subsystem. Using a value chosen by you for the target battery percentage (or 90% default if not provided) monitors how far along your charge is every 30 seconds until either you've disconnected the power source or your battery has charged to the target level you set. Upon reaching the target it stops the charging of the battery (even though the charger IS still connected) and suspends charging for a minimum of 15 minutes. After 15 minutes have passed however it still will not restart charging until the battery has fallen below your desired charge level.
This is perfect for trading a small amount of the battery's capacity for a longer and more reliable life of operation. Aside from keeping your battery's charge capped at the desired level it also beats the shortcomings of having to leave your phone unplugged overnight by assuring that it will be charged to the chosen percentage when you're ready to use it not leaving you with a potentially discharged battery due to overnight idle drain (whatever the cause may be e.g. wakelocks).
Prerequisites:
• init.d support
• custom recovery
• Qualcomm device
INSTALLATION:
Setting it up is simple. At the bottom of this post will be a recovery flashable zip. It installs two files onto your system partition: the MaxLife binary and an init.d script. To choose your target battery percentage first install the package, remount system as RW by whatever means you want, using a file explorer navigate to /system/etc/init.d, open the file 91bms, and change the number within to whatever you choose (default is 90 in init script and tool is hard coded to 90 if no value or an invalid one is supplied).
New Feature:
Charge Rate Control
MaxLife now accepts a second argument to set the rate of charge (by changing the input current that is accepted). Valid values are slow, normal, and turbo. If no second argument is supplied in the init.d script or on the command line MaxLife defaults to "normal" (which means no change, system default). The default value in the installer zip is "slow".
slow- Will take somewhat longer to charge, but the battery will remain much cooler during charging and it places less stress on it, prolonging its operational life.
normal- Nothing is adjusted. Equivalent to leaving the option blank.
turbo- Fast charging for those scenarios where time is valuable and you need to get as much into your battery as fast as you can. Hotter charging temperature and more stress/risk to battery and charging components. Recommended to be used sparingly.
This parameter can be set in the init.d script just like the percentage setting.
This tool is very safe in its interactions with your device, but I am not liable for anything that happens to your device.
It is tested and confirmed working on the Moto G and ZTE Speed both running 4.4.4; however it was designed with the goal of Lollipop/Marshmallow compatibility as well as compatibility with any Qualcomm chip set, so if anyone wants to help test and confirm all and any aspects of compatibility feel free to lend a hand.
This project is my own proud work, so please be respectful and do not redistribute MaxLife in any form or manner without first acquiring my permission and also giving due credit.
ENJOY!!!
MaxLife v1.0.1b
https://drive.google.com/file/d/0B_hgNZE_j5sVaURLeXpDNUYyTkk/view?usp=docslist_api
NOTE: auto charge resume may not work with portable chargers because they often power down after the connection is dropped.
Also any relevant feature suggestions, bug reports, or other design suggestions are always welcome.
Changelog:
v1.0.1b- Fixed a small mistake in the installer zip layout.
v1.0.1- Introduced charge speed setting. Details above in post in "New Feature" section.
---------------------------------------------------
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Click to expand...
Click to collapse
How to roll back changes? My phone is lagging after flashing this zip in my moto g1(falcon) in marshmallow.

Question Battery drain on Galaxy A33

Hello everyone!
I recently bought the Samsung A33 5G, but I'm having battery problems and I don't know what it could be.
Using, for example, WhatsApp or Twitter I spend approximately 3% every 5 minutes using Wifi and with the brightness at 20%.
I have monitored the battery with apps like Battery Guru and AccuBattery but I have not seen anything strange. I have also tried to wipe the cache partition from the recovery and repair the apps but it has not improved either. I've also disabled battery optimization (seen it on reddit and some have found it helpful) but it still doesn't get any better. I replaced the phone but the problem persists.
Somebody can help me?
Thank you!
Battery consumption is strongly dependent on the size and type of screen, services used, distance from the GSM mast. There is a long way to go to get your phone to use less battery. For starters, try using a Wi-Fi connection for a while, without using GSM. The next step is to turn off LTE/5G and stay on a slow but less draining 2G/3G battery.
By the way, disable unnecessary services with Debloat Tool, mainly updates and sending notifications by applications that you do not need.
[TOOL] ADB AppControl 1.8.0 🚀 Ultimate App Manager & Debloat Tool + Tweaks
ADB AppControl 🚀 Root is not required. Works with any Android device. Can do almost everything you dreamed about with applications. ADB AppControl - the desktop program, that will allow you to easily manage applications on your android device...
forum.xda-developers.com
ze7zez said:
There is a long way to go to get your phone to use less battery.
Click to expand...
Click to collapse
Please could you explain it to me whenever possible. I am a keen learner.
DIEGO LITTLELION said:
Hello everyone!
I recently bought the Samsung A33 5G, but I'm having battery problems and I don't know what it could be.
Using, for example, WhatsApp or Twitter I spend approximately 3% every 5 minutes using Wifi and with the brightness at 20%.
I have monitored the battery with apps like Battery Guru and AccuBattery but I have not seen anything strange. I have also tried to wipe the cache partition from the recovery and repair the apps but it has not improved either. I've also disabled battery optimization (seen it on reddit and some have found it helpful) but it still doesn't get any better. I replaced the phone but the problem persists.
Somebody can help me?
Thank you!
Click to expand...
Click to collapse
Turn off ram plus for better battery backup

Categories

Resources