catch UnsatisfiedLinkError when trying to init libwebrtc. fixes #3707

This commit is contained in:
Daniel Gultsch 2020-05-09 19:48:54 +02:00
parent 1d9b9e3bf0
commit f4247379bd
4 changed files with 16 additions and 7 deletions

View file

@ -705,10 +705,8 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
} }
private void updateCallDuration() { private void updateCallDuration() {
Log.d(Config.LOGTAG,"updateCallDuration()");
final JingleRtpConnection connection = this.rtpConnectionReference != null ? this.rtpConnectionReference.get() : null; final JingleRtpConnection connection = this.rtpConnectionReference != null ? this.rtpConnectionReference.get() : null;
if (connection == null || connection.getMedia().contains(Media.VIDEO)) { if (connection == null || connection.getMedia().contains(Media.VIDEO)) {
Log.d(Config.LOGTAG,"rtpConnection was null or contained video");
this.binding.duration.setVisibility(View.GONE); this.binding.duration.setVisibility(View.GONE);
return; return;
} }

View file

@ -262,6 +262,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
rtpConnection.deliveryMessage(from, message, serverMsgId, timestamp); rtpConnection.deliveryMessage(from, message, serverMsgId, timestamp);
} else { } else {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": no rtp session proposal found for " + from + " to deliver proceed"); Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": no rtp session proposal found for " + from + " to deliver proceed");
//TODO return error message "item-not-found"
} }
} }
} else if ("reject".equals(message.getName())) { } else if ("reject".equals(message.getName())) {

View file

@ -486,6 +486,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
} }
void deliverFailedProceed() { void deliverFailedProceed() {
//TODO do we want a special State.ITEM_NOT_FOUND to track retracted calls during network outages
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": receive message error for proceed message"); Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": receive message error for proceed message");
if (transition(State.TERMINATED_CONNECTIVITY_ERROR)) { if (transition(State.TERMINATED_CONNECTIVITY_ERROR)) {
webRTCWrapper.close(); webRTCWrapper.close();

View file

@ -8,6 +8,7 @@ import android.util.Log;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Futures;
@ -164,10 +165,14 @@ public class WebRTCWrapper {
this.eventCallback = eventCallback; this.eventCallback = eventCallback;
} }
public void setup(final Context context, final AppRTCAudioManager.SpeakerPhonePreference speakerPhonePreference) { public void setup(final Context context, final AppRTCAudioManager.SpeakerPhonePreference speakerPhonePreference) throws InitializationException {
PeerConnectionFactory.initialize( try {
PeerConnectionFactory.InitializationOptions.builder(context).createInitializationOptions() PeerConnectionFactory.initialize(
); PeerConnectionFactory.InitializationOptions.builder(context).createInitializationOptions()
);
} catch (final UnsatisfiedLinkError e) {
throw new InitializationException(e);
}
this.eglBase = EglBase.create(); this.eglBase = EglBase.create();
this.context = context; this.context = context;
mainHandler.post(() -> { mainHandler.post(() -> {
@ -555,7 +560,11 @@ public class WebRTCWrapper {
static class InitializationException extends Exception { static class InitializationException extends Exception {
private InitializationException(String message) { private InitializationException(final Throwable throwable) {
super(throwable);
}
private InitializationException(final String message) {
super(message); super(message);
} }
} }