fixed crash after accepting voice calls on devices that don’t have an earpiece (tablets)

fixes #3682
This commit is contained in:
Daniel Gultsch 2020-05-02 18:06:53 +02:00
parent 63ddd97b6b
commit abb33b048a
1 changed files with 1 additions and 2 deletions

View File

@ -92,9 +92,8 @@ public class AppRTCAudioManager {
bluetoothManager = AppRTCBluetoothManager.create(context, this);
wiredHeadsetReceiver = new WiredHeadsetReceiver();
amState = AudioManagerState.UNINITIALIZED;
Log.d(Config.LOGTAG, "speaker phone preference: " + speakerPhonePreference);
this.speakerPhonePreference = speakerPhonePreference;
if (speakerPhonePreference == SpeakerPhonePreference.EARPIECE) {
if (speakerPhonePreference == SpeakerPhonePreference.EARPIECE && hasEarpiece()) {
defaultAudioDevice = AudioDevice.EARPIECE;
} else {
defaultAudioDevice = AudioDevice.SPEAKER_PHONE;