From 6033ceb438d2d8e6c8406e2b61ae515e6156965c Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 5 Feb 2014 12:37:42 -0800 Subject: Ensure we don't call getLayoutDirection() for devices not running JB MR1+. (Bug 12906355) Change-Id: I25115b9529c21d3079f50bc26bad8f846a6fcd3e --- src/com/android/launcher3/DeviceProfile.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 7ca4f811c..e67ec197a 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -371,7 +371,11 @@ public class DeviceProfile { isLandscape = (configuration.orientation == Configuration.ORIENTATION_LANDSCAPE); isTablet = resources.getBoolean(R.bool.is_tablet); isLargeTablet = resources.getBoolean(R.bool.is_large_tablet); - isLayoutRtl = (configuration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) { + isLayoutRtl = (configuration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL); + } else { + isLayoutRtl = false; + } widthPx = wPx; heightPx = hPx; availableWidthPx = awPx; -- cgit v1.2.3