Fix enabling video while ringing for an audio-only call.

* Update to RingRTC v2.20.4

Co-authored-by: Jim Gustafson <jim@signal.org>
This commit is contained in:
Rashad Sookram
2022-05-02 11:17:57 -04:00
committed by Greyson Parrelli
parent ef0c6c79cb
commit 38b6362b25
5 changed files with 17 additions and 47 deletions

View File

@@ -39,7 +39,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.core.util.Consumer;
import androidx.lifecycle.ViewModelProviders;
import androidx.lifecycle.ViewModelProvider;
import androidx.window.DisplayFeature;
import androidx.window.FoldingFeature;
import androidx.window.WindowLayoutInfo;
@@ -167,9 +167,7 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
ephemeralStateDisposable = ApplicationDependencies.getSignalCallManager()
.ephemeralStates()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(state -> {
viewModel.updateFromEphemeralState(state);
});
.subscribe(viewModel::updateFromEphemeralState);
}
@Override
@@ -306,7 +304,7 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
WebRtcCallViewModel.Factory factory = new WebRtcCallViewModel.Factory(deviceOrientationMonitor);
viewModel = ViewModelProviders.of(this, factory).get(WebRtcCallViewModel.class);
viewModel = new ViewModelProvider(this, factory).get(WebRtcCallViewModel.class);
viewModel.setIsLandscapeEnabled(isLandscapeEnabled);
viewModel.setIsInPipMode(isInPipMode());
viewModel.getMicrophoneEnabled().observe(this, callScreen::setMicEnabled);

View File

@@ -98,6 +98,16 @@ public class CallSetupActionProcessorDelegate extends WebRtcActionProcessor {
.cameraState(camera.getCameraState())
.build();
//noinspection SimplifiableBooleanExpression
if ((enable && camera.isInitialized()) || !enable) {
try {
CallManager callManager = webRtcInteractor.getCallManager();
callManager.setVideoEnable(enable);
} catch (CallException e) {
Log.w(tag, "Unable change video enabled state to " + enable, e);
}
}
WebRtcUtil.enableSpeakerPhoneIfNeeded(webRtcInteractor, currentState);
return currentState;