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

Commit 47598529 authored by Naina Nalluri's avatar Naina Nalluri
Browse files

Change the order of logging events

Change the order of logging cached events
in the reset. Move sim state, modem bitmap
and active subscription info before other
events.

Bug: 132828467
Test: Verified the log
Change-Id: Ice0be9e5f4c004e3321ae207f5c15216c545b901
parent 4e451042
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -598,8 +598,24 @@ public class TelephonyMetrics {
        mStartSystemTimeMs = System.currentTimeMillis();
        mStartElapsedTimeMs = SystemClock.elapsedRealtime();

        // Insert the last known service state, ims capabilities, and ims connection states as the
        // base.
        // Insert the last known sim state, enabled modem bitmap, active subscription info,
        // service state, ims capabilities, ims connection states, carrier id and Data call
        // events as the base.
        // Sim state, modem bitmap and active subscription info events are logged before
        // other events.
        addTelephonyEvent(new TelephonyEventBuilder(mStartElapsedTimeMs, -1 /* phoneId */)
                .setSimStateChange(mLastSimState).build());

        addTelephonyEvent(new TelephonyEventBuilder(mStartElapsedTimeMs, -1 /* phoneId */)
                .setEnabledModemBitmap(mLastEnabledModemBitmap).build());

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

        for (int i = 0; i < mLastServiceState.size(); i++) {
            final int key = mLastServiceState.keyAt(i);

@@ -631,13 +647,6 @@ public class TelephonyMetrics {
            addTelephonyEvent(event);
        }

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

        for (int i = 0; i < mLastRilDataCallEvents.size(); i++) {
            final int key = mLastRilDataCallEvents.keyAt(i);
            for (int j = 0; j < mLastRilDataCallEvents.get(key).size(); j++) {
@@ -648,11 +657,6 @@ public class TelephonyMetrics {
                        .setDataCalls(dataCalls).build());
            }
        }
        addTelephonyEvent(new TelephonyEventBuilder(mStartElapsedTimeMs, -1 /* phoneId */)
                .setSimStateChange(mLastSimState).build());

        addTelephonyEvent(new TelephonyEventBuilder(mStartElapsedTimeMs, -1 /* phoneId */)
                .setEnabledModemBitmap(mLastEnabledModemBitmap).build());
    }

    /**