Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2b44897 authored by Yingjie Wang's avatar Yingjie Wang Committed by Arne Coucheron
Browse files

Use SystemClock.elapsedRealtime() to calc TTFF

SystemClock.elapsedRealtime() returns milliseconds since boot, and
is less vulnerable to system time issue.

Change-Id: I01c2c1205c4306c6d8ce62875ff1295001ed8491
CRs-fixed: 2015708
parent e8836cd0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1467,7 +1467,7 @@ public class GnssLocationProvider implements LocationProviderInterface {

            // reset SV count to zero
            updateStatus(LocationProvider.TEMPORARILY_UNAVAILABLE, 0);
            mFixRequestTime = System.currentTimeMillis();
            mFixRequestTime = SystemClock.elapsedRealtime(); //return milliseconds since boot
            if (!hasCapability(GPS_CAPABILITY_SCHEDULING)) {
                // set timer to give up if we do not receive a fix within NO_FIX_TIMEOUT
                // and our fix interval is not short
@@ -1565,7 +1565,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
            }
        }

        mLastFixTime = System.currentTimeMillis();
        mLastFixTime = SystemClock.elapsedRealtime(); //return milliseconds since boot
        // report time to first fix
        if (mTimeToFirstFix == 0 && (flags & LOCATION_HAS_LAT_LONG) == LOCATION_HAS_LAT_LONG) {
            mTimeToFirstFix = (int)(mLastFixTime - mFixRequestTime);