title: GPS: How NTP time injection works
body: <p>I've recently known about a <code>gps.conf</code> file in the <code>/system/etc/</code> directory.
  Seems that tweaking NTP_SERVER values to NTP servers nearer to the usual location improves TTFF.</p>
  
  <p>Reading the source code in the <code>LocationProvider</code> class, seems that at boot, time is retrieved from NTP server and "injected" in the calculations. 
  AFAIK each GPS sat has a very accurate atomic clock, and every one in the constellation is synchronized to the so called "GPS time". Once the receiver has got 4 or more satellites, it solves (by some method) an equation where there are four unknowns: x,y,z,b; where (x,y,z) is the receiver location, and b is the time difference between the receiver internal clock and the (correct) GPS time. Once it has a a fix, the receiver clock is synced with the correct time. (Please correct me if I'm wrong).</p>
  
  <p>So far, I've some questions regarding the way NTP time injection works:</p>
  
  <ol>
  <li>GPS Time is roughly TAI (International Atomic Time) plus an offset. Those two times do not depend on the Earth rotation, however UTC does. Given that NTP servers return UTC time, it is possible to infer GPS Time from UTC time?</li>
  <li>How does retrieving NTP time from a nearer server improve the "quality" of the GPS time approximation?</li>
  <li>Assuming that we have an initial GPS Time value (inferred from NTP time somehow), what is the injection about? Is this time value taken as correct to solve the equation with only x,y,z as unknowns? If so, then the first fix is also just an approximation, isn't it?</li>
  <li>How does a higher quality initial approximation for GPS time improve TTFF? Is it because with a lower quality NTP time the first fixes are considered not acceptable and discarded?</li>
  <li>Does having an approximate initial position help retrieving the next correct fix (like listening only to a subset of sats)?</li>
  </ol>