mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-01-28 16:51:26 -05:00
clear Glide disk cache when device storage has less than 2% left
https://bumptech.github.io/glide/doc/caching.html#disk-cache !1025
This commit is contained in:
@@ -4,6 +4,8 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import org.fdroid.fdroid.DeleteCacheService;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
import org.fdroid.fdroid.work.CleanCacheWorker;
|
||||
@@ -21,6 +23,7 @@ public class DeviceStorageReceiver extends BroadcastReceiver {
|
||||
CleanCacheWorker.force(context);
|
||||
if (percentageFree <= 2) {
|
||||
DeleteCacheService.deleteAll(context);
|
||||
Glide.get(context).clearDiskCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user