mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 14:48:35 +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
|
@Override
|
||||||
protected @NonNull WebRtcServiceState handleSetEnableVideo(@NonNull WebRtcServiceState currentState, boolean enable) {
|
protected @NonNull WebRtcServiceState handleSetEnableVideo(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||||
|
Log.i(tag, "handleSetEnableVideo(): enable: " + enable);
|
||||||
|
|
||||||
Camera camera = currentState.getVideoState().requireCamera();
|
Camera camera = currentState.getVideoState().requireCamera();
|
||||||
|
|
||||||
if (camera.isInitialized()) {
|
if (camera.isInitialized()) {
|
||||||
|
@ -66,6 +66,7 @@ public class OutgoingCallActionProcessor extends DeviceAwareActionProcessor {
|
|||||||
|
|
||||||
AudioManager androidAudioManager = ServiceUtil.getAudioManager(context);
|
AudioManager androidAudioManager = ServiceUtil.getAudioManager(context);
|
||||||
androidAudioManager.setSpeakerphoneOn(false);
|
androidAudioManager.setSpeakerphoneOn(false);
|
||||||
|
WebRtcUtil.enableSpeakerPhoneIfNeeded(context, currentState.getCallSetupState().isEnableVideoOnCreate());
|
||||||
|
|
||||||
webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));
|
webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));
|
||||||
webRtcInteractor.initializeAudioForCall();
|
webRtcInteractor.initializeAudioForCall();
|
||||||
|
@ -58,7 +58,7 @@ public class PreJoinActionProcessor extends DeviceAwareActionProcessor {
|
|||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
@Override
|
@Override
|
||||||
protected @NonNull WebRtcServiceState handleSetEnableVideo(@NonNull WebRtcServiceState currentState, boolean enable) {
|
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);
|
currentState.getVideoState().getCamera().setEnabled(enable);
|
||||||
return currentState.builder()
|
return currentState.builder()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user