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

Commit b1b8f18e authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9410359 from e228b831 to tm-qpr2-release

Change-Id: I78f02b2882e541adcbb70b77bbb1da10ab83737b
parents a905bfe0 e228b831
Loading
Loading
Loading
Loading
+24 −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();

@@ -514,6 +526,17 @@ public class VoiceCallSessionStats {
            proto.carrierId = mPhone.getCarrierId();
        }

        // Update end RAT
        @NetworkType
        int rat = ServiceStateStats.getVoiceRat(mPhone, getServiceState(), proto.bearerAtEnd);
        if (proto.ratAtEnd != rat) {
            proto.ratSwitchCount++;
            proto.ratAtEnd = rat;
            if (rat != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
                proto.lastKnownRat = rat;
            }
        }

        mAtomsStorage.addVoiceCallSession(proto);

        // merge RAT usages to PersistPullers when the call session ends (i.e. no more active calls)
+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 =