Deprecate IceServer constructors and update dependencies
Bug: webrtc:8176
Change-Id: I2ebc0edf1776c49c202a181d7597099e9242c0e7
Reviewed-on: https://chromium-review.googlesource.com/642710
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19621}
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java
index 706f365..1556a69 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java
@@ -187,7 +187,12 @@
String credential = server.has("credential") ? server.getString("credential") : "";
for (int j = 0; j < turnUrls.length(); j++) {
String turnUrl = turnUrls.getString(j);
- turnServers.add(new PeerConnection.IceServer(turnUrl, username, credential));
+ PeerConnection.IceServer turnServer =
+ PeerConnection.IceServer.builder(turnUrl)
+ .setUsername(username)
+ .setPassword(credential)
+ .createIceServer();
+ turnServers.add(turnServer);
}
}
return turnServers;
@@ -204,7 +209,11 @@
JSONObject server = servers.getJSONObject(i);
String url = server.getString("urls");
String credential = server.has("credential") ? server.getString("credential") : "";
- ret.add(new PeerConnection.IceServer(url, "", credential));
+ PeerConnection.IceServer turnServer =
+ PeerConnection.IceServer.builder(url)
+ .setPassword(credential)
+ .createIceServer();
+ ret.add(turnServer);
}
return ret;
}
diff --git a/webrtc/sdk/android/api/org/webrtc/PeerConnection.java b/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
index ce9a110..8322410 100644
--- a/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
+++ b/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
@@ -114,18 +114,22 @@
public final List<String> tlsAlpnProtocols;
/** Convenience constructor for STUN servers. */
+ @Deprecated
public IceServer(String uri) {
this(uri, "", "");
}
+ @Deprecated
public IceServer(String uri, String username, String password) {
this(uri, username, password, TlsCertPolicy.TLS_CERT_POLICY_SECURE);
}
+ @Deprecated
public IceServer(String uri, String username, String password, TlsCertPolicy tlsCertPolicy) {
this(uri, username, password, tlsCertPolicy, "");
}
+ @Deprecated
public IceServer(String uri, String username, String password, TlsCertPolicy tlsCertPolicy,
String hostname) {
this(uri, username, password, tlsCertPolicy, hostname, null);