Skip to content

Foreground Service Notifications can be delayed by 10 seconds #1733

@RHenigan

Description

@RHenigan

Bug Report

Starting in Android 12 the system can delay the display of foreground service notifications by 10 seconds for certain foreground services.

If the foreground service has at least one of the following characteristics, the system shows the associated notification immediately after hte service starts:

  • The service is associated with a notification that includes action buttons.
  • The service has a foregroundServiceType of mediaPlayback, mediaProjection, or phoneCall.
  • The service provides a use case related to phone calls, navigation, or media playback, as defined in the notification's category attribute.
  • the service has opted out of the behavior change by passing FOREGROUND_SERVICE_IMMEDIATE into setForegroundServiceBehavior() when setting up the notificaiton.

https://developer.android.com/about/versions/12/behavior-changes-all#foreground-service-notification-delay

OS & Version Information
  • Android Version: SDK 31

Metadata

Metadata

Assignees

No one assigned

    Labels

    best practiceNot a defect but something that should be improved anyway

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions