mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-03 05:03:04 +00:00
Merge pull request #2005 from nextcloud/bugfix/1978/fixNPEpeerConnectionWrapper
Bugfix/1978/fix npe in peerConnectionWrapper
This commit is contained in:
commit
973d13f902
@ -49,6 +49,7 @@ import android.view.ViewGroup;
|
|||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.LoganSquare;
|
import com.bluelinelabs.logansquare.LoganSquare;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
@ -633,23 +634,23 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
binding.conversationRelativeLayout
|
binding.conversationRelativeLayout
|
||||||
.getViewTreeObserver()
|
.getViewTreeObserver()
|
||||||
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
binding.conversationRelativeLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
binding.conversationRelativeLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
int height = binding.conversationRelativeLayout.getMeasuredHeight();
|
int height = binding.conversationRelativeLayout.getMeasuredHeight();
|
||||||
binding.gridview.setMinimumHeight(height);
|
binding.gridview.setMinimumHeight(height);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
binding
|
binding
|
||||||
.callInfosLinearLayout
|
.callInfosLinearLayout
|
||||||
.getViewTreeObserver()
|
.getViewTreeObserver()
|
||||||
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
binding.callInfosLinearLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
binding.callInfosLinearLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
participantsAdapter = new ParticipantsAdapter(
|
participantsAdapter = new ParticipantsAdapter(
|
||||||
this,
|
this,
|
||||||
@ -1593,9 +1594,9 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
|
|
||||||
if ("unshareScreen".equals(type) ||
|
if ("unshareScreen".equals(type) ||
|
||||||
(("offer".equals(type) ||
|
(("offer".equals(type) ||
|
||||||
"answer".equals(type) ||
|
"answer".equals(type) ||
|
||||||
"candidate".equals(type) ||
|
"candidate".equals(type) ||
|
||||||
"endOfCandidates".equals(type)) &&
|
"endOfCandidates".equals(type)) &&
|
||||||
peerConnectionWrapper != null)) {
|
peerConnectionWrapper != null)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "unshareScreen":
|
case "unshareScreen":
|
||||||
@ -1692,7 +1693,7 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
endPeerConnection(peerConnectionWrapperList.get(i).getSessionId(), false);
|
endPeerConnection(peerConnectionWrapperList.get(i).getSessionId(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(localStream != null) {
|
if (localStream != null) {
|
||||||
localStream.dispose();
|
localStream.dispose();
|
||||||
localStream = null;
|
localStream = null;
|
||||||
Log.d(TAG, "Disposed localStream");
|
Log.d(TAG, "Disposed localStream");
|
||||||
@ -1885,6 +1886,14 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) {
|
if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) {
|
||||||
return peerConnectionWrapper;
|
return peerConnectionWrapper;
|
||||||
} else {
|
} else {
|
||||||
|
if (peerConnectionFactory == null) {
|
||||||
|
Log.e(TAG, "peerConnectionFactory was null in getOrCreatePeerConnectionWrapperForSessionIdAndType.");
|
||||||
|
Toast.makeText(context, context.getResources().getString(R.string.nc_common_error_sorry),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
hangup(true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasMCU && publisher) {
|
if (hasMCU && publisher) {
|
||||||
peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory,
|
peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory,
|
||||||
iceServers,
|
iceServers,
|
||||||
|
Loading…
Reference in New Issue
Block a user