mirror of
https://github.com/androidx/media.git
synced 2025-05-07 07:30:22 +08:00

This change makes all notification actions start MediaSessionService in the background except COMMAND_PLAY which starts the service in the foreground. This is to avoid ANRs that are raised if we don't call MediaSessionService.startForeground() within 5 seconds since the service was started in the foreground. We only call MediaSessionService.startForeground() when Player.getPlayWhenReady() returns true, and only COMMAND_PLAY sets playWhenReady to true. Issue: androidx/media#20 #minor-release PiperOrigin-RevId: 433229604