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

Commit f4588f83 authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am ec4d9040: Merge "Attempt to recover from apps destroying their window at...

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

* commit 'ec4d9040':
  Attempt to recover from apps destroying their window at draw time Bug #6436642
parents 2e353b35 ec4d9040
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);
        }
    }