Compare commits
3 commits
3ee45952fc
...
3096f859ac
Author | SHA1 | Date | |
---|---|---|---|
Peter Cai | 3096f859ac | ||
Peter Cai | 9945e4bf09 | ||
Peter Cai | 31c627135c |
|
@ -22,6 +22,8 @@ import android.telecom.TelecomManager;
|
||||||
import android.telephony.PhoneNumberUtils;
|
import android.telephony.PhoneNumberUtils;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
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.Media;
|
||||||
import eu.siacs.conversations.xmpp.jingle.RtpEndUserState;
|
import eu.siacs.conversations.xmpp.jingle.RtpEndUserState;
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
public class ConnectionService extends android.telecom.ConnectionService {
|
public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
public XmppConnectionService xmppConnectionService = null;
|
public XmppConnectionService xmppConnectionService = null;
|
||||||
protected ServiceConnection mConnection = new ServiceConnection() {
|
protected ServiceConnection mConnection = new ServiceConnection() {
|
||||||
|
@ -235,7 +238,7 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
findRtpConnection();
|
findRtpConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatusHints(new StatusHints(null, gatewayIcon, null));
|
String statusLabel = null;
|
||||||
|
|
||||||
if (state == RtpEndUserState.FINDING_DEVICE) {
|
if (state == RtpEndUserState.FINDING_DEVICE) {
|
||||||
setInitialized();
|
setInitialized();
|
||||||
|
@ -246,7 +249,10 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
} else if (state == RtpEndUserState.CONNECTING) {
|
} else if (state == RtpEndUserState.CONNECTING) {
|
||||||
xmppConnectionService.setDiallerIntegrationActive(true);
|
xmppConnectionService.setDiallerIntegrationActive(true);
|
||||||
setActive();
|
setActive();
|
||||||
|
statusLabel = getString(R.string.rtp_state_connecting);
|
||||||
} else if (state == RtpEndUserState.CONNECTED) {
|
} else if (state == RtpEndUserState.CONNECTED) {
|
||||||
|
xmppConnectionService.setDiallerIntegrationActive(true);
|
||||||
|
setActive();
|
||||||
postDial();
|
postDial();
|
||||||
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
||||||
close(new DisconnectCause(DisconnectCause.BUSY));
|
close(new DisconnectCause(DisconnectCause.BUSY));
|
||||||
|
@ -257,6 +263,8 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
} else if (RtpSessionActivity.END_CARD.contains(state)) {
|
} else if (RtpSessionActivity.END_CARD.contains(state)) {
|
||||||
close(new DisconnectCause(DisconnectCause.ERROR));
|
close(new DisconnectCause(DisconnectCause.ERROR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setStatusHints(new StatusHints(statusLabel, gatewayIcon, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue