diff options
author | John Spurlock <jspurlock@google.com> | 2014-03-03 13:38:01 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-03-03 13:38:01 -0500 |
commit | 756fa2ab9ff07ba994d4e45a32b7da77b4b5b168 (patch) | |
tree | 260d9fbda5723729abe7e78bf5c9925b5924669b | |
parent | 36c96866f316254ec3b22b2214eef0aa017421c0 (diff) | |
download | frameworks_base-756fa2ab9ff07ba994d4e45a32b7da77b4b5b168.zip frameworks_base-756fa2ab9ff07ba994d4e45a32b7da77b4b5b168.tar.gz frameworks_base-756fa2ab9ff07ba994d4e45a32b7da77b4b5b168.tar.bz2 |
Handle non-exact measure passes in ZenModeView.
Bug:13245581
Change-Id: I2c5f6632fde6559849e6f429d66c4d28d4d3a890
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java index 783e371..c4d2cce 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java @@ -261,10 +261,9 @@ public class ZenModeView extends RelativeLayout { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (DEBUG) log("onMeasure %s %s", MeasureSpec.toString(widthMeasureSpec), MeasureSpec.toString(heightMeasureSpec)); - if (MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY) { - throw new UnsupportedOperationException("Width must be exact"); - } - if (widthMeasureSpec != mWidthSpec) { + final boolean widthExact = MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY; + + if (!widthExact || (widthMeasureSpec != mWidthSpec)) { if (DEBUG) log(" super.onMeasure"); final int hms = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); super.onMeasure(widthMeasureSpec, hms); |