summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-05-06 15:18:59 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2010-05-06 15:18:59 -0700
commitf4dffd8a45386b5a5f0e6de4f30facc9eaac4001 (patch)
tree8bb50f53d5cc0458327cbca8ed93bb5228f188dd /location
parent71bd9fc81e3154b9cad22ca7ff2d9c6ed6fdbe6c (diff)
parentaf7c978216cec465ad038b579ffc2be3ca8c7c66 (diff)
downloadframeworks_base-f4dffd8a45386b5a5f0e6de4f30facc9eaac4001.zip
frameworks_base-f4dffd8a45386b5a5f0e6de4f30facc9eaac4001.tar.gz
frameworks_base-f4dffd8a45386b5a5f0e6de4f30facc9eaac4001.tar.bz2
merge from open-source master
Change-Id: I4c28751bd84b41259b12b0f3e3307e11234c8b64
Diffstat (limited to 'location')
-rwxr-xr-xlocation/java/com/android/internal/location/GpsLocationProvider.java46
1 files changed, 23 insertions, 23 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 15d692c..fa53ccf 100755
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -965,29 +965,6 @@ public class GpsLocationProvider implements LocationProviderInterface {
if (VERBOSE) Log.v(TAG, "reportLocation lat: " + latitude + " long: " + longitude +
" timestamp: " + timestamp);
- mLastFixTime = System.currentTimeMillis();
- // report time to first fix
- if (mTTFF == 0 && (flags & LOCATION_HAS_LAT_LONG) == LOCATION_HAS_LAT_LONG) {
- mTTFF = (int)(mLastFixTime - mFixRequestTime);
- if (DEBUG) Log.d(TAG, "TTFF: " + mTTFF);
-
- // notify status listeners
- synchronized(mListeners) {
- int size = mListeners.size();
- for (int i = 0; i < size; i++) {
- Listener listener = mListeners.get(i);
- try {
- listener.mListener.onFirstFix(mTTFF);
- } catch (RemoteException e) {
- Log.w(TAG, "RemoteException in stopNavigating");
- mListeners.remove(listener);
- // adjust for size of list changing
- size--;
- }
- }
- }
- }
-
synchronized (mLocation) {
mLocationFlags = flags;
if ((flags & LOCATION_HAS_LAT_LONG) == LOCATION_HAS_LAT_LONG) {
@@ -1023,6 +1000,29 @@ public class GpsLocationProvider implements LocationProviderInterface {
}
}
+ mLastFixTime = System.currentTimeMillis();
+ // report time to first fix
+ if (mTTFF == 0 && (flags & LOCATION_HAS_LAT_LONG) == LOCATION_HAS_LAT_LONG) {
+ mTTFF = (int)(mLastFixTime - mFixRequestTime);
+ if (DEBUG) Log.d(TAG, "TTFF: " + mTTFF);
+
+ // notify status listeners
+ synchronized(mListeners) {
+ int size = mListeners.size();
+ for (int i = 0; i < size; i++) {
+ Listener listener = mListeners.get(i);
+ try {
+ listener.mListener.onFirstFix(mTTFF);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in stopNavigating");
+ mListeners.remove(listener);
+ // adjust for size of list changing
+ size--;
+ }
+ }
+ }
+ }
+
if (mStarted && mStatus != LocationProvider.AVAILABLE) {
// we still want to time out if we do not receive MIN_FIX_COUNT
// within the time out and we are requesting infrequent fixes