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

Commit 53ddc802 authored by Siddharth Ray's avatar Siddharth Ray
Browse files

GPS metrics collection

GPS metrics will be collected only when in navigating state.

BUG:74983572
Change-Id: Ib4133bb1017370840c26ab1b5886c5d0ef9f7f84
parent 3912a7f5
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);