Bug 1022463 - Gonk GPS should default to 10s before trying a a network position. r=kanru, a=1.4+
authorDoug Turner <doug.turner@gmail.com>
Sun, 08 Jun 2014 22:58:40 -0700
changeset 207263 e4bad0e3a42a2af485a1ad6312b4db75e57418e6
parent 207262 3fecdb938683ea7b803adf6d9e2e5f05c92d15f8
child 207264 d7d035f5a502d73fd2ad7a0af0c1125f2064185e
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskanru, 1
bugs1022463
milestone32.0a2
Bug 1022463 - Gonk GPS should default to 10s before trying a a network position. r=kanru, a=1.4+
dom/system/gonk/GonkGPSGeolocationProvider.cpp
--- a/dom/system/gonk/GonkGPSGeolocationProvider.cpp
+++ b/dom/system/gonk/GonkGPSGeolocationProvider.cpp
@@ -698,20 +698,21 @@ GonkGPSGeolocationProvider::NetworkLocat
 
   sLastMLSPosLat = lat;
   sLastMLSPosLon = lon;
 
   // if the MLS coord change is smaller than this arbitrarily small value
   // 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);
   }
 
   provider->InjectLocation(lat, lon, acc);
   return NS_OK;
 }