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

Commit 4dd43b1a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6081300 from 1c40c95e to rvc-release

Change-Id: I9f7b23282647fcdd8ae8de9dd9c7dbb06648f23a
parents 1d07c45f 1c40c95e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout);
        void onHoldToneRequested(Call call);
        void onCallHoldFailed(Call call);
        void onCallSwitchFailed(Call call);
        void onConnectionEvent(Call call, String event, Bundle extras);
        void onExternalCallChanged(Call call, boolean isExternalCall);
        void onRttInitiationFailure(Call call, int reason);
@@ -215,6 +216,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        @Override
        public void onCallHoldFailed(Call call) {}
        @Override
        public void onCallSwitchFailed(Call call) {}
        @Override
        public void onConnectionEvent(Call call, String event, Bundle extras) {}
        @Override
        public void onExternalCallChanged(Call call, boolean isExternalCall) {}
@@ -3230,6 +3233,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            for (Listener l : mListeners) {
                l.onCallHoldFailed(this);
            }
        } else if (Connection.EVENT_CALL_SWITCH_FAILED.equals(event)) {
            for (Listener l : mListeners) {
                l.onCallSwitchFailed(this);
            }
        } else {
            for (Listener l : mListeners) {
                l.onConnectionEvent(this, event, extras);
+14 −4
Original line number Diff line number Diff line
@@ -1029,12 +1029,22 @@ public class CallsManager extends Call.ListenerBase

    @Override
    public void onCallHoldFailed(Call call) {
        // Normally, we don't care whether a call hold has failed. However, if a call was held in
        // order to answer an incoming call, that incoming call needs to be brought out of the
        // ANSWERED state so that the user can try the operation again.
        markAllAnsweredCallAsRinging(call, "hold");
    }

    @Override
    public void onCallSwitchFailed(Call call) {
        markAllAnsweredCallAsRinging(call, "switch");
    }

    private void markAllAnsweredCallAsRinging(Call call, String actionName) {
        // Normally, we don't care whether a call hold or switch has failed.
        // However, if a call was held or switched in order to answer an incoming call, that
        // incoming call needs to be brought out of the ANSWERED state so that the user can
        // try the operation again.
        for (Call call1 : mCalls) {
            if (call1 != call && call1.getState() == CallState.ANSWERED) {
                setCallState(call1, CallState.RINGING, "hold failed on other call");
                setCallState(call1, CallState.RINGING, actionName + " failed on other call");
            }
        }
    }