зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1022463 - Gonk GPS should default to 10s before trying a a network position. r=kanru
This commit is contained in:
Родитель
aeaa4ae5d2
Коммит
c8fc96bd75
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче