How to Enable Aggressive Doze Mode for Marshmallow
By default, you will get Doze mode (works in the background, not visible UI) on most marshmallow ROM's (unless developer restricted). Marshmallow's new features actually do save battery after marshamallow api 23)
Aggressive doze mode optimizes apps more often to save more battery, here is how to enable aggressive doze mode on the marshmallow. Also greenify testing shallow hibernation for non-root users.
For Root Users
1. You'll need to root your android first.
2. Go to greenify play store page and opt for greenify beta testing, to get latest greenify version.
3. Install greenify, go to its setting and tick the option that says aggressive doze.
4. Install Doze editor by default the timing parameters, doze mode uses is quite longer. You can decrease (or reverse) timing intervals by using doze editor /© android trending.
5. Don't make time interval so less, just to save battery. Use
Helpful link - disable doze on marshmallow.
disable the modz mode.
For Non root Users
Conbnect your ohone via USB cable, Setup ADB on your Computer enable USB debbuging mode and typethe following command to check connected devices to your computer.
If that returns a series of letters and numbers, you're all set. Now type the following command to enable Greenify's new "Aggressive Doze" feature on your non-rooted device:
adb -d shell pm grant com.oasisfeng.greenify android.permission.DUMP
For more information and for truoubleshooting read the developer's guide of enabling agg doze mode.
Helpful Comments over internet
Unfortunately, it still requires that your phone is laying flat and motionless. Basically, it just causes Doze to run its sensor checks as soon as you turn your screen off as opposed to waiting 30 minutes, but everything else remains the same. This can still be greatly beneficial for some folks, but it may not help much depending on how you use your phone.
For instance, if you activate Aggressive Doze through Greenify, then leave your phone on a table, it will enter low-power mode almost immediately. But if you keep in in your pocket, Greenify will make Doze run its sensor checks as soon as you turn your screen off, but it will see that you're moving around and decide not to kick in.
There's still a lot to learn about how Doze works under the hood since Google didn't provide much documentation, so hopefully someone can figure out a way to bypass the sensor checks eventually.