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

Commit f2078831 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Fix issues associated with hold failure

am: 07a279af

Change-Id: I3ea7fde0573a1a79eb2e614f283bb163e5a17c0d
parents 821ea4ee 07a279af
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        void onConferenceStateChanged(Call call, boolean isConference);
        boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout);
        void onHoldToneRequested(Call call);
        void onCallHoldFailed(Call call);
        void onConnectionEvent(Call call, String event, Bundle extras);
        void onExternalCallChanged(Call call, boolean isExternalCall);
        void onRttInitiationFailure(Call call, int reason);
@@ -210,6 +211,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        @Override
        public void onHoldToneRequested(Call call) {}
        @Override
        public void onCallHoldFailed(Call call) {}
        @Override
        public void onConnectionEvent(Call call, String event, Bundle extras) {}
        @Override
        public void onExternalCallChanged(Call call, boolean isExternalCall) {}
@@ -3043,6 +3046,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            for (Listener l : mListeners) {
                l.onHoldToneRequested(this);
            }
        } else if (Connection.EVENT_CALL_HOLD_FAILED.equals(event)) {
            for (Listener l : mListeners) {
                l.onCallHoldFailed(this);
            }
        } else {
            for (Listener l : mListeners) {
                l.onConnectionEvent(this, event, extras);
+1 −0
Original line number Diff line number Diff line
@@ -534,6 +534,7 @@ public class CallAudioManager extends CallsManagerListenerBase {
                onCallLeavingActiveDialingOrConnecting();
                break;
            case CallState.RINGING:
            case CallState.ANSWERED:
                onCallLeavingRinging();
                break;
            case CallState.ON_HOLD:
+12 −0
Original line number Diff line number Diff line
@@ -913,6 +913,18 @@ public class CallsManager extends Call.ListenerBase
        return mCallAudioManager.getForegroundCall();
    }

    @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.
        for (Call call1 : mCalls) {
            if (call1 != call && call1.getState() == CallState.ANSWERED) {
                setCallState(call1, CallState.RINGING, "hold failed on other call");
            }
        }
    }

    @Override
    public UserHandle getCurrentUserHandle() {
        return mCurrentUserHandle;