Handle potentially poisoned bitmap cache caused by truncated images from the server

This commit is contained in:
Cameron Gutman 2015-08-17 17:59:15 -07:00
parent 792846ddad
commit af384d88f7

View File

@ -105,7 +105,11 @@ public class CachedAppAssetLoader {
// If there's a task associated with this load, we should return the bitmap // If there's a task associated with this load, we should return the bitmap
if (task != null) { if (task != null) {
return diskLoader.loadBitmapFromCache(tuple, (int) scalingDivider); // If the cached bitmap is valid, return it. Otherwise, we'll try the load again
Bitmap bmp = diskLoader.loadBitmapFromCache(tuple, (int) scalingDivider);
if (bmp != null) {
return bmp;
}
} }
else { else {
// Otherwise it's a background load and we return nothing // Otherwise it's a background load and we return nothing