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

Commit d7f128cf authored by Qingqi Lei's avatar Qingqi Lei Committed by Automerger Merge Worker
Browse files

Merge "Fix call setup delay for calls that never connected" into tm-qpr-dev am: e228b831

parents 24259218 e228b831
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -450,8 +450,14 @@ public class VoiceCallSessionStats {
        proto.isRoaming = serviceState != null ? serviceState.getVoiceRoaming() : false;
        proto.isMultiparty = conn.isMultiparty();
        proto.lastKnownRat = rat;

        // internal fields for tracking
        if (getDirection(conn) == VOICE_CALL_SESSION__DIRECTION__CALL_DIRECTION_MT) {
            // MT call setup hasn't begun hence set to 0
            proto.setupBeginMillis = 0L;
        } else {
            proto.setupBeginMillis = getTimeMillis();
        }

        // audio codec might have already been set
        int codec = audioQualityToCodec(bearer, conn.getAudioCodec());
@@ -477,6 +483,12 @@ public class VoiceCallSessionStats {
            loge("finishCall: could not find call to be removed, connectionId=%d", connectionId);
            return;
        }

        // Compute time it took to fail setup (except for MT calls that have never been picked up)
        if (proto.setupFailed && proto.setupBeginMillis != 0L && proto.setupDurationMillis == 0) {
            proto.setupDurationMillis = (int) (getTimeMillis() - proto.setupBeginMillis);
        }

        mCallProtos.delete(connectionId);
        proto.concurrentCallCountAtEnd = mCallProtos.size();

+3 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ public class VoiceCallSessionStatsTest extends TelephonyTest {
                        TelephonyManager.NETWORK_TYPE_LTE,
                        ImsReasonInfo.CODE_SIP_FORBIDDEN);
        expectedCall.setupFailed = true;
        expectedCall.setupDurationMillis = 200;
        expectedCall.ratAtConnected = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        expectedCall.callDuration = VOICE_CALL_SESSION__CALL_DURATION__CALL_DURATION_UNKNOWN;
        VoiceCallRatUsage expectedRatUsage =
@@ -326,6 +327,7 @@ public class VoiceCallSessionStatsTest extends TelephonyTest {
                        TelephonyManager.NETWORK_TYPE_LTE,
                        ImsReasonInfo.CODE_SIP_REQUEST_CANCELLED);
        expectedCall.setupFailed = true;
        expectedCall.setupDurationMillis = 200;
        expectedCall.ratAtConnected = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        expectedCall.callDuration = VOICE_CALL_SESSION__CALL_DURATION__CALL_DURATION_UNKNOWN;
        VoiceCallRatUsage expectedRatUsage =
@@ -1568,6 +1570,7 @@ public class VoiceCallSessionStatsTest extends TelephonyTest {
        expectedCall.bandAtEnd = 0;
        expectedCall.ratSwitchCount = 1L;
        expectedCall.setupFailed = true;
        expectedCall.setupDurationMillis = 13000;
        expectedCall.ratAtConnected = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        expectedCall.codecBitmask = 0L;
        expectedCall.mainCodecQuality =