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

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

Merge "When bg call does not support hold, auto-unhold on disconnect of fg call." into nyc-mr1-dev

parents 54f0f937 7d58ba53
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1390,12 +1390,21 @@ public class CallsManager extends Call.ListenerBase
     */
    void markCallAsRemoved(Call call) {
        removeCall(call);
        Call foregroundCall = mCallAudioManager.getPossiblyHeldForegroundCall();
        if (mLocallyDisconnectingCalls.contains(call)) {
            mLocallyDisconnectingCalls.remove(call);
            Call foregroundCall = mCallAudioManager.getPossiblyHeldForegroundCall();
            if (foregroundCall != null && foregroundCall.getState() == CallState.ON_HOLD) {
                foregroundCall.unhold();
            }
        } else if (foregroundCall != null &&
                !foregroundCall.can(Connection.CAPABILITY_SUPPORT_HOLD)  &&
                foregroundCall.getState() == CallState.ON_HOLD) {

            // The new foreground call is on hold, however the carrier does not display the hold
            // button in the UI.  Therefore, we need to auto unhold the held call since the user has
            // no means of unholding it themselves.
            Log.i(this, "Auto-unholding held foreground call (call doesn't support hold)");
            foregroundCall.unhold();
        }
    }