Commit 19139893 authored by newt's avatar newt Committed by Commit bot

Fix crash on certain devices when showing week and month picker.

This skips a method call on devices where it would cause a crash.

BUG=463719

Review URL: https://codereview.chromium.org/969413003

Cr-Commit-Position: refs/heads/master@{#319020}
parent 8fadaded
......@@ -5,6 +5,7 @@
package org.chromium.ui.picker;
import android.content.Context;
import android.os.Build;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
......@@ -111,7 +112,12 @@ public abstract class TwoFieldDatePicker extends FrameLayout {
mYearSpinner.setOnLongPressUpdateInterval(100);
mYearSpinner.setOnValueChangedListener(onChangeListener);
reorderSpinners();
// TODO(tobiasjs): reorderSpinners causes a crash on Android versions before JB MR2 because
// it calls DateFormat.getBestDateTimePattern() which isn't available before then. Fix this
// crash and call reorderSpinners on all devices. http://crbug.com/463719
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
reorderSpinners();
}
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment