diff --git a/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/CallImpl.java b/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/CallImpl.java index 000b0ba3..9a7022ae 100644 --- a/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/CallImpl.java +++ b/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/CallImpl.java @@ -742,18 +742,21 @@ private void updateMedia() { return; } if (_videoRenderViews != null && _videoRenderViews.first != null && _videoRenderViews.second != null) { - _phone._callControlService.setPreviewWindow(getKey(), _videoRenderViews.first); - _phone._callControlService.setRemoteWindow(getKey(), _videoRenderViews.second); + _phone.getCallService().setPreviewWindow(getKey(), _videoRenderViews.first); + _phone.getCallService().setRemoteWindow(getKey(), _videoRenderViews.second); } else { - _phone._callControlService.setPreviewWindow(getKey(), null); - _phone._callControlService.removeRemoteVideoWindows(getKey()); + _phone.getCallService().setPreviewWindow(getKey(), null); + _phone.getCallService().removeRemoteVideoWindows(getKey()); } if (_sharingRenderView != null) { - _phone._callControlService.setShareWindow(getKey(), _sharingRenderView); + _phone.getCallService().setShareWindow(getKey(), _sharingRenderView); } else { - _phone._callControlService.removeShareWindow(getKey()); + _phone.getCallService().removeShareWindow(getKey()); + } + com.cisco.spark.android.callcontrol.model.Call call = _phone.getCallService().getCall(getKey()); + if (call != null) { + _phone.getCallService().updateMediaSession(call, PhoneImpl.mediaOptionToMediaDirection(_option)); } - _phone._callControlService.updateMediaSession(_phone._callControlService.getCall(getKey()), PhoneImpl.mediaOptionToMediaDirection(_option)); } } diff --git a/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/PhoneImpl.java b/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/PhoneImpl.java index 7c510cd2..a40e3e48 100644 --- a/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/PhoneImpl.java +++ b/sdk/src/main/java/com/ciscowebex/androidsdk/phone/internal/PhoneImpl.java @@ -766,8 +766,8 @@ public void onEventMainThread(CallControlParticipantJoinedEvent event) { //group call self join. com.cisco.spark.android.callcontrol.model.Call locus = _callControlService.getCall(event.getLocusKey()); for (LocusParticipant locusParticipant : event.getJoinedParticipants()) { - if (locusParticipant.getDeviceUrl().equals(_device.getUrl()) - && locus != null + if (locus != null + && locusParticipant.getDeviceUrl().equals(_device.getUrl()) && locus.getLocusData().isMeeting()) { call = new CallImpl(this, _dialOption, CallImpl.Direction.OUTGOING, event.getLocusKey(), locus.getLocusData().isMeeting()); _bus.register(call); @@ -1558,7 +1558,10 @@ public void surfaceDestroyed(SurfaceHolder surfaceHolder) { }); } } - _callControlService.updateMediaSession(_callControlService.getCall(call.getKey()), mediaOptionToMediaDirection(call.getOption())); + com.cisco.spark.android.callcontrol.model.Call locus = _callControlService.getCall(call.getKey()); + if (locus != null) { + _callControlService.updateMediaSession(locus, mediaOptionToMediaDirection(call.getOption())); + } } call.setStatus(Call.CallStatus.CONNECTED);