Catch SecurityException while resolving image to avoid crashing.
Need catch SecurityException while resolving image from a uri to avoid unexpected crashing. Bug: 121453336 Test: Manually Change-Id: Idfef5e7593d11c688baddf2666052185d0281f6c
This commit is contained in:
@@ -87,8 +87,8 @@ public class NotificationInlineImageCache implements NotificationInlineImageReso
|
||||
|
||||
try {
|
||||
drawable = mResolver.resolveImage(target);
|
||||
} catch (IOException ex) {
|
||||
Log.d(TAG, "PreloadImageTask: Resolve failed from " + target);
|
||||
} catch (IOException | SecurityException ex) {
|
||||
Log.d(TAG, "PreloadImageTask: Resolve failed from " + target, ex);
|
||||
}
|
||||
|
||||
return drawable;
|
||||
|
||||
@@ -81,8 +81,8 @@ public class NotificationInlineImageResolver implements ImageResolver {
|
||||
Drawable result = null;
|
||||
try {
|
||||
result = hasCache() ? mImageCache.get(uri) : resolveImage(uri);
|
||||
} catch (IOException ex) {
|
||||
Log.d(TAG, "loadImage: Can't load image from " + uri);
|
||||
} catch (IOException | SecurityException ex) {
|
||||
Log.d(TAG, "loadImage: Can't load image from " + uri, ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user