Skip to content

Reminder - Foreground service launch restrictions (Android 12) #2

@flamyoad

Description

@flamyoad

https://developer.android.com/about/versions/12/foreground-services

Because the CoroutineWorker.setForeground() and ListenableWorker.setForegroundAsync() methods are backed by foreground services, they're subject to the same foreground service launch restrictions and exemptions. You can use the API opportunistically, but be prepared to handle an exception if the system disallows your app from starting a foreground service. For a more consistent experience, use setExpedited().

To see a complete example of how WorkManager 2.7.0 uses expedited jobs, look through the WorkManagerSample on GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    reminderAPI deprecation issues (thanks Google)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions