Remove Dagger related code from PeerConnectionWrapper

The PeerConnectionWrapper does not need to be injected in the
application, nor the Context needs to be injected in the
PeerConnectionWrapper. This all seems to be leftovers from the past, and
removing them would ease adding unit tests for the
PeerConnectionWrapper.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2024-12-05 11:32:51 +01:00 committed by Marcel Hibbe
parent a65b52b0e5
commit d34fdfb1c5
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -7,11 +7,9 @@
*/
package com.nextcloud.talk.webrtc;
import android.content.Context;
import android.util.Log;
import com.bluelinelabs.logansquare.LoganSquare;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.models.json.signaling.DataChannelMessage;
import com.nextcloud.talk.models.json.signaling.NCIceCandidate;
import com.nextcloud.talk.models.json.signaling.NCMessagePayload;
@ -38,19 +36,11 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.inject.Inject;
import androidx.annotation.Nullable;
import autodagger.AutoInjector;
@AutoInjector(NextcloudTalkApplication.class)
public class PeerConnectionWrapper {
@Inject
Context context;
private static final String TAG = PeerConnectionWrapper.class.getCanonicalName();
private final SignalingMessageReceiver signalingMessageReceiver;
@ -117,9 +107,6 @@ public class PeerConnectionWrapper {
boolean isMCUPublisher, boolean hasMCU, String videoStreamType,
SignalingMessageReceiver signalingMessageReceiver,
SignalingMessageSender signalingMessageSender) {
Objects.requireNonNull(NextcloudTalkApplication.Companion.getSharedApplication()).getComponentApplication().inject(this);
this.localStream = localStream;
this.videoStreamType = videoStreamType;