Annotate libjingle_peerconnection_java with @Nullable.
Bug: webrtc:8881
Change-Id: Ida2ef6c003567d19529c21629c916ed40e8de3a6
Reviewed-on: https://webrtc-review.googlesource.com/63380
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22563}
diff --git a/sdk/android/api/org/webrtc/PeerConnection.java b/sdk/android/api/org/webrtc/PeerConnection.java
index cf0eed5..dfe4b61 100644
--- a/sdk/android/api/org/webrtc/PeerConnection.java
+++ b/sdk/android/api/org/webrtc/PeerConnection.java
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import javax.annotation.Nullable;
/**
* Java-land version of the PeerConnection APIs; wraps the C++ API
@@ -202,7 +203,7 @@
}
public static class Builder {
- private final List<String> urls;
+ @Nullable private final List<String> urls;
private String username = "";
private String password = "";
private TlsCertPolicy tlsCertPolicy = TlsCertPolicy.TLS_CERT_POLICY_SECURE;
@@ -253,16 +254,19 @@
}
}
+ @Nullable
@CalledByNative("IceServer")
List<String> getUrls() {
return urls;
}
+ @Nullable
@CalledByNative("IceServer")
String getUsername() {
return username;
}
+ @Nullable
@CalledByNative("IceServer")
String getPassword() {
return password;
@@ -273,6 +277,7 @@
return tlsCertPolicy;
}
+ @Nullable
@CalledByNative("IceServer")
String getHostname() {
return hostname;
@@ -406,19 +411,19 @@
// 3) iceCheckMinInterval defines the minimal interval (equivalently the
// maximum rate) that overrides the above two intervals when either of them
// is less.
- public Integer iceCheckIntervalStrongConnectivityMs;
- public Integer iceCheckIntervalWeakConnectivityMs;
- public Integer iceCheckMinInterval;
+ @Nullable public Integer iceCheckIntervalStrongConnectivityMs;
+ @Nullable public Integer iceCheckIntervalWeakConnectivityMs;
+ @Nullable public Integer iceCheckMinInterval;
// The time period in milliseconds for which a candidate pair must wait for response to
// connectivitiy checks before it becomes unwritable.
- public Integer iceUnwritableTimeMs;
+ @Nullable public Integer iceUnwritableTimeMs;
// The minimum number of connectivity checks that a candidate pair must sent without receiving
// response before it becomes unwritable.
- public Integer iceUnwritableMinChecks;
+ @Nullable public Integer iceUnwritableMinChecks;
// The interval in milliseconds at which STUN candidates will resend STUN binding requests
// to keep NAT bindings open.
// The default value in the implementation is used if this field is null.
- public Integer stunCandidateKeepaliveIntervalMs;
+ @Nullable public Integer stunCandidateKeepaliveIntervalMs;
public boolean disableIPv6OnWifi;
// By default, PeerConnection will use a limited number of IPv6 network
// interfaces, in order to avoid too many ICE candidate pairs being created
@@ -426,7 +431,7 @@
//
// Can be set to Integer.MAX_VALUE to effectively disable the limit.
public int maxIPv6Networks;
- public IntervalRange iceRegatherIntervalRange;
+ @Nullable public IntervalRange iceRegatherIntervalRange;
// These values will be overridden by MediaStream constraints if deprecated constraints-based
// create peerconnection interface is used.
@@ -435,16 +440,16 @@
public boolean enableCpuOveruseDetection;
public boolean enableRtpDataChannel;
public boolean suspendBelowMinBitrate;
- public Integer screencastMinBitrate;
- public Boolean combinedAudioVideoBwe;
- public Boolean enableDtlsSrtp;
+ @Nullable public Integer screencastMinBitrate;
+ @Nullable public Boolean combinedAudioVideoBwe;
+ @Nullable public Boolean enableDtlsSrtp;
// Use "Unknown" to represent no preference of adapter types, not the
// preference of adapters of unknown types.
public AdapterType networkPreference;
public SdpSemantics sdpSemantics;
// This is an optional wrapper for the C++ webrtc::TurnCustomizer.
- public TurnCustomizer turnCustomizer;
+ @Nullable public TurnCustomizer turnCustomizer;
// TODO(deadbeef): Instead of duplicating the defaults here, we should do
// something to pick up the defaults from C++. The Objective-C equivalent
@@ -561,31 +566,37 @@
return presumeWritableWhenFullyRelayed;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getIceCheckIntervalStrongConnectivity() {
return iceCheckIntervalStrongConnectivityMs;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getIceCheckIntervalWeakConnectivity() {
return iceCheckIntervalWeakConnectivityMs;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getIceCheckMinInterval() {
return iceCheckMinInterval;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getIceUnwritableTimeout() {
return iceUnwritableTimeMs;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getIceUnwritableMinChecks() {
return iceUnwritableMinChecks;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getStunCandidateKeepaliveInterval() {
return stunCandidateKeepaliveIntervalMs;
@@ -601,11 +612,13 @@
return maxIPv6Networks;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
IntervalRange getIceRegatherIntervalRange() {
return iceRegatherIntervalRange;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
TurnCustomizer getTurnCustomizer() {
return turnCustomizer;
@@ -636,16 +649,19 @@
return suspendBelowMinBitrate;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Integer getScreencastMinBitrate() {
return screencastMinBitrate;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Boolean getCombinedAudioVideoBwe() {
return combinedAudioVideoBwe;
}
+ @Nullable
@CalledByNative("RTCConfiguration")
Boolean getEnableDtlsSrtp() {
return enableDtlsSrtp;
@@ -923,7 +939,7 @@
}
public RtpTransceiver addTransceiver(
- MediaStreamTrack track, RtpTransceiver.RtpTransceiverInit init) {
+ MediaStreamTrack track, @Nullable RtpTransceiver.RtpTransceiverInit init) {
if (track == null) {
throw new NullPointerException("No MediaStreamTrack specified for addTransceiver.");
}
@@ -943,7 +959,7 @@
}
public RtpTransceiver addTransceiver(
- MediaStreamTrack.MediaType mediaType, RtpTransceiver.RtpTransceiverInit init) {
+ MediaStreamTrack.MediaType mediaType, @Nullable RtpTransceiver.RtpTransceiverInit init) {
if (mediaType == null) {
throw new NullPointerException("No MediaType specified for addTransceiver.");
}
@@ -960,7 +976,7 @@
// Older, non-standard implementation of getStats.
@Deprecated
- public boolean getStats(StatsObserver observer, MediaStreamTrack track) {
+ public boolean getStats(StatsObserver observer, @Nullable MediaStreamTrack track) {
return nativeOldGetStats(observer, (track == null) ? 0 : track.nativeTrack);
}