Android M Has An Easter Egg, And It's ¯\_(ツ)_/¯
[Android M Feature Spotlight] New Android Recovery Lets You Apply Updates From SD Card, View Recovery Logs, And Mount /System
[Android M Feature Spotlight] This Is Exactly How Doze Reduces Battery Drain
[Android M Feature Spotlight] App Info Revamped To Include Granular Permissions, More Notification Settings, Data Usage History, And More
[Android M Feature Spotlight] App Standby Forces Individual Unused Apps To Hibernate To Save Power
- View All 77 Articles In This Series
Doze is one of the more interesting features of Android M, and also potentially huge for the platform. Google has said again and again that the new version of Android would improve battery life, but they might have actually done it this time. Doze puts apps into deep sleep when the device isn't in use to save power, and Google's developer docs explain exactly how this will work.
Doze is set to activate when a device is unplugged, stationary, and the screen is off. While in Doze, the phone or tablet will periodically wake up to sync data, but otherwise most things remain asleep. Here's what happens at the system level with Doze.
- Network access is disabled, unless your app receives a high priority Google Cloud Messaging tickle.
- Wake locks are ignored.
- Alarms scheduled with the
AlarmManagerclass are disabled, except for alarms that you've set with the
- WiFi scans are not performed.
- Syncs and jobs for your sync adapters and
JobSchedulerare not permitted to run.
Developers will be able to designate some push messages as high-priority, which allows the device to wake up for a brief time. That should eliminate a lot of the wakelocks caused by rogue apps in the background. Apps also shouldn't be able to trigger device wake-ups (alarms) without having a good reason.
Low-priority jobs may be queued for when the device wakes back up, but developers are warned to test their apps and make sure they can recover gracefully from being in hibernation. We're still in the early days, so there might be some unforeseen consequences of Doze. We'll have to see how developers cope.
- Android Developers