From f8e4ab690f3961f2240601b0956c0e1931e6a8d0 Mon Sep 17 00:00:00 2001 From: Danesh M Date: Fri, 15 Jan 2016 14:46:54 -0800 Subject: [PATCH] SetupWizard : Set min date to Jan 1, 2016 GMT In the event that the current time returns us epoch, hard code the time so the user doesn't have to scroll all the way to 2016 when setting the time. CRACKLING-721 Change-Id: I7a4122320c80e941154b84f306565c0f9b452a7d --- .../cyanogenmod/setupwizard/setup/DateTimePage.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java index 15cfdca..7a5922b 100644 --- a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java +++ b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java @@ -188,6 +188,18 @@ public class DateTimePage extends SetupPage { }); } }); + // Pre-select current/default date if epoch + mHandler.post(new Runnable() { + @Override + public void run() { + final Calendar calendar = Calendar.getInstance(); + final boolean isEpoch = calendar.get(Calendar.YEAR) == 1970; + if (isEpoch) { + // If epoch, set date to a default date + setDate(getActivity(), 2016, Calendar.JANUARY, 1); + } + } + }); } private void showDatePicker() {