~singpolyma/cheogram-android

4548ef7c7411c2fa31b282efc76aa2c2e568e1da — Stephen Paul Weber a month ago 3e47999 + 3096f85
Merge branch 'peter-dev' of https://gitea.angry.im/PeterCxy/cheogram

* 'peter-dev' of https://gitea.angry.im/PeterCxy/cheogram:
  Call setActive anyway in CONNECTED state
  Add @RequiresApi annotation for dialer integration
  Use StatusHint label to signal connecting state
  set in-call UI active in the connecting state
1 files changed, 10 insertions(+), 2 deletions(-)

M src/cheogram/java/com/cheogram/android/ConnectionService.java
M src/cheogram/java/com/cheogram/android/ConnectionService.java => src/cheogram/java/com/cheogram/android/ConnectionService.java +10 -2
@@ 22,6 22,8 @@ import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;

import android.Manifest;

import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;
import android.content.ComponentName;
import android.content.Context;


@@ 53,6 55,7 @@ import eu.siacs.conversations.xmpp.jingle.JingleRtpConnection;
import eu.siacs.conversations.xmpp.jingle.Media;
import eu.siacs.conversations.xmpp.jingle.RtpEndUserState;

@RequiresApi(Build.VERSION_CODES.M)
public class ConnectionService extends android.telecom.ConnectionService {
	public XmppConnectionService xmppConnectionService = null;
	protected ServiceConnection mConnection = new ServiceConnection() {


@@ 235,7 238,7 @@ public class ConnectionService extends android.telecom.ConnectionService {
				findRtpConnection();
			}

			setStatusHints(new StatusHints(null, gatewayIcon, null));
			String statusLabel = null;

			if (state == RtpEndUserState.FINDING_DEVICE) {
				setInitialized();


@@ 243,10 246,13 @@ public class ConnectionService extends android.telecom.ConnectionService {
				setDialing();
			} else if (state == RtpEndUserState.INCOMING_CALL) {
				setRinging();
			} else if (state == RtpEndUserState.CONNECTING) {
				xmppConnectionService.setDiallerIntegrationActive(true);
				setActive();
				statusLabel = getString(R.string.rtp_state_connecting);
			} else if (state == RtpEndUserState.CONNECTED) {
				xmppConnectionService.setDiallerIntegrationActive(true);
				setActive();

				postDial();
			} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
				close(new DisconnectCause(DisconnectCause.BUSY));


@@ 257,6 263,8 @@ public class ConnectionService extends android.telecom.ConnectionService {
			} else if (RtpSessionActivity.END_CARD.contains(state)) {
				close(new DisconnectCause(DisconnectCause.ERROR));
			}

			setStatusHints(new StatusHints(statusLabel, gatewayIcon, null));
		}

		@Override