From 59a1b4a2bb72e747cb86fc5fb6bb3c9a9811bb0b Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Tue, 9 Jan 2018 20:13:14 +0100 Subject: [PATCH] Cleanup executeAsync --- .../activity/gpoddernet/GpodnetAuthenticationActivity.java | 6 +----- .../de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java | 7 +------ .../de/danoeh/antennapod/asynctask/OpmlImportWorker.java | 7 +------ .../antennapod/fragment/gpodnet/PodcastListFragment.java | 6 +----- .../antennapod/fragment/gpodnet/TagListFragment.java | 6 +----- .../de/danoeh/antennapod/core/asynctask/FeedRemover.java | 7 +------ .../antennapod/core/asynctask/FlattrClickWorker.java | 7 +------ .../antennapod/core/asynctask/FlattrTokenFetcher.java | 7 +------ 8 files changed, 8 insertions(+), 45 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 8ede947c5..31d0fb1a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -171,11 +171,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity { return null; } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service); - } else { - authTask.execute(); - } + authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service); } }); } diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java index 4449d82c2..fcd5cff00 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java @@ -56,13 +56,8 @@ public class OpmlFeedQueuer extends AsyncTask { return null; } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java index 62ea85811..88bd35b7c 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java @@ -93,13 +93,8 @@ public class OpmlImportWorker extends return exception != null; } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 15e9c9943..a54c90862 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -160,10 +160,6 @@ public abstract class PodcastListFragment extends Fragment { } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - loaderTask.execute(); - } + loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java index d2c7f32dd..1e46b1ac5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java @@ -135,11 +135,7 @@ public class TagListFragment extends ListFragment { } } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - loadTask.execute(); - } + loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 67c460e78..1a0772f16 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -55,13 +55,8 @@ public class FeedRemover extends AsyncTask { dialog.show(); } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java index d991006e5..19501ea94 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java @@ -225,12 +225,7 @@ public class FlattrClickWorker extends AsyncTask android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java index 2513d1abd..5333b2273 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java @@ -80,13 +80,8 @@ public class FlattrTokenFetcher extends AsyncTask { } } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } }