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

Commit 7ce38ed2 authored by Siddharth Ray's avatar Siddharth Ray Committed by android-build-merger
Browse files

Merge "GPS metrics collection" into pi-dev am: 8f7a55ec

am: 8d7e82a7

Change-Id: I7f16b56643c818ffeb0e6101597c8830b9c7d241
parents 802064fc 8d7e82a7
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -1722,7 +1722,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
        }

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

        if (mStarted) {
            mGnssMetrics.logReceivedLocationStatus(hasLatLong);
            if (hasLatLong) {
                if (location.hasAccuracy()) {
@@ -1749,13 +1752,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);