diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2018-10-21 19:12:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-21 19:12:14 +0200 |
commit | 94a4b78449043583570d3b97b758985c78e9f4a6 (patch) | |
tree | 516adc07943008ba02982e44a01798eaff7d84d9 /core | |
parent | a05f386793a7790302502983579b528bb6b46eaa (diff) | |
parent | 59c2c5b1d6e007ea7fa8260d994d21743a092f73 (diff) | |
download | AntennaPod-94a4b78449043583570d3b97b758985c78e9f4a6.zip |
Merge branch 'develop' into glide-48
Diffstat (limited to 'core')
72 files changed, 259 insertions, 151 deletions
diff --git a/core/src/main/java/android/support/v4/app/SafeJobIntentService.java b/core/src/main/java/android/support/v4/app/SafeJobIntentService.java new file mode 100644 index 000000000..c07c409ee --- /dev/null +++ b/core/src/main/java/android/support/v4/app/SafeJobIntentService.java @@ -0,0 +1,118 @@ +package android.support.v4.app; + +import android.app.job.JobParameters; +import android.app.job.JobServiceEngine; +import android.app.job.JobWorkItem; +import android.content.Intent; +import android.os.Build; +import android.os.IBinder; +import android.support.annotation.RequiresApi; +import android.util.Log; + + +public abstract class SafeJobIntentService extends JobIntentService { + + @Override + public void onCreate() { + super.onCreate(); + if (Build.VERSION.SDK_INT >= 26) { + mJobImpl = new SafeJobServiceEngineImpl(this); + } + } + + /** + * Implementation of a safe JobServiceEngine for interaction with JobIntentService. + */ + @RequiresApi(26) + static final class SafeJobServiceEngineImpl extends JobServiceEngine + implements JobIntentService.CompatJobEngine { + static final String TAG = "JobServiceEngineImpl"; + + static final boolean DEBUG = false; + + final JobIntentService mService; + final Object mLock = new Object(); + JobParameters mParams; + + final class WrapperWorkItem implements JobIntentService.GenericWorkItem { + final JobWorkItem mJobWork; + + WrapperWorkItem(JobWorkItem jobWork) { + mJobWork = jobWork; + } + + @Override + public Intent getIntent() { + return mJobWork.getIntent(); + } + + @Override + public void complete() { + synchronized (mLock) { + if (mParams != null) { + try { + mParams.completeWork(mJobWork); + } catch (SecurityException e) { + Log.e(TAG, Log.getStackTraceString(e)); + } + } + } + } + } + + SafeJobServiceEngineImpl(JobIntentService service) { + super(service); + mService = service; + } + + @Override + public IBinder compatGetBinder() { + return getBinder(); + } + + @Override + public boolean onStartJob(JobParameters params) { + if (DEBUG) Log.d(TAG, "onStartJob: " + params); + mParams = params; + // We can now start dequeuing work! + mService.ensureProcessorRunningLocked(false); + return true; + } + + @Override + public boolean onStopJob(JobParameters params) { + if (DEBUG) Log.d(TAG, "onStartJob: " + params); + boolean result = mService.doStopCurrentWork(); + synchronized (mLock) { + // Once we return, the job is stopped, so its JobParameters are no + // longer valid and we should not be doing anything with them. + mParams = null; + } + return result; + } + + /** + * Dequeue some work. + */ + @Override + public JobIntentService.GenericWorkItem dequeueWork() { + JobWorkItem work = null; + synchronized (mLock) { + if (mParams == null) { + return null; + } + try { + work = mParams.dequeueWork(); + } catch (SecurityException e) { + Log.e(TAG, Log.getStackTraceString(e)); + } + } + if (work != null) { + work.getIntent().setExtrasClassLoader(mService.getClassLoader()); + return new WrapperWorkItem(work); + } else { + return null; + } + } + } +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java index ea07fc76e..8ad70c328 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java @@ -10,20 +10,15 @@ import android.util.Log; import org.antennapod.audio.MediaPlayer; -import java.io.File; -import java.util.List; - -import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.storage.DBReader; -import de.danoeh.antennapod.core.storage.DBWriter; /* * This class's job is do perform maintenance tasks whenever the app has been updated */ class UpdateManager { + private UpdateManager(){} + private static final String TAG = UpdateManager.class.getSimpleName(); private static final String PREF_NAME = "app_version"; 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 74693cf21..4504b2e7f 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 @@ -2,14 +2,12 @@ package de.danoeh.antennapod.core.asynctask; import android.app.ProgressDialog; import android.content.Context; -import android.content.Intent; import android.os.AsyncTask; import java.util.concurrent.ExecutionException; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.IntentUtils; 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 f4c99011a..318e404c8 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 @@ -10,7 +10,6 @@ import android.support.v4.app.NotificationCompat; import android.util.Log; import android.widget.Toast; -import de.danoeh.antennapod.core.util.gui.NotificationUtils; import org.shredzone.flattr4j.exception.FlattrException; import java.util.LinkedList; @@ -27,6 +26,7 @@ import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.NetworkUtils; import de.danoeh.antennapod.core.util.flattr.FlattrThing; import de.danoeh.antennapod.core.util.flattr.FlattrUtils; +import de.danoeh.antennapod.core.util.gui.NotificationUtils; /** * Performs a click action in a background thread. diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java index 420a60469..6d9ab2bd3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java @@ -19,11 +19,9 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils; public class FlattrStatusFetcher extends Thread { private static final String TAG = "FlattrStatusFetcher"; - private final Context context; public FlattrStatusFetcher(Context context) { super(); - this.context = context; } @Override diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java index a3f91b1c9..2610d253f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java @@ -50,7 +50,7 @@ public abstract class FeedComponent { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (o == null || !(o instanceof FeedComponent)) return false; FeedComponent that = (FeedComponent) o; @@ -62,4 +62,4 @@ public abstract class FeedComponent { public int hashCode() { return (int) (id ^ (id >>> 32)); } -}
\ No newline at end of file +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index b0a87c885..0f0343f25 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -2,9 +2,8 @@ package de.danoeh.antennapod.core.feed; import android.database.Cursor; import android.support.annotation.Nullable; - import android.text.TextUtils; -import de.danoeh.antennapod.core.asynctask.ImageResource; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -15,6 +14,7 @@ import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.asynctask.ImageResource; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.ShownotesProvider; @@ -194,7 +194,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr if (other.link != null) { link = other.link; } - if (other.pubDate != null && other.pubDate != pubDate) { + if (other.pubDate != null && other.pubDate.equals(pubDate)) { pubDate = other.pubDate; } if (other.media != null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java index 73d2bb34d..39994ec16 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java @@ -532,8 +532,8 @@ public class FeedMedia extends FeedFile implements Playable { UserPreferences.isAutoFlattr() && item.getPaymentLink() != null && item.getFlattrStatus().getUnflattred() && - (completed && autoFlattrThreshold <= 1.0f || - played_duration >= autoFlattrThreshold * duration)) { + ((completed && autoFlattrThreshold <= 1.0f) || + (played_duration >= autoFlattrThreshold * duration))) { DBTasks.flattrItemIfLoggedIn(context, item); } } @@ -626,6 +626,9 @@ public class FeedMedia extends FeedFile implements Playable { @Override public boolean equals(Object o) { + if (o == null) { + return false; + } if (FeedMediaFlavorHelper.instanceOfRemoteMedia(o)) { return o.equals(this); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java index fc1acd0e1..d0061af99 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java @@ -6,6 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; * The settings that AntennaPod will use for various Glide options */ public class ApGlideSettings { + private ApGlideSettings(){} public static final DiskCacheStrategy AP_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java index b76988fd8..330cde525 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java @@ -169,7 +169,7 @@ public class GpodnetEpisodeAction { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (o == null || !(o instanceof GpodnetEpisodeAction)) return false; GpodnetEpisodeAction that = (GpodnetEpisodeAction) o; diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java index b51b8d996..5b17dd338 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java @@ -24,6 +24,8 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService; */ public class GpodnetPreferences { + private GpodnetPreferences(){} + private static final String TAG = "GpodnetPreferences"; private static final String PREF_NAME = "gpodder.net"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java index b7ed890f5..0f3a9fcb3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java @@ -23,7 +23,6 @@ public class SleepTimerPreferences { private static final String DEFAULT_VALUE = "15"; private static final int DEFAULT_TIME_UNIT = 1; - private static Context context; private static SharedPreferences prefs; /** diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 6aaf65e18..e6b5f9e1b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -8,14 +8,7 @@ import android.support.annotation.NonNull; import android.support.v4.app.NotificationCompat; import android.text.TextUtils; import android.util.Log; -import de.danoeh.antennapod.core.R; -import de.danoeh.antennapod.core.service.download.ProxyConfig; -import de.danoeh.antennapod.core.storage.APCleanupAlgorithm; -import de.danoeh.antennapod.core.storage.APNullCleanupAlgorithm; -import de.danoeh.antennapod.core.storage.APQueueCleanupAlgorithm; -import de.danoeh.antennapod.core.storage.EpisodeCleanupAlgorithm; -import de.danoeh.antennapod.core.util.Converter; -import de.danoeh.antennapod.core.util.download.AutoUpdateManager; + import org.json.JSONArray; import org.json.JSONException; @@ -27,6 +20,15 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.R; +import de.danoeh.antennapod.core.service.download.ProxyConfig; +import de.danoeh.antennapod.core.storage.APCleanupAlgorithm; +import de.danoeh.antennapod.core.storage.APNullCleanupAlgorithm; +import de.danoeh.antennapod.core.storage.APQueueCleanupAlgorithm; +import de.danoeh.antennapod.core.storage.EpisodeCleanupAlgorithm; +import de.danoeh.antennapod.core.util.Converter; +import de.danoeh.antennapod.core.util.download.AutoUpdateManager; + /** * Provides access to preferences set by the user in the settings screen. A * private instance of this class must first be instantiated via @@ -34,6 +36,7 @@ import java.util.concurrent.TimeUnit; * when called. */ public class UserPreferences { + private UserPreferences(){} private static final String IMPORT_DIR = "import/"; @@ -44,7 +47,7 @@ public class UserPreferences { public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems"; private static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder"; private static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator"; - private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; + public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; public static final String PREF_COMPACT_NOTIFICATION_BUTTONS = "prefCompactNotificationButtons"; public static final String PREF_LOCKSCREEN_BACKGROUND = "prefLockscreenBackground"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java index edc2ea3e0..7663cdbe4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java @@ -6,10 +6,11 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; -import de.danoeh.antennapod.core.service.PlayerWidgetJobService; import java.util.Arrays; +import de.danoeh.antennapod.core.service.PlayerWidgetJobService; + public class PlayerWidget extends AppWidgetProvider { private static final String TAG = "PlayerWidget"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateJobService.java index 55a8d6b86..7d80d4e7c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateJobService.java @@ -5,6 +5,7 @@ import android.app.job.JobService; import android.os.Build; import android.support.annotation.RequiresApi; import android.util.Log; + import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.util.FeedUpdateUtils; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java index fe6e8c400..5584991ca 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java @@ -6,8 +6,8 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; -import android.support.v4.app.JobIntentService; import android.support.v4.app.NotificationCompat; +import android.support.v4.app.SafeJobIntentService; import android.support.v4.util.ArrayMap; import android.util.Log; import android.util.Pair; @@ -44,7 +44,7 @@ import de.danoeh.antennapod.core.util.gui.NotificationUtils; * Synchronizes local subscriptions with gpodder.net service. The service should be started with ACTION_SYNC as an action argument. * This class also provides static methods for starting the GpodnetSyncService. */ -public class GpodnetSyncService extends JobIntentService { +public class GpodnetSyncService extends SafeJobIntentService { private static final String TAG = "GpodnetSyncService"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index d2214cac8..6dab9a561 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -9,23 +9,24 @@ import android.content.ServiceConnection; import android.os.Build; import android.os.IBinder; import android.support.annotation.NonNull; -import android.support.v4.app.JobIntentService; +import android.support.v4.app.SafeJobIntentService; import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.widget.RemoteViews; + import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.receiver.MediaButtonReceiver; +import de.danoeh.antennapod.core.receiver.PlayerWidget; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.playback.Playable; -import de.danoeh.antennapod.core.receiver.PlayerWidget; /** * Updates the state of the player widget */ -public class PlayerWidgetJobService extends JobIntentService { +public class PlayerWidgetJobService extends SafeJobIntentService { private static final String TAG = "PlayerWidgetJobService"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index 57d099dfc..97007a214 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -40,6 +40,9 @@ import okhttp3.internal.http.StatusLine; * Provides access to a HttpClient singleton. */ public class AntennapodHttpClient { + + private AntennapodHttpClient(){} + private static final String TAG = "AntennapodHttpClient"; private static final int CONNECTION_TIMEOUT = 30000; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java index 75c28564e..48234c387 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java @@ -124,7 +124,7 @@ public class DownloadRequest implements Parcelable { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (o == null || !(o instanceof DownloadRequest)) return false; DownloadRequest that = (DownloadRequest) o; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 4bd2d8f19..ffbe7e7d1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -14,14 +14,13 @@ import android.os.Handler; import android.os.IBinder; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; +import android.support.annotation.Nullable; import android.support.v4.app.NotificationCompat; import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.webkit.URLUtil; -import de.danoeh.antennapod.core.storage.PodDBAdapter; -import de.danoeh.antennapod.core.util.gui.NotificationUtils; import org.apache.commons.io.FileUtils; import org.xml.sax.SAXException; @@ -31,10 +30,8 @@ import java.net.HttpURLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Date; -import java.util.HashSet; import java.util.LinkedList; import java.util.List; -import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; @@ -69,12 +66,14 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; +import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.syndication.handler.FeedHandler; import de.danoeh.antennapod.core.syndication.handler.FeedHandlerResult; import de.danoeh.antennapod.core.syndication.handler.UnsupportedFeedtypeException; import de.danoeh.antennapod.core.util.ChapterUtils; import de.danoeh.antennapod.core.util.DownloadError; import de.danoeh.antennapod.core.util.InvalidFeedException; +import de.danoeh.antennapod.core.util.gui.NotificationUtils; import de.greenrobot.event.EventBus; /** @@ -117,11 +116,6 @@ public class DownloadService extends Service { private CompletionService<Downloader> downloadExecutor; private FeedSyncThread feedSyncThread; - /** - * Number of threads of downloadExecutor. - */ - private static final int NUM_PARALLEL_DOWNLOADS = 6; - private DownloadRequester requester; @@ -862,22 +856,6 @@ public class DownloadService extends Service { return true; } - /** - * Delete files that aren't needed anymore - */ - private void cleanup(Feed feed) { - if (feed.getFile_url() != null) { - if (new File(feed.getFile_url()).delete()) { - Log.d(TAG, "Successfully deleted cache file."); - } else { - Log.e(TAG, "Failed to delete cache file."); - } - feed.setFile_url(null); - } else { - Log.d(TAG, "Didn't delete cache file: File url is not set."); - } - } - public void shutdown() { isActive = false; if (isCollectingRequests) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 8cce02155..842ad0c60 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -304,7 +304,7 @@ public class HttpDownloader extends Downloader { String encoded = ByteString.of(bytes).base64(); return "Basic " + encoded; } catch (UnsupportedEncodingException e) { - throw new AssertionError(); + throw new AssertionError(e); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index cc9d2ce2d..e1d87e1d5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.service.playback; import android.content.Context; import android.net.Uri; import android.view.SurfaceHolder; + import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.DefaultRenderersFactory; @@ -22,9 +23,11 @@ import com.google.android.exoplayer2.trackselection.TrackSelectionArray; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; -import de.danoeh.antennapod.core.util.playback.IPlayer; + import org.antennapod.audio.MediaPlayer; +import de.danoeh.antennapod.core.util.playback.IPlayer; + public class ExoPlayerWrapper implements IPlayer { private final Context mContext; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 0b4caf0c8..f2be7fbb1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -24,13 +24,13 @@ import android.os.Vibrator; import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.StringRes; +import android.support.v4.app.NotificationCompat; import android.support.v4.media.MediaBrowserCompat; import android.support.v4.media.MediaBrowserServiceCompat; import android.support.v4.media.MediaDescriptionCompat; import android.support.v4.media.MediaMetadataCompat; import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.PlaybackStateCompat; -import android.support.v4.app.NotificationCompat; import android.text.TextUtils; import android.util.Log; import android.util.Pair; @@ -67,8 +67,8 @@ import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.FeedSearcher; import de.danoeh.antennapod.core.util.IntList; import de.danoeh.antennapod.core.util.IntentUtils; -import de.danoeh.antennapod.core.util.gui.NotificationUtils; import de.danoeh.antennapod.core.util.QueueAccess; +import de.danoeh.antennapod.core.util.gui.NotificationUtils; import de.danoeh.antennapod.core.util.playback.ExternalMedia; import de.danoeh.antennapod.core.util.playback.Playable; import de.greenrobot.event.EventBus; @@ -603,14 +603,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { mediaPlayer.setVideoSurface(sh); } - /** - * Called when the surface holder of the mediaplayer has to be changed. - */ - private void resetVideoSurface() { - taskManager.cancelPositionSaver(); - mediaPlayer.resetVideoSurface(); - } - public void notifyVideoSurfaceAbandoned() { mediaPlayer.pause(true, false); mediaPlayer.resetVideoSurface(); @@ -1808,7 +1800,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { public boolean onMediaButtonEvent(final Intent mediaButton) { Log.d(TAG, "onMediaButtonEvent(" + mediaButton + ")"); if (mediaButton != null) { - KeyEvent keyEvent = (KeyEvent) mediaButton.getParcelableExtra(Intent.EXTRA_KEY_EVENT); + KeyEvent keyEvent = mediaButton.getParcelableExtra(Intent.EXTRA_KEY_EVENT); if (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN && keyEvent.getRepeatCount() == 0) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java index 8a222d7ec..4f2ae34f8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java @@ -12,7 +12,7 @@ public enum PlayerStatus { INITIALIZING(9), // playback service is loading the Playable's metadata INITIALIZED(10); // playback service was started, data source of media player was set. - private int statusValue; + private final int statusValue; private static final PlayerStatus[] fromOrdinalLookup; static { diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 456d05ded..718459db8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -75,7 +75,7 @@ public final class DBReader { cursor = adapter.getAllFeedsCursor(); List<Feed> feeds = new ArrayList<>(cursor.getCount()); while (cursor.moveToNext()) { - Feed feed = extractFeedFromCursorRow(adapter, cursor); + Feed feed = extractFeedFromCursorRow(cursor); feeds.add(feed); } return feeds; @@ -243,7 +243,7 @@ public final class DBReader { return result; } - private static Feed extractFeedFromCursorRow(PodDBAdapter adapter, Cursor cursor) { + private static Feed extractFeedFromCursorRow(Cursor cursor) { Feed feed = Feed.fromCursor(cursor); FeedPreferences preferences = FeedPreferences.fromCursor(cursor); feed.setPreferences(preferences); @@ -580,7 +580,7 @@ public final class DBReader { try { cursor = adapter.getFeedCursor(feedId); if (cursor.moveToNext()) { - feed = extractFeedFromCursorRow(adapter, cursor); + feed = extractFeedFromCursorRow(cursor); feed.setItems(getFeedItemList(feed)); } else { Log.e(TAG, "getFeed could not find feed with id " + feedId); @@ -1007,7 +1007,7 @@ public final class DBReader { Cursor feedCursor = adapter.getFeedsInFlattrQueueCursor(); if (feedCursor.moveToFirst()) { do { - result.add(extractFeedFromCursorRow(adapter, feedCursor)); + result.add(extractFeedFromCursorRow(feedCursor)); } while (feedCursor.moveToNext()); } feedCursor.close(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 8eed10cd7..ba7d4b47b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -1,11 +1,9 @@ package de.danoeh.antennapod.core.storage; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.database.Cursor; import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; import android.util.Log; import java.util.ArrayList; @@ -777,10 +775,8 @@ public final class DBTasks { */ abstract static class QueryTask<T> implements Callable<T> { private T result; - private final Context context; public QueryTask(Context context) { - this.context = context; } @Override diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java index 29ed5f7f9..0beb765e7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java @@ -5,6 +5,7 @@ import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.media.MediaMetadataRetriever; import android.util.Log; + import de.danoeh.antennapod.core.feed.FeedItem; class DBUpgrader { diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 8bb5bc31a..bbe6145ea 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -7,7 +7,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; -import de.danoeh.antennapod.core.util.IntentUtils; import org.shredzone.flattr4j.model.Flattr; import java.io.File; @@ -42,6 +41,7 @@ import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.DownloadStatus; import de.danoeh.antennapod.core.service.playback.PlaybackService; +import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.Permutor; import de.danoeh.antennapod.core.util.flattr.FlattrStatus; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index 827874f54..892a4675a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -9,8 +9,6 @@ import android.text.TextUtils; import android.util.Log; import android.webkit.URLUtil; -import de.danoeh.antennapod.core.service.playback.PlaybackService; -import de.danoeh.antennapod.core.util.IntentUtils; import org.apache.commons.io.FilenameUtils; import java.io.File; @@ -25,6 +23,7 @@ import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.DownloadRequest; import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.util.FileNameGenerator; +import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.URLChecker; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java index aa5706ad0..f91e2ad08 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java @@ -19,6 +19,8 @@ import de.danoeh.antennapod.core.util.comparator.SearchResultValueComparator; * Performs search on Feeds and FeedItems */ public class FeedSearcher { + private FeedSearcher(){} + private static final String TAG = "FeedSearcher"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 51b41d3b3..8ebd8eeb5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -12,8 +12,20 @@ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; import android.media.MediaMetadataRetriever; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; + +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; + import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.event.ProgressEvent; import de.danoeh.antennapod.core.feed.Chapter; @@ -26,14 +38,6 @@ import de.danoeh.antennapod.core.service.download.DownloadStatus; import de.danoeh.antennapod.core.util.LongIntMap; import de.danoeh.antennapod.core.util.flattr.FlattrStatus; import de.greenrobot.event.EventBus; -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Set; // TODO Remove media column from feeditem table diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java index a1100a976..e391af1b2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java @@ -5,7 +5,6 @@ import android.util.Log; import org.xml.sax.Attributes; -import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.syndication.handler.HandlerState; @@ -22,9 +21,6 @@ public class NSRSS20 extends Namespace { private static final String TAG = "NSRSS20"; - private static final String NSTAG = "rss"; - private static final String NSURI = ""; - public static final String CHANNEL = "channel"; public static final String ITEM = "item"; private static final String GUID = "guid"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java index 1836bbec1..e5fbdb9bb 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java @@ -15,7 +15,6 @@ public abstract class Namespace { public abstract SyndElement handleElementStart(String localName, HandlerState state, Attributes attributes); /** Called by a Feedhandler when in endElement and it detects a namespace element - * @return true if namespace handled the element, false if it ignored it * */ public abstract void handleElementEnd(String localName, HandlerState state); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java index aab1b1a5b..83957456a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java @@ -47,8 +47,6 @@ public class NSAtom extends Namespace { private static final String LINK_REL_ARCHIVES = "archives"; private static final String LINK_REL_ENCLOSURE = "enclosure"; private static final String LINK_REL_PAYMENT = "payment"; - private static final String LINK_REL_RELATED = "related"; - private static final String LINK_REL_SELF = "self"; private static final String LINK_REL_NEXT = "next"; // type-values private static final String LINK_TYPE_ATOM = "application/atom+xml"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java index b513fbe99..3cb226add 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java @@ -28,7 +28,6 @@ public final class Converter { /** Determines the length of the number for best readability.*/ private static final int NUM_LENGTH = 1024; - private static final int DAYS_MIL = 86400000; private static final int HOURS_MIL = 3600000; private static final int MINUTES_MIL = 60000; private static final int SECONDS_MIL = 1000; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java index e17d8de3e..5141e3a78 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java @@ -17,7 +17,9 @@ import java.util.TimeZone; */ public class DateUtils { - private static final String TAG = "DateUtils"; + private DateUtils(){} + + private static final String TAG = "DateUtils"; private static final TimeZone defaultTimezone = TimeZone.getTimeZone("GMT"); @@ -135,7 +137,7 @@ public class DateUtils { if (parts.length >= 2) { result += Integer.parseInt(parts[idx]) * 60000L; idx++; - result += (Float.parseFloat(parts[idx])) * 1000L; + result += (long) (Float.parseFloat(parts[idx]) * 1000L); } return result; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java index 76a6549ae..826c06822 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java @@ -5,6 +5,7 @@ import java.util.List; import de.danoeh.antennapod.core.feed.FeedItem; public class FeedItemUtil { + private FeedItemUtil(){} public static int indexOfItemWithDownloadUrl(List<FeedItem> items, String downloadUrl) { if(items == null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java index aaaaf8f4d..e81ab47ed 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java @@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo; import java.util.List; public class IntentUtils { + private IntentUtils(){} /* * Checks if there is at least one exported activity that can be performed for the intent diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java index 7ec7f84c4..90e0b0981 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java @@ -5,6 +5,9 @@ import android.support.v4.util.ArrayMap; import java.nio.charset.Charset; public class LangUtils { + + private LangUtils(){} + public static final Charset UTF_8 = Charset.forName("UTF-8"); private static final ArrayMap<String, String> languages; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java index cbda583fa..0120790ed 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java @@ -22,11 +22,11 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import rx.Observable; -import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; public class NetworkUtils { + private NetworkUtils(){} private static final String TAG = NetworkUtils.class.getSimpleName(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java index ee306a401..d1818aeef 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java @@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit; * Media file should be "rewinded" x seconds after user resumes the playback. */ public class RewindAfterPauseUtils { + private RewindAfterPauseUtils(){} public static final long ELAPSED_TIME_FOR_SHORT_REWIND = TimeUnit.MINUTES.toMillis(1); public static final long ELAPSED_TIME_FOR_MEDIUM_REWIND = TimeUnit.HOURS.toMillis(1); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java index 1ef81bf64..3a6bf5755 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java @@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.preferences.UserPreferences; * Utility functions for handling storage errors */ public class StorageUtils { + private StorageUtils(){} + private static final String TAG = "StorageUtils"; public static boolean storageAvailable() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java index 03d0f10ff..14f091249 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -3,14 +3,15 @@ package de.danoeh.antennapod.core.util; import android.content.Context; import android.support.annotation.AttrRes; import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; import android.util.Log; - import android.util.TypedValue; + import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.preferences.UserPreferences; public class ThemeUtils { + private ThemeUtils(){} + private static final String TAG = "ThemeUtils"; public static int getSelectionBackgroundColor() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java index ad723c685..3a2a4ac80 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java @@ -11,12 +11,13 @@ import android.os.Build; import android.os.SystemClock; import android.support.annotation.RequiresApi; import android.util.Log; -import de.danoeh.antennapod.core.receiver.FeedUpdateReceiver; -import de.danoeh.antennapod.core.service.FeedUpdateJobService; import java.util.Calendar; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.receiver.FeedUpdateReceiver; +import de.danoeh.antennapod.core.service.FeedUpdateJobService; + public class AutoUpdateManager { private static final int JOB_ID_FEED_UPDATE = 42; private static final String TAG = "AutoUpdateManager"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java index 45cb56988..d4d5843d2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java @@ -11,7 +11,9 @@ import de.danoeh.antennapod.core.BuildConfig; /** Ensures that only one instance of the FlattrService class exists at a time */ class FlattrServiceCreator { - private static final String TAG = "FlattrServiceCreator"; + private FlattrServiceCreator(){} + + public static final String TAG = "FlattrServiceCreator"; private static volatile FlattrService flattrService; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java index 313d1c2f2..919fc82f2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java @@ -1,8 +1,6 @@ package de.danoeh.antennapod.core.util.flattr; import android.content.Context; -import android.content.DialogInterface; -import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; @@ -36,6 +34,8 @@ import de.danoeh.antennapod.core.storage.DBWriter; */ public class FlattrUtils { + private FlattrUtils(){} + private static final String TAG = "FlattrUtils"; private static final String HOST_NAME = "de.danoeh.antennapod"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/gui/MoreContentListFooterUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/gui/MoreContentListFooterUtil.java index 386f46724..6e5c3e84b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/gui/MoreContentListFooterUtil.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/gui/MoreContentListFooterUtil.java @@ -27,8 +27,8 @@ public class MoreContentListFooterUtil { } public void setLoadingState(boolean newState) { - final ImageView imageView = (ImageView) root.findViewById(R.id.imgExpand); - final ProgressBar progressBar = (ProgressBar) root.findViewById(R.id.progBar); + final ImageView imageView = root.findViewById(R.id.imgExpand); + final ProgressBar progressBar = root.findViewById(R.id.progBar); if (newState) { imageView.setVisibility(View.GONE); progressBar.setVisibility(View.VISIBLE); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java index 2a537dc62..52a43aab2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java @@ -6,6 +6,7 @@ import android.app.NotificationManager; import android.content.Context; import android.os.Build; import android.support.annotation.RequiresApi; + import de.danoeh.antennapod.core.R; public class NotificationUtils { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java index a576dd497..b04c02075 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java @@ -7,6 +7,7 @@ import de.danoeh.antennapod.core.R; /** Utility class for MediaPlayer errors. */ public class MediaPlayerError { + private MediaPlayerError(){} /** Get a human-readable string for a specific error code. */ public static String getErrorString(Context context, int code) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java index ff7f5b79d..da9b96430 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java @@ -176,6 +176,8 @@ public interface Playable extends Parcelable, * Provides utility methods for Playable objects. */ class PlayableUtils { + private PlayableUtils(){} + private static final String TAG = "PlayableUtils"; /** diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index 31067839a..408789cc9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -7,12 +7,10 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; -import android.content.SharedPreferences; import android.content.res.TypedArray; import android.media.MediaPlayer; import android.os.Build; import android.os.IBinder; -import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; @@ -24,10 +22,8 @@ import android.widget.ImageButton; import android.widget.SeekBar; import android.widget.TextView; -import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.core.R; @@ -42,12 +38,10 @@ import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.playback.Playable.PlayableUtils; -import rx.Completable; import rx.Observable; import rx.Single; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; -import rx.observers.Subscribers; import rx.schedulers.Schedulers; /** @@ -702,7 +696,7 @@ public abstract class PlaybackController { return org.antennapod.audio.MediaPlayer.isPrestoLibraryInstalled(activity.getApplicationContext()) || UserPreferences.useSonic() || Build.VERSION.SDK_INT >= 23 - || playbackService != null && playbackService.canSetSpeed(); + || (playbackService != null && playbackService.canSetSpeed()); } public void setPlaybackSpeed(float speed) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackServiceStarter.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackServiceStarter.java index 3ba553d12..f7d2ee409 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackServiceStarter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackServiceStarter.java @@ -3,7 +3,9 @@ package de.danoeh.antennapod.core.util.playback; import android.content.Context; import android.content.Intent; import android.media.MediaPlayer; +import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; + import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.service.playback.PlaybackService; diff --git a/core/src/main/res/drawable-hdpi/ic_cellphone_text_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_cellphone_text_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..71ccc26ea --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_cellphone_text_grey600_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_cellphone_text_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_cellphone_text_white_24dp.png Binary files differnew file mode 100644 index 000000000..70e52c60b --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_cellphone_text_white_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_cellphone_text_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_cellphone_text_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..c26da2ce2 --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_cellphone_text_grey600_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_cellphone_text_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_cellphone_text_white_24dp.png Binary files differnew file mode 100644 index 000000000..8569a642d --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_cellphone_text_white_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_cellphone_text_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_cellphone_text_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..fc8219fa9 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_cellphone_text_grey600_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_cellphone_text_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_cellphone_text_white_24dp.png Binary files differnew file mode 100644 index 000000000..9468fa9a9 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_cellphone_text_white_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..82a453f05 --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_white_24dp.png Binary files differnew file mode 100644 index 000000000..d1f990a65 --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_cellphone_text_white_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..829b15396 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_white_24dp.png Binary files differnew file mode 100644 index 000000000..baa783a92 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_cellphone_text_white_24dp.png diff --git a/core/src/main/res/values-de/strings.xml b/core/src/main/res/values-de/strings.xml index b31056a7a..b8f4ffbab 100644 --- a/core/src/main/res/values-de/strings.xml +++ b/core/src/main/res/values-de/strings.xml @@ -60,15 +60,16 @@ <string name="yes">Ja</string> <string name="no">Nein</string> <string name="reset">Reset</string> - <string name="author_label">Autor</string> + <string name="author_label">Autor(en)</string> <string name="language_label">Sprache</string> <string name="url_label">URL</string> <string name="podcast_settings_label">Einstellungen</string> <string name="cover_label">Bild</string> <string name="error_label">Fehler</string> <string name="error_msg_prefix">Ein Fehler ist aufgetreten:</string> + <string name="needs_storage_permission">Für diese Funktion wird die Speicher-Berechtigung benötigt</string> <string name="refresh_label">Aktualisieren</string> - <string name="external_storage_error_msg">Der externe Speicher ist nicht verfügbar. Bitte stelle sicher, dass das externe Speichermedium eingelegt ist, damit die Anwendung funktioniert.</string> + <string name="external_storage_error_msg">Der externe Speicher ist nicht verfügbar. Bitte stelle sicher, dass das externe Speichermedium eingelegt ist, damit die App funktioniert.</string> <string name="chapters_label">Kapitel</string> <string name="chapter_duration">Dauer: %1$s</string> <string name="shownotes_label">Shownotizen</string> @@ -117,17 +118,16 @@ <string name="show_feed_settings_label">Zeige Feed-Einstellungen</string> <string name="feed_info_label">Feed-Informationen</string> <string name="feed_settings_label">Feed-Einstellungen</string> - <string name="rename_feed_label">Podcast umbenennen</string> + <string name="rename_feed_label">Feed umbenennen</string> <string name="remove_feed_label">Podcast entfernen</string> <string name="share_label">Teilen…</string> - <string name="share_link_label">Teile Link</string> - <string name="share_file_label">Teile Datei</string> + <string name="share_link_label">Episoden URL Teilen</string> <string name="share_link_with_position_label">Teile Link mit Zeitmarke</string> + <string name="share_file_label">Teile Datei</string> <string name="share_feed_url_label">Teile URL des Podcasts</string> - <string name="share_item_url_label">Teile URL der Episode</string> - <string name="share_item_url_with_position_label">Teile URL der Episode mit Zeitmarke</string> - <string name="feed_delete_confirmation_msg">Bitte bestätige, dass du den Feed \"%1$s\" und ALLE heruntergeladenen Episoden löschen möchtest.</string> - <string name="feed_remover_msg">Entferne Feed</string> + <string name="share_item_url_label">Teile URL der Episodendatei</string> + <string name="share_item_url_with_position_label">Teile URL der Episodendatei mit Zeitmarke</string> + <string name="feed_delete_confirmation_msg">Bitte bestätige, dass du den Podcast \"%1$s\" und ALLE heruntergeladenen Episoden dieses Feeds entfernen möchtest.</string> <string name="load_complete_feed">Kompletten Feed aktualisieren</string> <string name="hide_episodes_title">Episoden verbergen</string> <string name="batch_edit">Stapelbearbeitung</string> @@ -139,6 +139,7 @@ <string name="hide_downloaded_episodes_label">Heruntergeladen</string> <string name="hide_not_downloaded_episodes_label">Nicht heruntergeladen</string> <string name="hide_has_media_label">Hat Medien</string> + <string name="hide_is_favorite_label">Favorit</string> <string name="filtered_label">Gefiltert</string> <string name="refresh_failed_msg">{fa-exclamation-circle} Aktualisierung fehlgeschlagen</string> <string name="open_podcast">Podcast öffnen</string> @@ -152,6 +153,7 @@ <string name="delete_label">Löschen</string> <string name="delete_failed">Die Datei kann nicht gelöscht werden. Eventuell hilft es, das Gerät neu zu starten.</string> <string name="remove_episode_lable">Episode entfernen</string> + <string name="mark_as_seen_label">Als gelesen markieren</string> <string name="marked_as_seen_label">Als gesehen markiert</string> <string name="mark_read_label">Als gespielt markieren</string> <string name="marked_as_read_label">Als gespielt markiert</string> @@ -244,7 +246,7 @@ <string name="date">Datum</string> <string name="duration">Dauer</string> <string name="episode_title">Episodentitel</string> - <string name="feed_title">Podcastname</string> + <string name="feed_title">Feedname</string> <string name="random">Zufällig</string> <string name="smart_shuffle">Schlaues Mischen</string> <string name="ascending">Aufsteigend</string> @@ -302,7 +304,7 @@ <string name="appearance">Erscheinungsbild</string> <string name="external_elements">Externe Elemente</string> <string name="interruptions">Unterbrechungen</string> - <string name="buttons">Knöpfe</string> + <string name="buttons">Buttons zur Steuerung der Wiedergabe</string> <string name="media_player">Medienabspieler</string> <string name="pref_episode_cleanup_title">Automatisches Löschen</string> <string name="pref_episode_cleanup_summary">Episoden, die weder in der Abspielliste noch Favoriten sind, können gelöscht werden, wenn beim automatischen Herunterladen Speicherplatz für neue Episoden gebraucht wird</string> @@ -359,7 +361,6 @@ <string name="pref_nav_drawer_feed_order_title">Reihenfolge der Abonnements einstellen</string> <string name="pref_nav_drawer_feed_order_sum">Ändere die Reihenfolge deiner Abonnements</string> <string name="pref_nav_drawer_feed_counter_title">Abonnement-Zähler einstellen</string> - <string name="pref_nav_drawer_feed_counter_sum">Ändere, welche Information der Abonnement-Zähler anzeigt</string> <string name="pref_set_theme_sum">Ändere das Aussehen von AntennaPod.</string> <string name="pref_automatic_download_title">Automatisches Herunterladen</string> <string name="pref_automatic_download_sum">Konfiguriere das automatische Herunterladen von Episoden.</string> @@ -373,7 +374,6 @@ <string name="pref_episode_cache_title">Episodenspeicher</string> <string name="pref_theme_title_light">Hell</string> <string name="pref_theme_title_dark">Dunkel</string> - <string name="pref_theme_title_trueblack">Echtes Schwarz</string> <string name="pref_episode_cache_unlimited">Unbegrenzt</string> <string name="pref_update_interval_hours_plural">Stunden</string> <string name="pref_update_interval_hours_singular">Stunde</string> @@ -437,10 +437,10 @@ <string name="pref_enqueue_downloaded_title">Downloads einreihen</string> <string name="pref_enqueue_downloaded_summary">Füge heruntergeladene Episoden zur Abspielliste hinzu</string> <string name="media_player_builtin">Androids eingebauter Abspieler</string> - <string name="pref_videoBehavior_title">Video-Verhalten</string> + <string name="pref_videoBehavior_title">Beim Beenden des Videos</string> <string name="pref_videoBehavior_sum">Verhalten beim Verlassen der Video-Wiedergabe</string> <string name="stop_playback">Wiedergabe anhalten</string> - <string name="continue_playback">Wiedergabe fortsetzen</string> + <string name="continue_playback">Audiowiedergabe fortsetzen</string> <!--Auto-Flattr dialog--> <string name="auto_flattr_enable">Automatisches Flattrn aktivieren</string> <string name="auto_flattr_after_percent">Flattr eine Episode, sobald %d Prozent gespielt worden sind</string> @@ -450,8 +450,6 @@ <string name="search_hint">Suche nach Episoden</string> <string name="found_in_shownotes_label">In Shownotizen gefunden</string> <string name="found_in_chapters_label">In Kapiteln gefunden</string> - <string name="found_in_authors_label">In Autoren gefunden</string> - <string name="found_in_feeds_label">In Feeds gefunden</string> <string name="search_status_no_results">Keine Ergebnisse gefunden</string> <string name="search_label">Suchen</string> <string name="found_in_title_label">In Titel gefunden</string> diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index c02b700e4..7e2fed054 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -272,4 +272,9 @@ <item>stop</item> <item>continue</item> </string-array> + + <string-array name="batch_long_press_options"> + <item>@string/select_all_above</item> + <item>@string/select_all_below</item> + </string-array> </resources> diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 82d0a39bf..16a6d9185 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -55,6 +55,7 @@ <attr name="ic_create_new_folder" format="reference"/> <attr name="ic_cast_disconnect" format="reference"/> <attr name="ic_swap" format="reference"/> + <attr name="ic_cellphone_text" format="reference"/> <attr name="ic_question_answer" format="reference" /> <attr name="ic_bug" format="reference" /> <attr name="ic_known_issues" format="reference" /> diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 8ae9957cb..ad91ecc76 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -144,6 +144,8 @@ <string name="load_complete_feed">Refresh complete podcast</string> <string name="hide_episodes_title">Hide Episodes</string> <string name="batch_edit">Batch edit</string> + <string name="select_all_above">Select all above</string> + <string name="select_all_below">Select all below</string> <string name="hide_unplayed_episodes_label">Unplayed</string> <string name="hide_paused_episodes_label">Paused</string> <string name="hide_played_episodes_label">Played</string> @@ -335,7 +337,7 @@ <string name="pref_unpauseOnHeadsetReconnect_sum">Resume playback when the headphones are reconnected</string> <string name="pref_unpauseOnBluetoothReconnect_sum">Resume playback when bluetooth reconnects</string> <string name="pref_hardwareForwardButtonSkips_title">Forward Button Skips</string> - <string name="pref_hardwareForwardButtonSkips_sum">When pressing a hardware forward button skip to the next episode instead of fast-forwarding</string> + <string name="pref_hardwareForwardButtonSkips_sum">When pressing a forward button on a bluetooth-connected device skip to the next episode instead of fast-forwarding</string> <string name="pref_hardwarePreviousButtonRestarts_title">Previous button restarts</string> <string name="pref_hardwarePreviousButtonRestarts_sum">When pressing a hardware previous button restart playing the current episode instead of rewinding</string> <string name="pref_followQueue_sum">Jump to next queue item when playback completes</string> @@ -427,8 +429,8 @@ <string name="pref_rewind_sum">Customize the number of seconds to jump backwards when the rewind button is clicked</string> <string name="pref_gpodnet_sethostname_title">Set hostname</string> <string name="pref_gpodnet_sethostname_use_default_host">Use default host</string> - <string name="pref_expandNotify_title">Expand Notification</string> - <string name="pref_expandNotify_sum">Always expand the notification to show playback buttons.</string> + <string name="pref_expandNotify_title">High Notification priority</string> + <string name="pref_expandNotify_sum">This usually expands the notification to show playback buttons.</string> <string name="pref_persistNotify_title">Persistent Playback Controls</string> <string name="pref_persistNotify_sum">Keep notification and lockscreen controls when playback is paused.</string> <string name="pref_compact_notification_buttons_title">Set Lockscreen Buttons</string> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 7bc27aa6a..353050066 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -66,6 +66,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_grey600_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> + <item type="attr" name="ic_cellphone_text">@drawable/ic_cellphone_text_grey600_24dp</item> <item type="attr" name="ic_question_answer">@drawable/ic_forum_grey600_24dp</item> <item type="attr" name="ic_bug">@drawable/ic_bug_grey600_24dp</item> <item type="attr" name="ic_known_issues">@drawable/ic_format_list_bulleted_grey600_24dp</item> @@ -146,6 +147,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_white_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> + <item type="attr" name="ic_cellphone_text">@drawable/ic_cellphone_text_white_24dp</item> <item type="attr" name="ic_question_answer">@drawable/ic_baseline_question_answer_white_24dp</item> <item type="attr" name="ic_bug">@drawable/ic_bug_white_24dp</item> <item type="attr" name="ic_known_issues">@drawable/ic_format_list_bulleted_white_24dp</item> @@ -246,6 +248,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_grey600_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> + <item type="attr" name="ic_cellphone_text">@drawable/ic_cellphone_text_grey600_24dp</item> <item type="attr" name="ic_question_answer">@drawable/ic_forum_grey600_24dp</item> <item type="attr" name="ic_bug">@drawable/ic_bug_grey600_24dp</item> <item type="attr" name="ic_known_issues">@drawable/ic_format_list_bulleted_grey600_24dp</item> @@ -325,6 +328,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_white_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> + <item type="attr" name="ic_cellphone_text">@drawable/ic_cellphone_text_white_24dp</item> <item type="attr" name="ic_question_answer">@drawable/ic_baseline_question_answer_white_24dp</item> <item type="attr" name="ic_bug">@drawable/ic_bug_white_24dp</item> <item type="attr" name="ic_known_issues">@drawable/ic_format_list_bulleted_white_24dp</item> diff --git a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java index f12f1d806..9af76cf86 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java @@ -14,6 +14,7 @@ import de.danoeh.antennapod.core.util.NetworkUtils; * Apps using the core module of AntennaPod should register implementations of all interfaces here. */ public class ClientConfig { + private ClientConfig(){} /** * Should be used when setting User-Agent header for HTTP-requests. diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/CastManager.java b/core/src/play/java/de/danoeh/antennapod/core/cast/CastManager.java index 27fb7344d..5198a76bd 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/CastManager.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/CastManager.java @@ -1440,12 +1440,6 @@ public class CastManager extends BaseCastManager implements OnFailedListener { return idleReason; } - private void onMessageSendFailed(int errorCode) { - for (CastConsumer consumer : castConsumers) { - consumer.onDataMessageSendFailed(errorCode); - } - } - /* * This is called by onStatusUpdated() of the RemoteMediaPlayer */ diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java index aec559a5f..88da6a0ec 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java @@ -23,6 +23,8 @@ import de.danoeh.antennapod.core.util.playback.Playable; * Helper functions for Cast support. */ public class CastUtils { + private CastUtils(){} + private static final String TAG = "CastUtils"; public static final String KEY_MEDIA_ID = "de.danoeh.antennapod.core.cast.MediaId"; diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java b/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java index c6524e868..1c6dd30c4 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java @@ -24,7 +24,6 @@ import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.MediaType; -import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.util.ChapterUtils; import de.danoeh.antennapod.core.util.playback.Playable; diff --git a/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java b/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java index e36a09f00..b9cba05b4 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java @@ -5,8 +5,6 @@ import org.junit.Test; import static de.danoeh.antennapod.core.feed.FeedItemMother.anyFeedItemWithImage; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; public class FeedItemTest { |