diff options
-rw-r--r-- | tools/android/packaging/xbmc/src/Main.java.in | 2 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/android/packaging/xbmc/src/Main.java.in b/tools/android/packaging/xbmc/src/Main.java.in index 3080bef78b..a769488256 100644 --- a/tools/android/packaging/xbmc/src/Main.java.in +++ b/tools/android/packaging/xbmc/src/Main.java.in @@ -290,6 +290,8 @@ public class Main extends NativeActivity implements Choreographer.FrameCallback @Override public void onDestroy() { + TvUtil.cancelAllScheduledJobs(this); + // unregister the InputDeviceListener implementation InputManager manager = (InputManager) getSystemService(INPUT_SERVICE); manager.unregisterInputDeviceListener(mInputDeviceListener); 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 0286b8dc13..ff7ccd0dc0 100644 --- a/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in +++ b/tools/android/packaging/xbmc/src/channels/util/TvUtil.java.in @@ -181,6 +181,18 @@ public class TvUtil } /** + * Cancel all jobs scheduled by this app via a {@link JobScheduler}. + * + * @param context for accessing the {@link JobScheduler}. + */ + public static void cancelAllScheduledJobs(Context context) + { + JobScheduler scheduler = + (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); + scheduler.cancelAll(); + } + + /** * Schedules syncing channels via a {@link JobScheduler}. * * @param context for accessing the {@link JobScheduler}. |