Foreground Services (FGS) Task Manager in android 13
Muhammad Yaseen
Android Developer at Learnrithm AI | Sr. Android Developer at R.Solutions | App Consultant | Google Ads | App Development | App Updates | Bugs Fixer | Jetpack Compose | Android | Kotlin | Upwork
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.
When the user presses the?Stop?button next to your app in the FGS Task Manager, then the following actions occur:
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: