Compare commits

..

5 commits

Author SHA1 Message Date
Peter Cai d8d49e03a0 ConnectionService: implement onReject()
Forgot this for incoming calls
2022-03-12 13:08:42 -05:00
Peter Cai 6ca2ffd6ea ConnectionService: miscellaneous fixes
* Fix a few potential errors due to the use of newer APIs (minSDK is
  still only 24)
* Fix one remaining case of raw usage of generic types.
2022-03-12 12:50:29 -05:00
Peter Cai 788818fdda ConnectionService: Dialer UI integration for incoming calls
For incoming calls, we fall back to the built-in call UI if the
microphone permission is not granted. The reason is that if the Dialer
UI is displayed over keyguard, then the user may not even be able to see
the notification that we show in order for them to grant the permission.
Having a small annoyance for the first incoming call is better than
having the in-call UI hang.
2022-03-12 12:50:29 -05:00
Peter Cai b218b57c94 ConnectionService: fix unchecked type assignments 2022-03-12 12:50:29 -05:00
Stephen Paul Weber e02dee8c01
Bad number can also cause IllegalArgumentException 2022-03-11 23:00:49 -05:00
2 changed files with 8 additions and 1 deletions

View file

@ -274,6 +274,13 @@ 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();
setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
}
@Override
public void onDisconnect() {
if (rtpConnection == null || rtpConnection.get() == null) {

View file

@ -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) {