[X Style (Pure) General] rehpyc:
I've been getting quite a few messages as of late, after sharing battery results for a particular ROM or kernel, asking how I'm achieving such good battery results, so I've decided to update this aged thread that's become buried. Let me start by saying that those who complain that Xposed itself causes a heavy amount of drain are either naive with a particular module they're using causing the drain or are just part of an unlucky few who's phone doesn't like Xposed that runs fine for so many others. A second thing to note, if you spend a lot of time in an area that has pretty poor reception (especially orange/red under the battery details), it'll be hard for you to get exceptional battery life; poor reception simply drains the battery quite a bit. Lastly, watching a lot of YouTube videos or playing games often will never let you get amazing battery life, especially with the GPU this phone uses. While I will watch the occasional movie trailer on YouTube and watch a few Facebook videos, I don't watch TV episodes or play games much at all. I do, however, stream music quite often.

With that said, let's get started. The goal here is to limit how much your phone stays awake with the screen off, so that battery life is primarily being saved for the times you're actually using your phone.

The Basics

Wi-Fi:

» Make sure to have "Keep Wi-Fi on during sleep" set to Always (Settings > WiFi > 3dot menu > Advanced)

Display:

» Turn Adaptive brightness off (Settings > Display)

» Turn Ambient display off (a notification sound is enough for me, but can use this if you like your phone's screen to turn on)

Location:

» Most people will turn this off, and if you don't use location much you may as well. There's a misconception that it's a big battery hog while it's on, but that's only marginally true. It's a hog if you allow apps to use it in the background and not just when you want to use it with Maps, Chrome, Speed Test, etc. If you keep the apps in check, location is typically only used when you want it to be.

» Do turn Google Location History off at the bottom

» Turn Wi-Fi scanning and Bluetooth scanning off (3dot menu > Scanning)

Moto App:

» Under Actions, turn Approach for Moto Display off. While you may keep this on for convenience, it seemed that the phone's screen would turn on much more than I would ever intend it to. Given that apps would randomly be open after the phone has been in my pocket, it seems the screen may consistently turn on while in your pocket.

» All other Actions, options under Assist, and Voice listening are good to use with negligible battery consumption!

» NOTE: I personally keep Wi-Fi, Bluetooth, and location on at all times. Each of them consume negligible amounts of battery when not in use, and it's more convenient for me to just keep them on. I especially keep location and Bluetooth on for convenience when driving in the car. I do intend to find/write some Tasker scripts to control turning them on/off, though that'll come at a later time. If you rarely use Bluetooth, turn it off to same some juice.

Disable apps not needed

There's quite a few apps and language packs that could actually be disabled entirely. You can disable apps by going to Settings > Apps. Below is my list, so make sure to not disable something you use. Disabling the app(s) just means one less app to have to worry about misbehaving in the background. What's available will be dependent on if you're running stock or a custom ROM, as the ROM may already have some of these already removed.

» Android Live Wallpapers

» Android System WebView

» Audio Effects

» Bubbles

» Cloud Print

» Connect

» Docs

» Email (I use Gmail)

» Emergency Alerts

» Exchange Services

» Help

» Google Hindi Input

» Google Japanese Input

» Google Keyboard (I use Swiftkey)

» Google Korean Input

» Google Pinyin Input

» Google Play Movies & TV

» Messaging (if you have an alternative installed)

» MotoCare

» MotoCareInt

» Motorola Checkin

» Motorola Migrate

» Motorola Update Services

» Print Spooler

» Sheets

» Slides

» Tags

» Talkback

Now to the fun stuff..

Downloads

Better Battery Stats: HERE

Xposed: Installer and framework HERE (For MM use sdk23 arm64)

Amplify: HERE (You'll want to make a small donation to enable everything)

Greenify: HERE

Power Nap: Download from Xposed repository

*Note: Amplify, the best parts of Greenify, and Power Nap require the use of Xposed!

Have everything downloaded and installed? Good. Let's begin.

Amplify

Amplify is going to take care of how often wakelocks, alarms, and services can run on your phone. You'll want to make a small donation ($2) to the developer in order to unlock the full potential of the app. You'll want to search for each of the things below and limit them as specified in parentheses. A lot of credit for a majority of the list goes to THIS thread, with what actually applies to our phones, and the rest coming from my own testing.

Wakelocks:

» *net_scheduler* (7200)

» ConnectivityService (7200)

» GCoreFlp (7200)

» LocationManagerService (40000)

» NetworkStats (800)

» NfcService:mRoutingWakeLock (7200)

» NlpWakeLock (86400)

» NlpCollectorWakeLock (86400)

» RILJ (800)

» SyncLoopWakeLock (7200)

» ANYTHING you find with "facebook" it in, set it to 999999

Alarms:

» com.android.internal.telephony.data-stall (86400)

» com.android.providers.calendar.intent.CalendarProvider2 (43200)

» com.android.vending/com.google.android.finsky.services.ContentSyncService (7200)

» com.facebook.common.executors.WakingExecutorService.ACTION_ALARM.com.facebook.katana.Mqtt_Wakeup (43200)

» com.facebook.orca.database.ACTION_ALARM (43200)

» com.facebook.push.mqtt.keepalive.KeepaliveManager. ACTION_INEXACT_ALARM.com.facebook.katana (43200)

» com.google.android.apps.gsa.sidekick.shared.a.a.UPDATE_CALENDAR_ACTION (7200)

» com.google.android.apps.sidekick.SCHEDULED_REFRESH (7200)

» com.google.android.gms.common.receiver.LOG_CORE_ANALYTICS (999999)

» com.google.android.gms.gcm.ACTION_CHECK_QUEUE (43200)

» com.google.android.gms.gcm.HEARTBEAT_ALARM (7200)

» com.google.android.gms.icing.proxy.action.SMS_CHANGED (3600)

» com.google.android.gms/.checkin.EventLogService$Receiver (86400)

» com.google.android.intent.action.GCM_RECONNECT (43200)

» com.google.android.intent.action.SEND_IDLE (43200)

» com.motorola.slpc.ALARM_STOWED (7200)

» android.appwidget.action.APPWIDGET_UP-DATE (3600)

» android.content.syncmanager.SYNC_ALARM (43200)

Hit the notepad looking icon at the top left and apply the following:

» ALARM_WAKEUP[0-9]{4,}

Services (deny the following):

» Anything with "facebook" in it

» com.google.android.gms/.ads.jam.NegotiationService

» com.google.android.googlequicksearchbox/com.google.android.apps.gsa.sidekick.main.TrafficIntentService

» com.motorola.moto/com.motorola.checkin.AnalyticsService

Greenify

Most of you should already be accustomed to Greenify, which will hibernate apps from working a lot when you have your screen off and aren't using your phone. What makes Greenify really useful is its ability to push your phone into Doze mode quickly after you turn the screen off, also mostly disregarding the motion sensors, unlike stock MM. Some settings to use:

» Working Mode: Boost

» Shallow Hibernation: Enabled

» Aggressive Doze: Enabled

Go to Aggressive Doze > White list and enable the following apps (change the filter from Not optimized to All apps):

» Amplify

» Greenify

» Power Nap

Xposed-based Features to enable:

» Wakeup Timer Coalescing

» Block App State Abuse

Power Nap

Power Nap is essentially a lot like Greenify, except rather than having to create a list of apps to hibernate, you create a list of whitelisted apps that are ok to trigger wakelocks/alarms. While Greenify will allow apps to do their thing when you turn the screen on and then hibernate them when you turn the screen off, Power Nap keeps these apps from wasting cpu cycles in the background while using the phone. It pairs nicely with Amplify, because we can either block apps entirely by not whitelisting them, or we can whitelist them and allow Amplify to control how often the apps are allowed to collect data or push a notification. You'll want to make sure to whitelist any programs that you don't want to be blocked (i.e. Amplify, Greenify, your messaging app, etc.).

» Turn on Endurance Mode

Suggested apps to whitelist (tap the words "Endurance Mode")

» Amplify (do it!)

» Android System (required)

» BetterBatteryStats (if you have it)

» Google Play Services (required)

» Google Services Framework (required)

» Greenify

» JavaTcmdHelper

» Photos (if you use Google Photos)

» Spotify (or any music program you wish to still launch with Moto Drive Assist)

» Tasker (if you use Tasker)

» Textra (or whichever messaging app you use)

» Xposed Installer (do it!)

Better Battery Stats

BBS, if you don't already use it, provides a lot more information than Android's battery stats can ever give you. As a first gauge of how much battery your phone consumes when not in use, you should either charge your phone to 100% and unplug it before you go to sleep at night, or within the app you can set a custom reference point before you go to sleep. When you wake up, check what % was used per hour. With everything outlined above, I only lose .1%/hr. Anything between 0-.5% is acceptable, with there being a lot of factors involved (ROM, kernel, Wi-Fi and/or Bluetooth on, receiving texts, an alarm set, etc.). BBS will also help you determine what app(s) are often waking your phone up (check to see which fire a lot of alarms, as those apps have an obvious need of having some of its alarms put in check via Amplify).