Throw IAE on invalid measure spec size

Crash immediately so that we can track down the cause. If we let it
through, we'll hit an ISE later in dispatchVsync() and never know why.

Bug: 21948478
Change-Id: I84edf93cdf09d755419e18a7606b7b6cbd059956
This commit is contained in:
Alan Viverette
2015-06-23 16:23:49 -07:00
parent c60408264c
commit ac6cfb32fe

View File

@@ -21041,6 +21041,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (sUseBrokenMakeMeasureSpec) {
return size + mode;
} else {
if (size < 0) {
throw new IllegalArgumentException("Measure spec size must be >= 0");
}
return (size & ~MODE_MASK) | (mode & MODE_MASK);
}
}