am e107c141: am 9d164dc5: am f4dffd8a: merge from open-source master

This commit is contained in:
The Android Open Source Project
2010-05-06 15:35:42 -07:00
committed by Android Git Automerger
5 changed files with 376 additions and 26 deletions

View File

@@ -950,29 +950,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) {
@@ -1008,6 +985,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 want to time out if we do not receive a fix
// within the time out and we are requesting infrequent fixes