Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only COMMAND_PLAY starts the service in the foreground
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: #20 #minor-release PiperOrigin-RevId: 433229604
- Loading branch information