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

Commit 455c4080 authored by chen xu's avatar chen xu
Browse files

log latest carrier id info perodically

Today carrier id info is logged once when boot up or sim swap.
This might have issues when we correlate carrier id with
other metrics like service state which got logged perodically.

Bug:
Test: Build
Change-Id: Id5d2cb35e668f541693d3031ca432cdd97665ae3
parent 3c6ea928
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ public class TelephonyMetrics {
     */
    private final SparseArray<TelephonySettings> mLastSettings = new SparseArray<>();

    /**
     * Last carrier id matching.
     */
    private final SparseArray<CarrierIdMatching> mLastCarrierId = new SparseArray<>();

    /** The start system time of the TelephonyLog in milliseconds*/
    private long mStartSystemTimeMs;

@@ -516,6 +521,13 @@ public class TelephonyMetrics {
                    .setImsConnectionState(mLastImsConnectionState.get(key)).build();
            addTelephonyEvent(event);
        }

        for (int i = 0; i < mLastCarrierId.size(); i++) {
            final int key = mLastCarrierId.keyAt(i);
            TelephonyEvent event = new TelephonyEventBuilder(mStartElapsedTimeMs, key)
                    .setCarrierIdMatching(mLastCarrierId.get(key)).build();
            addTelephonyEvent(event);
        }
    }

    /**
@@ -2006,6 +2018,7 @@ public class TelephonyMetrics {

        TelephonyEvent event = new TelephonyEventBuilder(phoneId).setCarrierIdMatching(
                carrierIdMatching).build();
        mLastCarrierId.put(phoneId, carrierIdMatching);
        addTelephonyEvent(event);
    }