Add TURN_LOGGING_ID to android sdk

This patch adds support for setting the TURN_LOGGING_ID
in RTCConfig using the android SDK.

TURN_LOGGING_ID was added to webrtc in
https://webrtc-review.googlesource.com/c/src/+/149829

The intended usage of this attribute is to correlate client and
backend logs.

bug: webrtc:10897
Change-Id: Ifd62e0f1dac396942c76a794bf7a75553d3244b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150538
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28996}
This commit is contained in:
Jonas Oreland 2019-08-28 09:08:58 +02:00 committed by Commit Bot
parent 03307cb2b5
commit 228900f8b1
2 changed files with 20 additions and 0 deletions

View File

@ -558,6 +558,13 @@ public class PeerConnection {
*/
@Nullable public CryptoOptions cryptoOptions;
/**
* An optional string that if set will be attached to the
* TURN_ALLOCATE_REQUEST which can be used to correlate client
* logs with backend logs
*/
@Nullable public String turnLoggingId;
// TODO(deadbeef): Instead of duplicating the defaults here, we should do
// something to pick up the defaults from C++. The Objective-C equivalent
// of RTCConfiguration does that.
@ -601,6 +608,7 @@ public class PeerConnection {
useMediaTransport = false;
useMediaTransportForDataChannels = false;
cryptoOptions = null;
turnLoggingId = null;
}
@CalledByNative("RTCConfiguration")
@ -820,6 +828,12 @@ public class PeerConnection {
CryptoOptions getCryptoOptions() {
return cryptoOptions;
}
@Nullable
@CalledByNative("RTCConfiguration")
String getTurnLoggingId() {
return turnLoggingId;
}
};
private final List<MediaStream> localStreams = new ArrayList<>();

View File

@ -274,6 +274,12 @@ void JavaToNativeRTCConfiguration(
j_rtc_config);
rtc_config->crypto_options =
JavaToNativeOptionalCryptoOptions(jni, j_crypto_options);
ScopedJavaLocalRef<jstring> j_turn_logging_id =
Java_RTCConfiguration_getTurnLoggingId(jni, j_rtc_config);
if (!IsNull(jni, j_turn_logging_id)) {
rtc_config->turn_logging_id = JavaToNativeString(jni, j_turn_logging_id);
}
}
rtc::KeyType GetRtcConfigKeyType(JNIEnv* env,