diff options
author | Jose Luis Marti <joseluis.marti@gmail.com> | 2023-04-17 09:17:50 +0200 |
---|---|---|
committer | Jose Luis Marti <joseluis.marti@gmail.com> | 2023-04-17 09:17:50 +0200 |
commit | ea519ad87c8e0250a299a21642b82805873f9215 (patch) | |
tree | 0f1f65f55974abafcb4c43906cdd00d2a8480f4a /tools | |
parent | aa3bf5cc2360a48350af084f6210118eaec6aa51 (diff) |
[backport][Android] Avoid crash when create recommendation channels and schedule more than 100 jobs
Diffstat (limited to 'tools')
-rw-r--r-- | tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in b/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in index 946a06ece2..25422c32fd 100644 --- a/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in +++ b/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in @@ -209,7 +209,12 @@ public class TvUtil builder.setMinimumLatency(10000); Log.d(TAG, "Scheduled channel creation."); - scheduler.schedule(builder.build()); + + try { + scheduler.schedule(builder.build()); + } catch (IllegalStateException e) { + Log.w(TAG, "TvUtil: scheduleSyncingChannel - Exception: " + e.getMessage()); + } } /** @@ -241,7 +246,12 @@ public class TvUtil builder.setExtras(bundle); scheduler.cancel(getTriggeredJobIdForChannelId(channelId)); - scheduler.schedule(builder.build()); + + try { + scheduler.schedule(builder.build()); + } catch (IllegalStateException e) { + Log.w(TAG, "TvUtil: scheduleTriggeredSyncingProgramsForChannel - Exception: " + e.getMessage()); + } } /** @@ -271,7 +281,11 @@ public class TvUtil JobInfo job = builder.build(); Log.d(TAG, "scheduleTimedSyncingProgramsForChannel: minperiod=" + job.getMinPeriodMillis()); - scheduler.schedule(job); + try { + scheduler.schedule(job); + } catch (IllegalStateException e) { + Log.w(TAG, "TvUtil: scheduleTimedSyncingProgramsForChannel - Exception: " + e.getMessage()); + } } public static int getTriggeredJobIdForChannelId(long channelId) |