Ensure speakerphone is correctly enabled during call setup.

Race condition between handleStartOutgoingCall being enqueued from ringrtc and
handleSetEnableVideo being enqueued from the main thread.
fork-5.53.8
Cody Henthorne 2020-10-27 17:01:31 -04:00 zatwierdzone przez Greyson Parrelli
rodzic dfc4178252
commit cf2189c11a
3 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -75,6 +75,8 @@ public class CallSetupActionProcessorDelegate extends WebRtcActionProcessor {
@Override
protected @NonNull WebRtcServiceState handleSetEnableVideo(@NonNull WebRtcServiceState currentState, boolean enable) {
Log.i(tag, "handleSetEnableVideo(): enable: " + enable);
Camera camera = currentState.getVideoState().requireCamera();
if (camera.isInitialized()) {

Wyświetl plik

@ -66,6 +66,7 @@ public class OutgoingCallActionProcessor extends DeviceAwareActionProcessor {
AudioManager androidAudioManager = ServiceUtil.getAudioManager(context);
androidAudioManager.setSpeakerphoneOn(false);
WebRtcUtil.enableSpeakerPhoneIfNeeded(context, currentState.getCallSetupState().isEnableVideoOnCreate());
webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));
webRtcInteractor.initializeAudioForCall();

Wyświetl plik

@ -58,7 +58,7 @@ public class PreJoinActionProcessor extends DeviceAwareActionProcessor {
@SuppressWarnings("ConstantConditions")
@Override
protected @NonNull WebRtcServiceState handleSetEnableVideo(@NonNull WebRtcServiceState currentState, boolean enable) {
Log.w(TAG, "handleSetEnableVideo(): Changing for pre-join call.");
Log.i(TAG, "handleSetEnableVideo(): Changing for pre-join call.");
currentState.getVideoState().getCamera().setEnabled(enable);
return currentState.builder()