Mitigate PSTN callback crash when service is in background.

This commit is contained in:
Cody Henthorne 2020-10-28 15:48:04 -04:00
parent dfa6306b61
commit 0077b29d6e

View file

@ -479,12 +479,14 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
} }
private void hangup() { private void hangup() {
if (serviceState != null && serviceState.getCallInfoState().getActivePeer() != null) {
Intent intent = new Intent(WebRtcCallService.this, WebRtcCallService.class); Intent intent = new Intent(WebRtcCallService.this, WebRtcCallService.class);
intent.setAction(ACTION_LOCAL_HANGUP); intent.setAction(ACTION_LOCAL_HANGUP);
startService(intent); startService(intent);
} }
} }
}
private @NonNull ListenableFutureTask<TurnServerInfoParcel> retrieveTurnServers() { private @NonNull ListenableFutureTask<TurnServerInfoParcel> retrieveTurnServers() {
Callable<TurnServerInfoParcel> callable = () -> new TurnServerInfoParcel(accountManager.getTurnServerInfo()); Callable<TurnServerInfoParcel> callable = () -> new TurnServerInfoParcel(accountManager.getTurnServerInfo());