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;

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/call_screen_large_local_renderer_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
<org.thoughtcrime.securesms.components.webrtc.TextureViewRenderer
android:id="@+id/call_screen_large_local_renderer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/call_screen_large_local_video_off_avatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/call_screen_large_local_video_off"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/WebRtcCallView__your_video_is_off"
android:textAppearance="@style/TextAppearance.Signal.Body2"
android:textColor="@color/white"
android:visibility="gone"
app:drawableTopCompat="@drawable/ic_video_off_solid_white_28"
tools:visibility="visible" />
</FrameLayout>