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

Commit 3a75c622 authored by Hall Liu's avatar Hall Liu
Browse files

Set RTT flag while logging call

If the call was an RTT call at any point, set the flag when logging to
the call log.

Test: make test call and check calllog.db
Bug: 63934808
Change-Id: I247f2383c37e3f8d8108a68d8f217af1874d2901
parent 911d4de7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -477,6 +477,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
     * Integer constant from {@link android.telecom.Call.RttCall}. Describes the current RTT mode.
     */
    private int mRttMode;
    /**
     * True if the call was ever an RTT call.
     */
    private boolean mWasEverRtt = false;

    /**
     * Integer indicating the remote RTT request ID that is pending a response from the user.
@@ -2383,6 +2387,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
                && mConnectionServiceToInCallStreams != null;
        if (shouldBeRtt && !areStreamsInitialized) {
            try {
                mWasEverRtt = true;
                mInCallToConnectionServiceStreams = ParcelFileDescriptor.createReliablePipe();
                mConnectionServiceToInCallStreams = ParcelFileDescriptor.createReliablePipe();
            } catch (IOException e) {
@@ -2442,6 +2447,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
        return (mConnectionProperties & Connection.PROPERTY_IS_RTT) == Connection.PROPERTY_IS_RTT;
    }

    public boolean wasEverRttCall() {
        return mWasEverRtt;
    }

    public ParcelFileDescriptor getCsToInCallRttPipeForCs() {
        return mConnectionServiceToInCallStreams == null ? null
                : mConnectionServiceToInCallStreams[RTT_PIPE_WRITE_SIDE_INDEX];
+6 −2
Original line number Diff line number Diff line
@@ -230,7 +230,8 @@ public final class CallLogManager extends CallsManagerListenerBase {
                call.getDisconnectCause().getCode() == DisconnectCause.CALL_PULLED,
                shouldSaveHdInfo(call, accountHandle),
                (call.getConnectionProperties() & Connection.PROPERTY_ASSISTED_DIALING_USED) ==
                        Connection.PROPERTY_ASSISTED_DIALING_USED);
                        Connection.PROPERTY_ASSISTED_DIALING_USED,
                call.wasEverRttCall());
        logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber,
                call.getHandlePresentation(), callLogType, callFeatures, accountHandle,
                creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(),
@@ -310,7 +311,7 @@ public final class CallLogManager extends CallsManagerListenerBase {
     * @return The call features.
     */
    private static int getCallFeatures(int videoState, boolean isPulledCall, boolean isStoreHd,
                                       boolean isUsingAssistedDialing) {
            boolean isUsingAssistedDialing, boolean isRtt) {
        int features = 0;
        if (VideoProfile.isVideo(videoState)) {
            features |= Calls.FEATURES_VIDEO;
@@ -324,6 +325,9 @@ public final class CallLogManager extends CallsManagerListenerBase {
        if (isUsingAssistedDialing) {
            features |= Calls.FEATURES_ASSISTED_DIALING_USED;
        }
        if (isRtt) {
            features |= Calls.FEATURES_RTT;
        }
        return features;
    }