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

Commit aa386ab7 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "Fix call screening and redirect mode on hearing aid" into main

parents 642830a1 732c1ac8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4373,16 +4373,23 @@ public class AudioService extends IAudioService.Stub
    }
    private int getBluetoothContextualVolumeStream(int mode) {
        boolean voiceActivityCanOverride = true;
        switch (mode) {
            case AudioSystem.MODE_IN_COMMUNICATION:
            case AudioSystem.MODE_IN_CALL:
                return AudioSystem.STREAM_VOICE_CALL;
            case AudioSystem.MODE_CALL_SCREENING:
            case AudioSystem.MODE_COMMUNICATION_REDIRECT:
            case AudioSystem.MODE_CALL_REDIRECT:
                voiceActivityCanOverride = false;
                // intended fallthrough
            case AudioSystem.MODE_NORMAL:
            default:
                // other conditions will influence the stream type choice, read on...
                break;
        }
        if (mVoicePlaybackActive.get()) {
        if (voiceActivityCanOverride
                && mVoicePlaybackActive.get()) {
            return AudioSystem.STREAM_VOICE_CALL;
        }
        return AudioSystem.STREAM_MUSIC;