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

Commit da1af765 authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioService: fix isInCommunication()

Consider we are in call also when audio mode is MODE_IN_CALL.
This removes race conditions occuring when there is a delay between
audio mode being set to MODE_IN_CALL and the actual call state updated
in TelecomManager.

Bug: 70690373
Test: test DTMF level at various call volume on earpiece, speaker, USB
headset

Change-Id: I5e905a36e825211b6d780a285fc7b47cea3edf2b
parent 7d6688f3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3884,7 +3884,8 @@ public class AudioService extends IAudioService.Stub
        IsInCall = telecomManager.isInCall();
        Binder.restoreCallingIdentity(ident);

        return (IsInCall || getMode() == AudioManager.MODE_IN_COMMUNICATION);
        return (IsInCall || getMode() == AudioManager.MODE_IN_COMMUNICATION ||
                getMode() == AudioManager.MODE_IN_CALL);
    }

    /**