Image for post
Image for post

App Standby Buckets In Android

Deepanshu
Deepanshu
Mar 31, 2020 · 4 min read

Google has been continuously making changes in every version of Android for a better user experience. Battery(power) optimization is among one of the things which makes the user experience smooth. In earlier versions of Android, Google introduced features like Doze and App Standby modes which saves users’ battery.

Android Pie (Version 9 API level 28) introduced a new feature for better battery(power) management called App Standby Buckets. Each android application is now placed into one of the priority buckets based on the app’s usage patterns like how recently & how frequently the user has used the application. The android system then limits the app’s resources based on the bucket app is currently residing in.

What are Priority buckets?

The system dynamically assigns each app to a priority bucket, reassigning the apps as needed. More active apps are assigned to higher priority buckets, making more system resources available to the app. In particular, the bucket determines how frequently the app’s jobs run, how often the app can trigger alarms, and how often the app can receive high-priority FCM messages. These restrictions apply only while the device is on battery power; the system does not impose these restrictions on apps while the device is charging.

The buckets are:

  • Active: An app is in the active bucket if the user is currently using the app or very recently used the app. The system does not place any restrictions on the app’s jobs, alarms, or FCM messages.
  • Working set: An app is in the working set bucket if it runs often but it is not currently active. The system imposes mild restrictions on its ability to run jobs and trigger alarms.
  • Frequent: An app is in the frequent bucket if it is used regularly, but not necessarily every day. The system imposes stronger restrictions on its ability to run jobs and trigger alarms, and also imposes a cap on high-priority FCM messages.
  • Rare: An app is in the rare bucket if it is not often used. The system imposes strict restrictions on its ability to run jobs, trigger alarms, and receive high-priority FCM messages. The system also limits the app’s ability to connect to the internet.
  • Never: An app is in the never bucket if it is installed but has never been run. The system imposes severe restrictions on these apps.
Image for post
Image for post

Best practices

  • If an app does not have a launcher activity, it might never be promoted to the active bucket.
  • If the app’s notifications aren’t actionable, users won’t be able to trigger the app’s promotion to the active bucket by interacting with the notifications.
  • Similarly, if the app doesn’t show a notification upon receiving a high-priority FCM message, it won’t give the user a chance to interact with the app and thus promote it to the active bucket. In fact, the only intended use for high-priority FCM messages is to push a notification to the user, so this situation should never occur. If you inappropriately mark an FCM message as high-priority when it doesn’t trigger user interaction, it can cause other negative consequences; for example, it can result in your app exhausting its quota, causing genuinely urgent FCM messages to be treated as normal-priority.
  • Do not try to manipulate the system into putting your app into one bucket or another. The system’s bucketing methods can change, and every device manufacturer could choose to write their own bucketing app with its own algorithm. Instead, make sure your app behaves appropriately no matter which bucket it’s in.

Thank You!!!

MindOrks

Our community publishes stories worth reading on Android…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store