Remove two warnings in Downloader

This commit is contained in:
tzugen 2021-05-21 23:04:35 +02:00
parent b8fbbd8c49
commit ed6c6c9057
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 8 additions and 14 deletions

View File

@ -1,6 +1,5 @@
package org.moire.ultrasonic.service;
import android.content.Context;
import timber.log.Timber;
import org.moire.ultrasonic.domain.MusicDirectory;
@ -37,7 +36,7 @@ public class Downloader
private final LocalMediaPlayer localMediaPlayer;
// TODO: This is a circular reference, try to remove
private Lazy<JukeboxMediaPlayer> jukeboxMediaPlayer = inject(JukeboxMediaPlayer.class);
private final Lazy<JukeboxMediaPlayer> jukeboxMediaPlayer = inject(JukeboxMediaPlayer.class);
private final List<DownloadFile> cleanupCandidates = new ArrayList<>();
private final LRUCache<MusicDirectory.Entry, DownloadFile> downloadFileCache = new LRUCache<>(100);
@ -54,19 +53,14 @@ public class Downloader
public void onCreate()
{
Runnable downloadChecker = new Runnable()
{
@Override
public void run()
Runnable downloadChecker = () -> {
try
{
try
{
checkDownloads();
}
catch (Throwable x)
{
Timber.e(x,"checkDownloads() failed.");
}
checkDownloads();
}
catch (Throwable x)
{
Timber.e(x,"checkDownloads() failed.");
}
};