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

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

Merge "Attempt to recover from apps destroying their window at draw time Bug #6436642" into jb-dev

parents 2db084fa 1f59e5c1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ public final class ViewRootImpl implements ViewParent,
    boolean mHasHadWindowFocus;
    boolean mLastWasImTarget;
    boolean mWindowsAnimating;
    boolean mIsDrawing;
    int mLastSystemUiVisibility;

    // Pool of queued input events.
@@ -2038,10 +2039,12 @@ public final class ViewRootImpl implements ViewParent,
        final boolean fullRedrawNeeded = mFullRedrawNeeded;
        mFullRedrawNeeded = false;

        mIsDrawing = true;
        Trace.traceBegin(Trace.TRACE_TAG_VIEW, "draw");
        try {
            draw(fullRedrawNeeded);
        } finally {
            mIsDrawing = false;
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }

@@ -3963,7 +3966,12 @@ public final class ViewRootImpl implements ViewParent,
        if (immediate) {
            doDie();
        } else {
            if (!mIsDrawing) {
                destroyHardwareRenderer();
            } else {
                Log.e(TAG, "Attempting to destroy the window while drawing!\n" +
                        "  window=" + this + ", title=" + mWindowAttributes.getTitle());
            }
            mHandler.sendEmptyMessage(MSG_DIE);
        }
    }