Purging the cache actually empty it

File.delete() returns 0 on a deleted file: the calculated cache size would
never decrease during a purge.
This commit is contained in:
Olivier Trichet 2015-03-29 12:25:07 +02:00
parent 35b2fc8520
commit a7701e4b64

View file

@ -209,8 +209,8 @@ public class DownloadImagesService extends IntentService {
for(Object itemObj : sortHashMapByValuesD(files).keySet())
{
File file = (File) itemObj;
file.delete();
size -= file.length();
file.delete();
if(size < max_allowed_size)
break;
}