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:
parent
35b2fc8520
commit
a7701e4b64
1 changed files with 1 additions and 1 deletions
|
@ -209,8 +209,8 @@ public class DownloadImagesService extends IntentService {
|
||||||
for(Object itemObj : sortHashMapByValuesD(files).keySet())
|
for(Object itemObj : sortHashMapByValuesD(files).keySet())
|
||||||
{
|
{
|
||||||
File file = (File) itemObj;
|
File file = (File) itemObj;
|
||||||
file.delete();
|
|
||||||
size -= file.length();
|
size -= file.length();
|
||||||
|
file.delete();
|
||||||
if(size < max_allowed_size)
|
if(size < max_allowed_size)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue