Remove unused context from CacheCleaner
This commit is contained in:
parent
402fe961ba
commit
b25a118148
|
@ -131,7 +131,7 @@ public class PlaylistsFragment extends Fragment {
|
|||
List<Playlist> playlists = musicService.getPlaylists(refresh);
|
||||
|
||||
if (!ActiveServerProvider.Companion.isOffline())
|
||||
new CacheCleaner(getContext()).cleanPlaylists(playlists);
|
||||
new CacheCleaner().cleanPlaylists(playlists);
|
||||
return playlists;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public class MediaPlayerLifecycleSupport
|
|||
}
|
||||
});
|
||||
|
||||
new CacheCleaner(context).clean();
|
||||
new CacheCleaner().clean();
|
||||
created = true;
|
||||
Timber.i("LifecycleSupport created");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.moire.ultrasonic.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.StatFs;
|
||||
import timber.log.Timber;
|
||||
|
@ -31,13 +30,11 @@ public class CacheCleaner
|
|||
{
|
||||
private static final long MIN_FREE_SPACE = 500 * 1024L * 1024L;
|
||||
|
||||
private final Context context;
|
||||
private Lazy<Downloader> downloader = inject(Downloader.class);
|
||||
private Lazy<ActiveServerProvider> activeServerProvider = inject(ActiveServerProvider.class);
|
||||
|
||||
public CacheCleaner(Context context)
|
||||
public CacheCleaner()
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void clean()
|
||||
|
@ -168,7 +165,7 @@ public class CacheCleaner
|
|||
}
|
||||
}
|
||||
|
||||
Timber.i("Deleted : %s", Util.formatBytes(bytesDeleted));
|
||||
Timber.i("Deleted: %s", Util.formatBytes(bytesDeleted));
|
||||
}
|
||||
|
||||
private static void findCandidatesForDeletion(File file, List<File> files, List<File> dirs)
|
||||
|
|
|
@ -309,7 +309,7 @@ class DownloadFile(
|
|||
Timber.i("Released wake lock %s", wakeLock)
|
||||
}
|
||||
wifiLock?.release()
|
||||
CacheCleaner(context).cleanSpace()
|
||||
CacheCleaner().cleanSpace()
|
||||
downloader.value.checkDownloads()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue