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

Commit 65debc1e authored by Rafael Higuera Silva's avatar Rafael Higuera Silva
Browse files

Add fold state to voice call session

Bug: 276772849
Test: make, atest com.android.internal.telephony.metrics and manual test
Change-Id: I5d7236a9acbb89a759f0cb8727cd6626e7a91f83
Merged-In: I5d7236a9acbb89a759f0cb8727cd6626e7a91f83
parent b9266470
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ message VoiceCallSession {
    optional bool is_multiparty = 31;
    optional int32 call_duration = 32;
    optional int32 last_known_rat = 33;
    optional int32 fold_state = 34;

    // Internal use only
    optional int64 setup_begin_millis = 10001;
+2 −1
Original line number Diff line number Diff line
@@ -974,7 +974,8 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback {
                session.ratAtConnected,
                session.isMultiparty,
                session.callDuration,
                session.lastKnownRat);
                session.lastKnownRat,
                session.foldState);
    }

    private static StatsEvent buildStatsEvent(IncomingSms sms) {
+5 −0
Original line number Diff line number Diff line
@@ -157,6 +157,8 @@ public class VoiceCallSessionStats {
    private final PersistAtomsStorage mAtomsStorage =
            PhoneFactory.getMetricsCollector().getAtomsStorage();
    private final UiccController mUiccController = UiccController.getInstance();
    private final DeviceStateHelper mDeviceStateHelper =
            PhoneFactory.getMetricsCollector().getDeviceStateHelper();

    public VoiceCallSessionStats(int phoneId, Phone phone) {
        mPhoneId = phoneId;
@@ -514,6 +516,9 @@ public class VoiceCallSessionStats {
        // Update end RAT
        updateRatAtEnd(proto, getVoiceRatWithVoNRFix(mPhone, getServiceState(), proto.bearerAtEnd));

        // Set device fold state
        proto.foldState = mDeviceStateHelper.getFoldState();

        mAtomsStorage.addVoiceCallSession(proto);

        // merge RAT usages to PersistPullers when the call session ends (i.e. no more active calls)