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

Commit 82d3cd69 authored by Adam Powell's avatar Adam Powell
Browse files

Improve error reporting for buggy View subclasses

When a view doesn't call setMeasuredDimension, note the view ID
and class name as part of the exception message.

Bug 18037248

Change-Id: I1c5ed823378ad92a067801dc8c3be31b07c6f463
parent 8148f8b6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18173,7 +18173,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            // flag not set, setMeasuredDimension() was not invoked, we raise
            // an exception to warn the developer
            if ((mPrivateFlags & PFLAG_MEASURED_DIMENSION_SET) != PFLAG_MEASURED_DIMENSION_SET) {
                throw new IllegalStateException("onMeasure() did not set the"
                throw new IllegalStateException("View with id " + getId() + ": "
                        + getClass().getName() + "#onMeasure() did not set the"
                        + " measured dimension by calling"
                        + " setMeasuredDimension()");
            }