mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 10:38:33 +00:00
Ensure speakerphone is correctly enabled during call setup.
Race condition between handleStartOutgoingCall being enqueued from ringrtc and handleSetEnableVideo being enqueued from the main thread.
This commit is contained in:
parent
dfc4178252
commit
cf2189c11a
@ -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()) {
|
||||
|
@ -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();
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user