Compare commits
6 commits
5e8d51db9f
...
437002d189
Author | SHA1 | Date | |
---|---|---|---|
437002d189 | |||
d8d49e03a0 | |||
6ca2ffd6ea | |||
788818fdda | |||
b218b57c94 | |||
|
e02dee8c01 |
2 changed files with 24 additions and 11 deletions
|
@ -136,7 +136,7 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
|||
|
||||
@Override
|
||||
public void onPermissionDenied(DeniedPermissions deniedPermissions) {
|
||||
connection.setDisconnected(new DisconnectCause(DisconnectCause.ERROR));
|
||||
connection.close(new DisconnectCause(DisconnectCause.ERROR));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -237,13 +237,13 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
|||
|
||||
postDial();
|
||||
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
||||
setDisconnected(new DisconnectCause(DisconnectCause.BUSY));
|
||||
close(new DisconnectCause(DisconnectCause.BUSY));
|
||||
} else if (state == RtpEndUserState.ENDED) {
|
||||
setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
|
||||
close(new DisconnectCause(DisconnectCause.LOCAL));
|
||||
} else if (state == RtpEndUserState.RETRACTED) {
|
||||
setDisconnected(new DisconnectCause(DisconnectCause.CANCELED));
|
||||
close(new DisconnectCause(DisconnectCause.CANCELED));
|
||||
} else if (RtpSessionActivity.END_CARD.contains(state)) {
|
||||
setDisconnected(new DisconnectCause(DisconnectCause.ERROR));
|
||||
close(new DisconnectCause(DisconnectCause.ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,18 +274,31 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
|||
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
|
||||
public void onDisconnect() {
|
||||
if (rtpConnection == null || rtpConnection.get() == null) {
|
||||
xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid());
|
||||
close(new DisconnectCause(DisconnectCause.LOCAL));
|
||||
} else {
|
||||
rtpConnection.get().endCall();
|
||||
}
|
||||
destroy();
|
||||
xmppConnectionService.setDiallerIntegrationActive(false);
|
||||
xmppConnectionService.removeRtpConnectionUpdateListener(
|
||||
(XmppConnectionService.OnJingleRtpConnectionUpdate) this
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -276,7 +276,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
|
|||
if (type != null && (type.equals("pstn") || type.equals("sms"))) {
|
||||
try {
|
||||
binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
|
||||
} catch (NumberParseException | NullPointerException e) { }
|
||||
} catch (NumberParseException | IllegalArgumentException | NullPointerException e) { }
|
||||
}
|
||||
|
||||
if (p == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue