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

Commit e228b831 authored by Qingqi Lei's avatar Qingqi Lei Committed by Android (Google) Code Review
Browse files

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

parents a670e694 e6253b41
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -465,8 +465,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());
@@ -492,6 +498,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
@@ -288,6 +288,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 =
@@ -331,6 +332,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 =
@@ -1597,6 +1599,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 =