Compare commits
3 commits
437002d189
...
5e8d51db9f
Author | SHA1 | Date | |
---|---|---|---|
5e8d51db9f | |||
faab2d5799 | |||
b7b2bb0cdd |
2 changed files with 11 additions and 24 deletions
|
@ -136,7 +136,7 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPermissionDenied(DeniedPermissions deniedPermissions) {
|
public void onPermissionDenied(DeniedPermissions deniedPermissions) {
|
||||||
connection.close(new DisconnectCause(DisconnectCause.ERROR));
|
connection.setDisconnected(new DisconnectCause(DisconnectCause.ERROR));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -237,13 +237,13 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
|
|
||||||
postDial();
|
postDial();
|
||||||
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
||||||
close(new DisconnectCause(DisconnectCause.BUSY));
|
setDisconnected(new DisconnectCause(DisconnectCause.BUSY));
|
||||||
} else if (state == RtpEndUserState.ENDED) {
|
} else if (state == RtpEndUserState.ENDED) {
|
||||||
close(new DisconnectCause(DisconnectCause.LOCAL));
|
setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
|
||||||
} else if (state == RtpEndUserState.RETRACTED) {
|
} else if (state == RtpEndUserState.RETRACTED) {
|
||||||
close(new DisconnectCause(DisconnectCause.CANCELED));
|
setDisconnected(new DisconnectCause(DisconnectCause.CANCELED));
|
||||||
} else if (RtpSessionActivity.END_CARD.contains(state)) {
|
} else if (RtpSessionActivity.END_CARD.contains(state)) {
|
||||||
close(new DisconnectCause(DisconnectCause.ERROR));
|
setDisconnected(new DisconnectCause(DisconnectCause.ERROR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,31 +274,18 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
rtpConnection.get().acceptCall();
|
rtpConnection.get().acceptCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReject() {
|
|
||||||
this.rtpConnection = xmppConnectionService.getJingleConnectionManager().findJingleRtpConnection(account, with, sessionId);
|
|
||||||
rtpConnection.get().rejectCall();
|
|
||||||
close(new DisconnectCause(DisconnectCause.LOCAL));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the connection to the disconnected state and clean up the resources
|
|
||||||
// Note that we cannot do this from onStateChanged() because calling destroy
|
|
||||||
// there seems to trigger a deadlock somewhere in the telephony stack.
|
|
||||||
public void close(DisconnectCause reason) {
|
|
||||||
setDisconnected(reason);
|
|
||||||
destroy();
|
|
||||||
xmppConnectionService.setDiallerIntegrationActive(false);
|
|
||||||
xmppConnectionService.removeRtpConnectionUpdateListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisconnect() {
|
public void onDisconnect() {
|
||||||
if (rtpConnection == null || rtpConnection.get() == null) {
|
if (rtpConnection == null || rtpConnection.get() == null) {
|
||||||
xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid());
|
xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid());
|
||||||
close(new DisconnectCause(DisconnectCause.LOCAL));
|
|
||||||
} else {
|
} else {
|
||||||
rtpConnection.get().endCall();
|
rtpConnection.get().endCall();
|
||||||
}
|
}
|
||||||
|
destroy();
|
||||||
|
xmppConnectionService.setDiallerIntegrationActive(false);
|
||||||
|
xmppConnectionService.removeRtpConnectionUpdateListener(
|
||||||
|
(XmppConnectionService.OnJingleRtpConnectionUpdate) this
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -276,7 +276,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
|
||||||
if (type != null && (type.equals("pstn") || type.equals("sms"))) {
|
if (type != null && (type.equals("pstn") || type.equals("sms"))) {
|
||||||
try {
|
try {
|
||||||
binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
|
binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
|
||||||
} catch (NumberParseException | IllegalArgumentException | NullPointerException e) { }
|
} catch (NumberParseException | NullPointerException e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue