summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCuong <cuongbui@gmail.com>2012-06-04 00:52:19 +0200
committerDanny Baumann <dannybaumann@web.de>2012-06-07 11:33:19 +0200
commit81af0ca973750969c6e54cf1b5b337092377f649 (patch)
tree6277259f96b1330bc5d6b23ba65c8f40c8e1b779
parented6677bed32d246e381f84fd940887a26727e8f0 (diff)
downloadframeworks_base-81af0ca973750969c6e54cf1b5b337092377f649.zip
frameworks_base-81af0ca973750969c6e54cf1b5b337092377f649.tar.gz
frameworks_base-81af0ca973750969c6e54cf1b5b337092377f649.tar.bz2
fixed external BT gps date/time issue reported by Jason Lynch
Change-Id: I466f623a9f6066228d0749be0b3afeec91502197
-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;