One of Google's big projects for Android M is battery optimization. It's doing this by implementing a new Doze mode that puts unneeded apps into an ultra low-power state that keeps them from doing too much in the background. While this should all work smoothly on its own, it turns out you can go into the settings and fiddle with things.

Screenshot_20150528-154314 Screenshot_20150528-154321 Screenshot_20150528-154332 Screenshot_20150528-154344

Doze should be smart enough to wake apps up when they have a high-priority action to perform. For example, your alarm app will still work if it's been Dozing. To view the list of apps and their Doze settings, you can head into the main app settings, then go to Advanced > Ignore optimizations. Unsurprisingly, there are three apps set to ignore battery optimization by default—Google Play Services, the Play Store, and Download Manager.

You can use the drop down to flip between just the apps that ignore optimization and all apps. Tap on any app to change its ignore status. An app that ignores battery optimizations shouldn't Doze when the device is in deep sleep, or that's the way it looks at least. This is just a developer preview, so there's no guarantee this will still be exposed in the final version.