Skip to content

Commit

Permalink
Catch correct exception from Context.startService
Browse files Browse the repository at this point in the history
Issue: #7306
PiperOrigin-RevId: 309392633
  • Loading branch information
ojw28 committed May 27, 2020
1 parent 4d68c5f commit cfae2c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
EMSG tracks ([#7273](https://github.com/google/ExoPlayer/issues/7273)).
* MPEG-TS: Fix issue where SEI NAL units were incorrectly dropped from H.265
samples ([#7113](https://github.com/google/ExoPlayer/issues/7113)).
* Text
* Text
* Use anti-aliasing and bitmap filtering when displaying bitmap subtitles
([#6950](https://github.com/google/ExoPlayer/pull/6950)).
* AV1 extension: Add a heuristic to determine the default number of threads
used for AV1 playback using the extension.
* DownloadService: Fix "Not allowed to start service" `IllegalStateException`.

### 2.11.4 (2020-04-08) ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ private void restartService() {
try {
Intent intent = getIntent(context, serviceClass, DownloadService.ACTION_INIT);
context.startService(intent);
} catch (IllegalArgumentException e) {
} catch (IllegalStateException e) {
// The process is classed as idle by the platform. Starting a background service is not
// allowed in this state.
Log.w(TAG, "Failed to restart DownloadService (process is idle).");
Expand Down

0 comments on commit cfae2c1

Please sign in to comment.