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

Commit 6895ab85 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Add ability to force-enable D2D communications." into sc-dev

parents 3aa3ef0e 1b0fde23
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -379,6 +379,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
     */
    private Config mConfig = null;

    /**
     * Whether D2D has been force enabled via the d2d telephony command.
     */
    private boolean mDeviceToDeviceForceEnabled = false;

    /**
     * Network callback used to schedule the handover check when a wireless network connects.
     */
@@ -1045,7 +1050,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // Where device to device communication is available, ensure that the
        // supported RTP header extension types defined in {@link RtpTransport} are
        // set as the offered RTP header extensions for this device.
        if (mConfig != null && mConfig.isD2DCommunicationSupported && mSupportD2DUsingRtp) {
        if (mDeviceToDeviceForceEnabled
                || (mConfig != null && mConfig.isD2DCommunicationSupported
                && mSupportD2DUsingRtp)) {
            ArraySet<RtpHeaderExtensionType> types = new ArraySet<>();
            if (mSupportSdpForRtpHeaderExtensions) {
                types.add(RtpTransport.CALL_STATE_RTP_HEADER_EXTENSION_TYPE);
@@ -1064,6 +1071,15 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        }
    }

    /**
     * Used via the telephony shell command to force D2D to be enabled.
     * @param isEnabled {@code true} if D2D is force enabled.
     */
    public void setDeviceToDeviceForceEnabled(boolean isEnabled) {
        mDeviceToDeviceForceEnabled = isEnabled;
        maybeConfigureRtpHeaderExtensions();
    }

    private void stopListeningForCalls() {
        log("stopListeningForCalls");
        mOperationLocalLog.log("stopListeningForCalls - Disconnecting from ImsService");
@@ -4433,7 +4449,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        pw.println(" mIsConferenceEventPackageHandlingEnabled=" + mIsConferenceEventPackageEnabled);
        pw.println(" mSupportCepOnPeer=" + mSupportCepOnPeer);
        if (mConfig != null) {
            pw.println(" isDeviceToDeviceCommsSupported= " + mConfig.isD2DCommunicationSupported);
            pw.print(" isDeviceToDeviceCommsSupported= " + mConfig.isD2DCommunicationSupported);
            pw.println("(forceEnabled=" + mDeviceToDeviceForceEnabled + ")");
            if (mConfig.isD2DCommunicationSupported) {
                pw.println(" mSupportD2DUsingRtp= " + mSupportD2DUsingRtp);
                pw.println(" mSupportSdpForRtpHeaderExtensions= "