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

Commit 0250bc2f authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Catch exception when ViewRoot's surface is not valid. Bug #3399426" into honeycomb

parents 8f9fb947 fea12b87
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;