Fix 2926276: Remove spurrious warning about unspecified measurespec.
Only issue the warning in debug mode.
Change-Id: I5fecb2e6b0013ce775187a878f5a81317e758f2c
diff --git a/core/java/com/android/internal/widget/SlidingTab.java b/core/java/com/android/internal/widget/SlidingTab.java
index 3218ba8..4b56cb4 100644
--- a/core/java/com/android/internal/widget/SlidingTab.java
+++ b/core/java/com/android/internal/widget/SlidingTab.java
@@ -474,10 +474,13 @@
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
- if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) {
- Log.e("SlidingTab", "SlidingTab cannot have UNSPECIFIED MeasureSpec"
- +"(wspec=" + widthSpecMode + ", hspec=" + heightSpecMode + ")",
- new RuntimeException(LOG_TAG + "stack:"));
+ if (DBG) {
+ if (widthSpecMode == MeasureSpec.UNSPECIFIED
+ || heightSpecMode == MeasureSpec.UNSPECIFIED) {
+ Log.e("SlidingTab", "SlidingTab cannot have UNSPECIFIED MeasureSpec"
+ +"(wspec=" + widthSpecMode + ", hspec=" + heightSpecMode + ")",
+ new RuntimeException(LOG_TAG + "stack:"));
+ }
}
mLeftSlider.measure();