Fix crash listening to PSTN pickups on some devices.

We do this as a helpful thing to end a signal call if the user gets a
PSTN call, but some Xiaomi devices are crashing because they require
unique permissions. But we can just do it optimistically.
fork-5.53.8
Greyson Parrelli 2022-10-18 09:59:34 -04:00
rodzic a456c3fa32
commit b324db53d3
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -131,7 +131,11 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
registerNetworkReceiver();
if (!AndroidTelecomUtil.getTelecomSupported()) {
TelephonyUtil.getManager(this).listen(hangUpRtcOnDeviceCallAnswered, PhoneStateListener.LISTEN_CALL_STATE);
try {
TelephonyUtil.getManager(this).listen(hangUpRtcOnDeviceCallAnswered, PhoneStateListener.LISTEN_CALL_STATE);
} catch (SecurityException e) {
Log.w(TAG, "Failed to listen to PSTN call answers!", e);
}
}
}