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

Commit 34d5a951 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge "Play tone when RTT upgrade received"

parents d174bcfe 3f1828f8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1925,6 +1925,13 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            if (didRttChange) {
                if ((mConnectionProperties & Connection.PROPERTY_IS_RTT) ==
                        Connection.PROPERTY_IS_RTT) {
                    // If we already had RTT streams up, that means that either the call started
                    // with RTT or the user previously requested to start RTT. Either way, don't
                    // play the alert tone.
                    if (!areRttStreamsInitialized()) {
                        mCallsManager.playRttUpgradeToneForCall(this);
                    }

                    createRttStreams();
                    // Call startRtt to pass the RTT pipes down to the connection service.
                    // They already turned on the RTT property so no request should be sent.
+8 −0
Original line number Diff line number Diff line
@@ -264,6 +264,14 @@ public class CallAudioManager extends CallsManagerListenerBase {
        }
    }

    public void playRttUpgradeTone(Call call) {
        if (call != mForegroundCall) {
            // We only play tones for foreground calls.
            return;
        }
        mPlayerFactory.createPlayer(InCallTonePlayer.TONE_RTT_REQUEST).startTone();
    }

    /**
     * Play or stop a call hold tone for a call.  Triggered via
     * {@link Connection#sendConnectionEvent(String)} when the
+10 −0
Original line number Diff line number Diff line
@@ -2744,6 +2744,16 @@ public class CallsManager extends Call.ListenerBase
        updateCanAddCall();
    }

    @Override
    public void onRemoteRttRequest(Call call, int requestId) {
        Log.i(this, "onRemoteRttRequest: call %s", call.getId());
        playRttUpgradeToneForCall(call);
    }

    public void playRttUpgradeToneForCall(Call call) {
        mCallAudioManager.playRttUpgradeTone(call);
    }

    // Construct the list of possible PhoneAccounts that the outgoing call can use based on the
    // active calls in CallsManager. If any of the active calls are on a SIM based PhoneAccount,
    // then include only that SIM based PhoneAccount and any non-SIM PhoneAccounts, such as SIP.
+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ public class InCallTonePlayer extends Thread {
    public static final int TONE_UNOBTAINABLE_NUMBER = 12;
    public static final int TONE_VOICE_PRIVACY = 13;
    public static final int TONE_VIDEO_UPGRADE = 14;
    public static final int TONE_RTT_REQUEST = 15;

    private static final int TONE_RESOURCE_ID_UNDEFINED = -1;

@@ -329,6 +330,7 @@ public class InCallTonePlayer extends Thread {
                    // TODO: fill in.
                    throw new IllegalStateException("Voice privacy tone NYI.");
                case TONE_VIDEO_UPGRADE:
                case TONE_RTT_REQUEST:
                    // Similar to the call waiting tone, but does not repeat.
                    toneType = ToneGenerator.TONE_SUP_CALL_WAITING;
                    toneVolume = RELATIVE_VOLUME_HIPRI;