summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2011-09-08 16:09:06 +0200
committerDanny Baumann <dannybaumann@web.de>2011-09-08 16:09:06 +0200
commit63c63e6717215243333b3443e067916ca323618a (patch)
tree913abfe4000e6ea19dd63f51793934de7d1d98cd
parentce1924ee64146ebe687d829fc1fbb8adfef1cbe0 (diff)
downloadpackages_apps_Contacts-63c63e6717215243333b3443e067916ca323618a.tar.gz
packages_apps_Contacts-63c63e6717215243333b3443e067916ca323618a.tar.bz2
packages_apps_Contacts-63c63e6717215243333b3443e067916ca323618a.zip
Always make sure the timezone of the date parser is correct prior to
parsing. Change-Id: Ie70deebb697ea1fbc5ef357d70a983b5fdbe1129
-rw-r--r--src/com/android/contacts/model/FallbackSource.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/contacts/model/FallbackSource.java b/src/com/android/contacts/model/FallbackSource.java
index 4751f8279..d73ca924c 100644
--- a/src/com/android/contacts/model/FallbackSource.java
+++ b/src/com/android/contacts/model/FallbackSource.java
@@ -780,10 +780,7 @@ public class FallbackSource extends ContactsSource {
* Some servers (e.g. Exchange) use 'Z' as timezone, indicating
* that the time is in UTC. The SimpleDateFormat routines don't
* support that format, so replace 'Z' by 'GMT'.
- * Also make sure to reset the format time zone back to default
- * in case it was changed by a previous run.
*/
- sFullDateFormat.setTimeZone(TimeZone.getDefault());
Date date = parseDate(valueString.replace("Z", "GMT"), sFullDateFormat);
if (date != null) {
return date;
@@ -794,6 +791,8 @@ public class FallbackSource extends ContactsSource {
private static Date parseDate(String value, SimpleDateFormat format) {
try {
+ /* Reset format time zone in case it was changed by a previous run */
+ format.setTimeZone(TimeZone.getDefault());
return format.parse(value);
} catch (ParseException e) {
}