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

Commit a13787c7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS: Abandon audio focus if no other call exist."

parents b0055af3 c8fdaa89
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.
     *