set in-call UI active in the connecting state

Peter Cai created

Currently, if the "CONNECTING" stage of a Jingle call takes a
significant amount of time (say, a second), then there will be a window
where the call is already accepted but the ringing UI is still showing.
This 1) is confusing; 2) allows the user to accept a call twice, which
will cause a crash.

Unfortunately, there is no native equivalent to the "CONNECTING" state.
The only sane choice here seems to be showing the in-call UI even if the
call is still connecting.

Change summary

src/cheogram/java/com/cheogram/android/ConnectionService.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

src/cheogram/java/com/cheogram/android/ConnectionService.java 🔗

@@ -243,10 +243,10 @@ public class ConnectionService extends android.telecom.ConnectionService {
 				setDialing();
 			} else if (state == RtpEndUserState.INCOMING_CALL) {
 				setRinging();
-			} else if (state == RtpEndUserState.CONNECTED) {
+			} else if (state == RtpEndUserState.CONNECTING) {
 				xmppConnectionService.setDiallerIntegrationActive(true);
 				setActive();
-
+			} else if (state == RtpEndUserState.CONNECTED) {
 				postDial();
 			} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
 				close(new DisconnectCause(DisconnectCause.BUSY));