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

Commit fea12b87 authored by Romain Guy's avatar Romain Guy
Browse files

Catch exception when ViewRoot's surface is not valid.

Bug #3399426

Change-Id: Id4e0b8714c9520c4e84e81c2978752d46c912b6b
parent 64a2c359
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1537,6 +1537,7 @@ public final class ViewRoot extends Handler implements ViewParent,
                int top = dirty.top;
                int right = dirty.right;
                int bottom = dirty.bottom;

                canvas = surface.lockCanvas(dirty);

                if (left != dirty.left || top != dirty.top || right != dirty.right ||
+3 −1
Original line number Diff line number Diff line
@@ -296,8 +296,10 @@ static inline SkBitmap::Config convertPixelFormat(PixelFormat format)
static jobject Surface_lockCanvas(JNIEnv* env, jobject clazz, jobject dirtyRect)
{
    const sp<Surface>& surface(getSurface(env, clazz));
    if (!Surface::isValid(surface))
    if (!Surface::isValid(surface)) {
        doThrow(env, "java/lang/IllegalArgumentException", NULL);
        return 0;
    }

    // get dirty region
    Region dirtyRegion;