aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2023-04-16 11:13:40 +1000
committerGitHub <noreply@github.com>2023-04-16 11:13:40 +1000
commitb27166be020ecdad235acf90d658528fa6208114 (patch)
tree85bfab3601eb36aec53c4012475a90ece85a90ff
parenta3e7d1a9b0f3da68f1571eb3981e74920f536a2f (diff)
parent6dc92b1c5f688f22dcb15fdedd5f99a4963513f6 (diff)
Merge pull request #23157 from joseluismarti/schedule-limit
[Android] Avoid crash when create recommendation channels and schedul…
-rw-r--r--tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in20
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 14e1528712..1e56167804 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, "TvUtil: 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, "TvUtil: 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)