Skip to content

Commit

Permalink
Merge pull request #23166 from joseluismarti/schedule-limit-Nexus
Browse files Browse the repository at this point in the history
[backport][Android] Avoid crash when create recommendation channels a…
  • Loading branch information
fuzzard committed Apr 21, 2023
2 parents e801643 + ea519ad commit 8247c35
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

/**
Expand Down Expand Up @@ -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());
}
}

/**
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8247c35

Please sign in to comment.