2

I use AccuBattery and Kaspersky Battery Life to measure energy consumption. Kaspersky Battery Life shows, that all the tasks use minimal energy. AccuBattery Pro shows, that phone uses 5-10 mAh. This is a fairly new, 3000 mAh battery. Phone is a THL T9 Pro, Android 6.0 is installed on it.

UPDATE: I deleted all the mentioned applications and installed new one, GSam Battery Monitor to get detailed data:

gsam screen

There is data from the built-in usage chart too. I checked applications under Battery optimization, I found there only one, Google Play Services.

built-in chart

  • Please check battery usage in settings rather than Accubattery and kaspersky(may be they are draining the most). – Rahul Gopi Mar 2 '18 at 9:38
  • @RahulGopi : Most of the usage is in "Phone - idle". – plaidshirt Mar 6 '18 at 9:23
  • As it was mentioned earlier, I deleted these apps, because maybe these are draining the most. I checked phone's built-in stats/chart. "Phone idle" uses 1355 mAh. Phone is up 13 hours 35 minutes ago. – plaidshirt Mar 6 '18 at 12:26
  • @beeshyams : I updated my question. – plaidshirt Mar 6 '18 at 14:00
  • We would also need to see GSAM running for a longer period of time. Make sure you enabled extended reporting via ADB. plus.google.com/+GeorgeTanner/posts/gT5f7XntmEu but at first glance it appears your device is not "sleeping" properly, this is usually due to an ill-behaved application and something like WakeLock Detector would give more information as to the real cause. – acejavelin Mar 6 '18 at 16:48
6
+50

How to nail Phone Idle battery drain is the question, but being unrooted device, it calls for some efforts. Finding the culprit apps isn't as easy as it is on rooted devices but is possible using commands to enable higher privileges 1

(At the time of writing, OP is working on his Linux to detect his device 2. Once done with that, they can follow this answer.)

