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

Commit 35b69cc1 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Support determining the call direction for existing connections.

Add support for capturing the call direction from the parceled existing
connection.

Test: Run all unit tests.
Test: Manual testing using VoLTE conference calls with mix of MO and MT
calls; verify call logging is appropriate.
Bug: 134471046

Change-Id: I483936c3fb973b37333a75c7dce7e966889f8e84
parent 817e5398
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -3218,4 +3218,23 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            mCallsManager.setAudioRoute(CallAudioState.ROUTE_SPEAKER, null);
        }
    }

    /**
     * Remaps the call direction as indicated by an {@link android.telecom.Call.Details} direction
     * constant to the constants (e.g. {@link #CALL_DIRECTION_INCOMING}) used in this call class.
     * @param direction The android.telecom.Call direction.
     * @return The direction using the constants in this class.
     */
    public static int getRemappedCallDirection(
            @android.telecom.Call.Details.CallDirection int direction) {
        switch(direction) {
            case android.telecom.Call.Details.DIRECTION_INCOMING:
                return CALL_DIRECTION_INCOMING;
            case android.telecom.Call.Details.DIRECTION_OUTGOING:
                return CALL_DIRECTION_OUTGOING;
            case android.telecom.Call.Details.DIRECTION_UNKNOWN:
                return CALL_DIRECTION_UNDEFINED;
        }
        return CALL_DIRECTION_UNDEFINED;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -3528,7 +3528,7 @@ public class CallsManager extends Call.ListenerBase
                null /* gatewayInfo */,
                null /* connectionManagerPhoneAccount */,
                connection.getPhoneAccount(), /* targetPhoneAccountHandle */
                Call.CALL_DIRECTION_UNDEFINED /* callDirection */,
                Call.getRemappedCallDirection(connection.getCallDirection()) /* callDirection */,
                false /* forceAttachToExistingConnection */,
                isDowngradedConference /* isConference */,
                connection.getConnectTimeMillis() /* connectTimeMillis */,