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

Commit 0b83647b authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Support determining the call direction for existing connections." into qt-dev

am: 0e9df742

Change-Id: I9aa17313bfe341092e83993a33e0df4a06c02784
parents e7e26039 0e9df742
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
@@ -3531,7 +3531,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 */,