Foreground Services (FGS) Task Manager in android 13

Foreground Services (FGS) Task Manager in android 13

In Android?13 (API level?33), users can complete a workflow from the?notification drawer?to stop an app that has an ongoing foreground services, regardless of that app's target SDK version. This affordance, called the?Foreground Services?(FGS) Task Manager, shows a list of apps that are currently running a foreground service. This list is labeled?Active apps. Next to each app is a?Stop?button. Below figure illustrates the FGS Task Manager workflow on a device that runs Android?13.

No alt text provided for this image
Foreground Services (FGS) Task Manager

When the user presses the?Stop?button next to your app in the FGS Task Manager, then the following actions occur:

  • The system removes your app from memory. Therefore, your?entire app stops, not just the running foreground service.
  • The system removes your app's activity back stack.
  • Any media playback is stopped.
  • The notification associated with the foreground service is removed.
  • Your app isn't removed from history.
  • Scheduled jobs are preserved.
  • Alarms are preserved.


Keypoint:?The system doesn't send your app any callbacks when the user presses the?Stop?button. When your app starts back up, it's helpful to check for the?REASON_USER_REQUESTED?reason that's part of the?ApplicationExitInfo?API.

Exemptions:

The system provides several levels of exemptions for certain types of apps, which the following sections describe.

Exemptions are per app, not per process. If the system exempts one process in an app, all other processes in that app are also exempt.

Keypoint:?Some pre-installed apps that are configured by the manufacturer may also be exempt.

Exemptions from appearing in the FGS Task Manager at all:

The following apps can run a foreground service and not appear in the FGS Task Manager at all:

Exemptions from being stoppable by users:

When the following types of apps run a foreground service, they appear in the FGS Task Manager, but there is no?Stop?button next to the app's name for the user to press:

要查看或添加评论,请登录

Muhammad Yaseen的更多文章

社区洞察

其他会员也浏览了