Bug 1022463 - Gonk GPS should default to 10s before trying a a network position. r=kanru

This commit is contained in:
Doug Turner 2014-06-08 22:58:40 -07:00
Родитель aeaa4ae5d2
Коммит c8fc96bd75
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -703,10 +703,11 @@ GonkGPSGeolocationProvider::NetworkLocationUpdate::Update(nsIDOMGeoPosition *pos
// assume the MLS coord is unchanged, and stick with the GPS location
const double kMinMLSCoordChangeInMeters = 10;
// if we haven't seen anything from the GPS device for 1s,
// if we haven't seen anything from the GPS device for 10s,
// use this network derived location.
const int kMaxGPSDelayBeforeConsideringMLS = 10000;
int64_t diff = PR_Now() - provider->mLastGPSDerivedLocationTime;
if (provider->mLocationCallback && diff > kDefaultPeriod
if (provider->mLocationCallback && diff > kMaxGPSDelayBeforeConsideringMLS
&& delta > kMinMLSCoordChangeInMeters)
{
provider->mLocationCallback->Update(position);