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

Commit 6e6db618 authored by Chet Haase's avatar Chet Haase
Browse files

Fix display list issue that was crashing an external app.

The app was removing a View whilst in its onDraw() method. This meant
that we asked it for its display list and it invalidated that display list
(by removing itself) before it returned from onDraw(). We later attempted to
draw that invalid display list into its parent nad died in native code.

The fix is to check the state of the display list after the call to getDisplayList()
and to avoid doing further work with it if it's invalid.

Change-Id: I14a342b4fe79c8dce2626ff61237b447040e7f42
parent d359b575
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2824,6 +2824,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager

        if (hasDisplayList) {
            displayList = child.getDisplayList();
            if (!displayList.isValid()) {
                // Uncommon, but possible. If a view is removed from the hierarchy during the call
                // to getDisplayList(), the display list will be marked invalid and we should not
                // try to use it again.
                displayList = null;
                hasDisplayList = false;
            }
        }

        if (hasNoCache) {