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

Commit 8d7e82a7 authored by Siddharth Ray's avatar Siddharth Ray Committed by android-build-merger
Browse files

Merge "GPS metrics collection" into pi-dev

am: 8f7a55ec

Change-Id: Ic54c2a54825a66d668c62b53f00e1e6cd1ac6c42
parents 5494171d 8f7a55ec
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -1721,7 +1721,9 @@ public class GnssLocationProvider implements LocationProviderInterface {
        if (mItarSpeedLimitExceeded) {
            Log.i(TAG, "Hal reported a speed in excess of ITAR limit." +
                    "  GPS/GNSS Navigation output blocked.");
            if (mStarted) {
                mGnssMetrics.logReceivedLocationStatus(false);
            }
            return;  // No output of location allowed
        }

@@ -1738,6 +1740,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
            Log.e(TAG, "RemoteException calling reportLocation");
        }

        if (mStarted) {
            mGnssMetrics.logReceivedLocationStatus(hasLatLong);
            if (hasLatLong) {
                if (location.hasAccuracy()) {
@@ -1748,13 +1751,16 @@ public class GnssLocationProvider implements LocationProviderInterface {
                    mGnssMetrics.logMissedReports(mFixInterval, timeBetweenFixes);
                }
            }
        }

        mLastFixTime = SystemClock.elapsedRealtime();
        // report time to first fix
        if (mTimeToFirstFix == 0 && hasLatLong) {
            mTimeToFirstFix = (int) (mLastFixTime - mFixRequestTime);
            if (DEBUG) Log.d(TAG, "TTFF: " + mTimeToFirstFix);
            if (mStarted) {
                mGnssMetrics.logTimeToFirstFixMilliSecs(mTimeToFirstFix);
            }

            // notify status listeners
            mListenerHelper.onFirstFix(mTimeToFirstFix);