Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6745c813 authored by Ahan Wu's avatar Ahan Wu
Browse files

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
parent 56390042
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
    }