Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java

Issue 969413003: Fix crash on certain devices when showing week and month picker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java
diff --git a/ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java b/ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java
index 8d72189944af79d43500e4ccbd289bf8bf7e435e..85d285023d76b92a333a18f4a9d0677c22eeb8a1 100644
--- a/ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java
+++ b/ui/android/java/src/org/chromium/ui/picker/TwoFieldDatePicker.java
@@ -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();
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698