summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-06-10 13:02:17 +0400
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-06-10 13:02:17 +0400
commit4beb10830ab46c51c39ed13447ea0f053e0141b6 (patch)
tree3696f8d28934629bc32bca3c5e6631c88c27bd2c /services
parent40c624df63b210fee549888f3ecf34b9c9753ff1 (diff)
parent94e6ccd8e58070081405ea9becde5667db11b656 (diff)
downloadframeworks_base-4beb10830ab46c51c39ed13447ea0f053e0141b6.zip
frameworks_base-4beb10830ab46c51c39ed13447ea0f053e0141b6.tar.gz
frameworks_base-4beb10830ab46c51c39ed13447ea0f053e0141b6.tar.bz2
Merge "fixed external BT gps date/time issue reported by Jason Lynch" into ics
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/location/NMEAParser.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/services/java/com/android/server/location/NMEAParser.java b/services/java/com/android/server/location/NMEAParser.java
index 90bbe84..4acbf26 100644
--- a/services/java/com/android/server/location/NMEAParser.java
+++ b/services/java/com/android/server/location/NMEAParser.java
@@ -18,9 +18,7 @@ package com.android.server.location;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.Calendar;
import java.util.Date;
-import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.TimeZone;
import java.util.regex.Matcher;
@@ -37,7 +35,6 @@ public class NMEAParser {
// NMEA sentence pattern
private final Pattern sentencePattern = Pattern.compile("\\$([^*$]{5,})(\\*\\w{2})?");
private final SimpleDateFormat timeFormatter = new SimpleDateFormat("HHmmss.S");
- private final TimeZone mLocalTZ = TimeZone.getDefault();
private HashMap<String,ParseInterface> parseMap = new HashMap<String,ParseInterface>();
private String provider;
@@ -80,7 +77,6 @@ public class NMEAParser {
private boolean mSatsReady = true;
private Location loc = new Location(provider);
- private GregorianCalendar currCalendar = new GregorianCalendar();
/**
* @param prov Location provider name
@@ -163,13 +159,7 @@ public class NMEAParser {
private long parseTimeToDate(String time) {
try {
Date btTime = timeFormatter.parse(time);
- //System.currentTimeMillis()
- GregorianCalendar cc = new GregorianCalendar();
- cc.setTimeInMillis(System.currentTimeMillis());
- currCalendar.setTimeInMillis(btTime.getTime() + mLocalTZ.getRawOffset());
- currCalendar.set(cc.get(Calendar.YEAR), cc.get(Calendar.MONTH),
- cc.get(Calendar.DAY_OF_WEEK));
- return currCalendar.getTimeInMillis();
+ return btTime.getTime();
} catch (ParseException e) {
Log.e(TAG, "Could not parse: " + time);
return 0;