Android 13 will notify users of high app background battery usage using complex monitoring

Google has been working hard on Android 13, just recently releasing the Developer Preview 2 build of the OS. As the current timeline goes, we can expect to see the first Beta build sometime in April, followed by a few more beta’s and likely a full release in August, September, or October. Google is not committing to any launch window. Shortly after DP2 dropped, some interesting changes were documented within a developer resource titled “Battery Resource Utilization”.

It goes over some new rules and limitations regarding the “restricted” App Standby Bucket state an app can end up in, but more interesting still, it details a new excessive background battery usage notification. To quite the document itself:


Android 13 introduces a system notification that appears when your app consumes a large amount of device battery during a 24-hour period. This new notification appears for all apps on devices that run on Android 13, regardless of target SDK version.


When measuring your app’s impact on a device’s battery life, the system takes into account the work that your app does in several different places, including the following:


  • Foreground services, even those that have visible notifications
  • Work tasks, including expedited work
  • Broadcast receivers
  • Background services
  • Your app’s cache



If this notification appears for your app, it won’t appear again on the same device until at least 24 hours later.


If the system detects that your app runs a foreground service for a long period of time—at least 20 hours within a 24-hour window—it sends a notification to the user, inviting them to interact with the Foreground Services (FGS) Task Manager.


Note: If the system shows this notification for your app, it doesn’t show a similar notification again until at least 30 days later.


This can all get a bit technical, but an oversimplified explanation would be that Android 13 now monitors more and more varied aspects of an app’s background behavior. Not only that but also some of its foreground elements, like foreground services. Those are services that perform operations that need to be noticeable to the user and have a notification associated with them that can’t be dismissed until the service stops or is removed from the foreground. Examples of such behavior are things like fitness tracking apps as they are “in a workout” and collecting data actively or a multimedia player that plays with a foreground service and might show things like the current song and multimedia controls in a notification.

As you can imagine, there are many legitimate apps that might have such behavior without meriting a battery warning notification. Android 13 has more than a few exemptions from its tracking. Both the examples we gave above are actually covered since the notification does not appear for foreground services of type FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK or FOREGROUND_SERVICE_TYPE_LOCATION. On top of that, the following situations exempt apps from all battery-preserving measures introduced in Android 13:


  • System apps and system-bound apps
  • Companion device apps
  • Apps running on a device in Demo Mode
  • Device owner apps
  • Profile owner apps
  • Persistent apps
  • VPN apps
  • Apps that have the ROLE_DIALER role
  • Apps that the user has explicitly designated to provide “unrestricted” functionality in system settings


Of course, certain third-party Android ROMs and other apps and managers already offer similar background battery monitoring features, though not with the same level of depth. You might also recall that As far back as Android 8 Oreo, Google already did a similar push, resulting in background battery drain warnings. Though, the monitoring logic for those is much more rudimentary and the notifications themselves can be much more obnoxious with no smart limitations, like showing only one notification per 24 hours.

Provided this new battery monitoring passes all of the beta testings and ends up working well, we can look forward to it appearing in practically any future smartphone running Android 13 since it is part of Google’s AOSP core. Hopefully, all of our battery packs stand to gain from this move in the long run.

Source | Via


Source link

About Daily Multan

Check Also

OnePlus 11’s color options tipped

Renders of the OnePlus 11 (formerly known as 11 Pro) that leaked a couple of …

Leave a Reply

Your email address will not be published. Required fields are marked *