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() {
Log.d(Config.LOGTAG,"updateCallDuration()");
final JingleRtpConnection connection = this.rtpConnectionReference != null ? this.rtpConnectionReference.get() : null;
if (connection == null || connection.getMedia().contains(Media.VIDEO)) {
Log.d(Config.LOGTAG,"rtpConnection was null or contained video");
this.binding.duration.setVisibility(View.GONE);
return;
}

View File

@ -262,6 +262,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
rtpConnection.deliveryMessage(from, message, serverMsgId, timestamp);
} else {
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())) {

View File

@ -486,6 +486,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
}
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");
if (transition(State.TERMINATED_CONNECTIVITY_ERROR)) {
webRTCWrapper.close();

View File

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