Run local hangup events through view model

Fixes #6143
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-02-02 18:53:45 -08:00
parent 9a93a8b28d
commit 7d644ae9c6
2 changed files with 7 additions and 6 deletions

View File

@ -181,11 +181,11 @@ public class WebRtcCallActivity extends Activity {
intent.setAction(WebRtcCallService.ACTION_LOCAL_HANGUP);
startService(intent);
WebRtcViewModel event = EventBus.getDefault().getStickyEvent(WebRtcViewModel.class);
if (event != null) {
WebRtcCallActivity.this.handleTerminate(event.getRecipient());
}
// WebRtcViewModel event = EventBus.getDefault().getStickyEvent(WebRtcViewModel.class);
//
// if (event != null) {
// WebRtcCallActivity.this.handleTerminate(event.getRecipient());
// }
}
private void handleIncomingCall(@NonNull WebRtcViewModel event) {

View File

@ -569,6 +569,7 @@ public class WebRtcCallService extends Service implements InjectableType, CallSt
this.dataChannel.send(new DataChannel.Buffer(ByteBuffer.wrap(Data.newBuilder().setHangup(Hangup.newBuilder().setId(this.callId)).build().toByteArray()), false));
sendMessage(this.recipient, SignalServiceCallMessage.forHangup(new HangupMessage(this.callId)));
sendMessage(WebRtcViewModel.State.CALL_DISCONNECTED, this.recipient, localVideoEnabled, remoteVideoEnabled);
}
terminate();
@ -621,7 +622,7 @@ public class WebRtcCallService extends Service implements InjectableType, CallSt
.setEnabled(localVideoEnabled))
.build().toByteArray()), false));
}
sendMessage(viewModelStateFor(callState), this.recipient, localVideoEnabled, remoteVideoEnabled);
}