summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2016-01-15 14:46:54 -0800
committerDanesh M <daneshm90@gmail.com>2016-01-15 14:53:35 -0800
commitf8e4ab690f3961f2240601b0956c0e1931e6a8d0 (patch)
tree815abe233c9eb27946676cacf15d32f5e08471a3
parentf5ec6ac071ac73f19f5dc8a5292a9b60069a379b (diff)
downloadpackages_apps_SetupWizard-f8e4ab690f3961f2240601b0956c0e1931e6a8d0.zip
packages_apps_SetupWizard-f8e4ab690f3961f2240601b0956c0e1931e6a8d0.tar.gz
packages_apps_SetupWizard-f8e4ab690f3961f2240601b0956c0e1931e6a8d0.tar.bz2
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
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/DateTimePage.java12
1 files changed, 12 insertions, 0 deletions
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() {