The webrtc busy state could be idle, but system dialer connected

This commit is contained in:
Moxie Marlinspike 2017-12-19 10:57:34 -08:00
parent 0ec1ae4ed3
commit 9c77ffc2a4

View File

@ -602,6 +602,7 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
switch (callState) { switch (callState) {
case STATE_DIALING: case STATE_DIALING:
case STATE_REMOTE_RINGING: setCallInProgressNotification(TYPE_OUTGOING_RINGING, this.recipient); break; case STATE_REMOTE_RINGING: setCallInProgressNotification(TYPE_OUTGOING_RINGING, this.recipient); break;
case STATE_IDLE:
case STATE_ANSWERING: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, this.recipient); break; case STATE_ANSWERING: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, this.recipient); break;
case STATE_LOCAL_RINGING: setCallInProgressNotification(TYPE_INCOMING_RINGING, this.recipient); break; case STATE_LOCAL_RINGING: setCallInProgressNotification(TYPE_INCOMING_RINGING, this.recipient); break;
case STATE_CONNECTED: setCallInProgressNotification(TYPE_ESTABLISHED, this.recipient); break; case STATE_CONNECTED: setCallInProgressNotification(TYPE_ESTABLISHED, this.recipient); break;
@ -609,6 +610,10 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
} }
} }
if (callState == CallState.STATE_IDLE) {
stopForeground(true);
}
sendMessage(recipient, SignalServiceCallMessage.forBusy(new BusyMessage(callId))); sendMessage(recipient, SignalServiceCallMessage.forBusy(new BusyMessage(callId)));
insertMissedCall(getRemoteRecipient(intent), false); insertMissedCall(getRemoteRecipient(intent), false);
} }