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

Commit c8fdaa89 authored by Suchand Ghosh's avatar Suchand Ghosh Committed by Dheeraj Shetty
Browse files

IMS: Abandon audio focus if no other call exist.

Sometimes call get disconnected due RTP inactive
when user dials empty URI list. Here telephony set
audio mode normal when foreground call get transit
to conf call. This triggers audio to initiate end
all calls.
Add code to check if there is any more call exist
before abandon audio focus.

Change-Id: I518053cb3f3ed8ab877e875e25460c14275891b8
CRs-Fixed: 935317
parent f202c697
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -560,7 +560,10 @@ final class CallAudioManager extends CallsManagerListenerBase
                        AudioManager.STREAM_VOICE_CALL, mMostRecentlyUsedMode);
            } else if (!hasRingingForegroundCall() && mCallsManager.hasOnlyDisconnectedCalls()) {
                Log.v(this, "updateAudioStreamAndMode : no ringing call");
                // Request to set audio mode normal. Here confirm if any call exist.
                if (!hasAnyCalls()) {
                    abandonAudioFocus();
                }
            } else {
                // mIsRinging is false, but there is a foreground ringing call present. Don't
                // abandon audio focus immediately to prevent audio focus from getting lost between
@@ -737,6 +740,10 @@ final class CallAudioManager extends CallsManagerListenerBase
        return UserHandle.USER_OWNER;
    }

    private boolean hasAnyCalls() {
        return mCallsManager.hasAnyCalls();
    }

    /**
     * Translates an {@link AudioManager} stream type to a human-readable string description.
     *