The primary cause of idle drain is truant (s) and the answer is around how to detect apps that cause wakelocks that hurt (Wakelocks aren't bad, they are needed but not such ones). It may help to improve performance but more about that later.

All methods below are working on my unrooted device running Oreo 8.0.

Tracking truant apps that cause battery draining wakelocks

  • Measuring Battery Drain and first level wakelock detection

Battery usage statistics in Android, unfortunately, don't reveal much and are difficult to interpret (not withstanding the improvements in Oreo). GSam Battery Monitor is arguably the best for stock devices. One needs to enable enhanced statistics (Menu → more → Enable more stats) and follow the steps which are

adb -d shell pm grant com.gsamlabs.bbm android.permission.BATTERY_STATSmust read 3

For the PRO version, change 'com.gsamlabs.bbm' to 'com.gsamlabs.bbm.pro' (thanks acejavelin).

The enhanced statistics gives better view of app usage and wakelocks as shown. Long press of held awake (which in OP's case is 77%) shows additional information as shown in the third screenshot.

enter image description here enter image description here

  • Second level bad wakelock detection (One can optionally start with this step)

Download Wakelock Detector [LITE] (XDA thread) which works without root (see this slideshare for details). Two ways to run without root

  • As a Chrome extension or on Chromium. OP had issues with this

  • A better method is adb again

adb shell pm grant com.uzumapps.wakelockdetector.noroot android.permission.BATTERY_STATS

How to use (from Play Store description)

  • Charge your phone above 90% and unplug cable (or just reboot the phone)

  • Give it a time (1-2 hours) to accumulate some wakelock usage statistics

  • Open Wakelock Detector

  • Check the apps on the top, if they show very long wakelock usage time then you found the cause of your battery drain!

While 2 hours is enough to gather the information about top culprits, longer duration obviously leads to more data. During data collection, don't use the device and let it be as you would normally use the phone (with data or WiFi connected as is your normal usage). Screenshots below from my device (not under test but normal usage).

Left to right, they show Screen Wakelock, CPU Wakelock and Wakeup triggers. Check the top contributors to understand what's draining your battery.

enter image description here enter image description here enter image description here

Eliminating the bad apps or controlling them

Once you have identified the culprits, you have three choices

Taming wakelocks and improving Doze

Greenify is a fantastic app but very powerful so needs to be used carefully. Read the XDA thread and Greenify tag wiki for help.

I will limit to using adb to unleashing a fair part of its power to help rein in wakelocks and enhancing Doze performance.

A word about Doze, which was introduced since Marshmallow. Though it has evolved better, it has some drawbacks from battery saving point of view.

  • It takes time to kick in, during which apps are active causing drain (even though screen is off)

  • Doze mode is interrupted when you move the device, for example, when you are moving causing battery drain. Doze kicks in again when you are stationary with a wait period

Greenify tackles these problems with Aggresive Doze and Doze on the go (There are other apps that do this too, like ForceDoze, but Greenify manages both Wakelocks and Doze).

Instructions for using adb

For different features, you need to run adb commands to grant the corresponding permission:

  • Accessibility service run-on-demand:

    adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS

  • Aggressive Doze on Android 7.0+ (non-root):

    adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS

  • Doze on the Go:

    adb -d shell pm grant com.oasisfeng.greenify android.permission.DUMP

  • Aggressive Doze (on device/ROM with Doze disabled):

    adb -d shell pm grant com.oasisfeng.greenify android.permission.DUMP

  • Wake-up Tracker:

    adb -d shell pm grant com.oasisfeng.greenify android.permission.READ_LOGS

  • Wake-up Cut-off: (Android 4.4~5.x):

    adb -d shell pm grant com.oasisfeng.greenify android.permission.READ_LOGS

    adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS

Background-free enforcement on Android 8+ (non-root):

adb -d shell pm grant com.oasisfeng.greenify android.permission.READ_APP_OPS_STATS

I will restrict to snapshots of settings from my device to help set it up faster after running adb commands above. I have pro version so ignore those donation settings

enter image description here enter image description here

With those settings, even when the device is running, you will see a hibernation alert in your status bar with the app icon and in your notification panel. Clicking on that will force close and hibernate the app

enter image description here

You can also hibernate errant apps from Wakelock Detector by long pressing on the app

enter image description here

Caution: Be very careful with what you want to hibernate. Simple rule - don't hibernate apps that are critical to you. Hibernate you errant apps that are not critical

Edit

BetterBatteryStats (XDA thread) is a very powerful tool which has been recently (end Feb 18) updated to work with Oreo and sweeter still is that escalated privileges using adb is possible

adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS

adb -d shell pm grant com.asksven.betterbatterystats android.permission.DUMP

On Lollipop and forward, additionally run: adb -d shell pm grant com.asksven.betterbatterystats android.permission.PACKAGE_USAGE_STATS

enter image description hereenter image description here

Happy Wakelock hunting!

  • I've done everything you suggested but it didn't help

It's likely that a system app is causing the Wakelocks for which there isn't much you can do on an unrooted device 4



  • I tried to install necessary Chrome plugin on Windows too, so I installed ADB driver on Windows too. It says, installation is OK, but Chrome plugin cannot find device. Please check screenshot: prntscr.com/ip2xsi – plaidshirt Mar 9 '18 at 21:45
  • 1
    Follow this guide or a detailed video for your OS or take help from somebody locally to get ADB installed and correctly working. Sorry but I can't help on this remotely. It's faster to take local help – beeshyams Mar 10 '18 at 0:37
  • Or find somebody who has ADB running on their device and run these instructions after installing them. You can at leisure sort out the ADB problem – beeshyams Mar 10 '18 at 6:15
  • I found the problem in that guide. "Change the USB mode to “file transfer (MTP)” mode." I can't do this, device couldn't change method after I selected it. – plaidshirt Mar 10 '18 at 7:36
  • Enable Developer options by tapping build number 7 times (from your settings likely in about phone). You will find a new item developer options in your settings. In that choose USB options > MTP. – beeshyams Mar 10 '18 at 8:21
1

if you want to just use adb to tune Doze without extra Apps.

you might be interested in https://github.com/easz/doze-tweak

and if you don't want to install extra Apps, you can profile your battery with adb bugreport and analyze it with Battery Historian (e.g. https://bathist.ef.lc/). After identifying bad Apps, you can disable or restrict them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.