From 36b43780d364dc3cbb2d5b0fd5f18d7e72692910 Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 1 May 2020 13:17:27 +0100 Subject: [PATCH] Catch correct exception from Context.startService Issue: #7306 PiperOrigin-RevId: 309392633 --- .../com/google/android/exoplayer2/offline/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java index 51f7fa3765..0ee9a83260 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java @@ -1022,7 +1022,7 @@ public abstract class DownloadService extends Service { 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).");