Suppress "UnusedMethod" warning on methods only used on native code.

Change-Id: Ide048fd06d20b6a7a7ef0f74db9d6d267ab61f01
Bug: webrtc:383026404
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370740
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43514}
This commit is contained in:
Jeremy Leconte 2024-12-09 11:14:47 +01:00 committed by WebRTC LUCI CQ
parent 4c56c9ff9a
commit a01f34cdf1
5 changed files with 15 additions and 18 deletions

View File

@ -82,36 +82,43 @@ public class EncodedImage implements RefCounted {
this.refCountDelegate = new RefCountDelegate(releaseCallback);
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private ByteBuffer getBuffer() {
return buffer;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private int getEncodedWidth() {
return encodedWidth;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private int getEncodedHeight() {
return encodedHeight;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private long getCaptureTimeNs() {
return captureTimeNs;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private int getFrameType() {
return frameType.getNative();
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private int getRotation() {
return rotation;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative
private @Nullable Integer getQp() {
return qp;

View File

@ -37,6 +37,7 @@ public interface NetworkChangeDetector {
this.address = address;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("IPAddress")
private byte[] getAddress() {
return address;
@ -61,26 +62,31 @@ public interface NetworkChangeDetector {
this.ipAddresses = addresses;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("NetworkInformation")
private IPAddress[] getIpAddresses() {
return ipAddresses;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("NetworkInformation")
private ConnectionType getConnectionType() {
return type;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("NetworkInformation")
private ConnectionType getUnderlyingConnectionTypeForVpn() {
return underlyingTypeForVpn;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("NetworkInformation")
private long getHandle() {
return handle;
}
@SuppressWarnings("UnusedMethod")
@CalledByNative("NetworkInformation")
private String getName() {
return name;

View File

@ -54,7 +54,7 @@ public class RTCStatsReport {
}
// TODO(bugs.webrtc.org/8557) Use ctor directly with full Map type.
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "UnusedMethod"})
@CalledByNative
private static RTCStatsReport create(long timestampUs, Map stats) {
return new RTCStatsReport(timestampUs, stats);

View File

@ -128,18 +128,6 @@ public class NetworkMonitorTest {
public void setNetworkType(int networkType) {
this.networkType = networkType;
}
public void setNetworkSubtype(int networkSubtype) {
this.networkSubtype = networkSubtype;
}
public void setUnderlyingNetworkType(int underlyingNetworkTypeForVpn) {
this.underlyingNetworkTypeForVpn = underlyingNetworkTypeForVpn;
}
public void setUnderlyingNetworkSubype(int underlyingNetworkSubtypeForVpn) {
this.underlyingNetworkSubtypeForVpn = underlyingNetworkSubtypeForVpn;
}
}
/**
@ -219,11 +207,6 @@ public class NetworkMonitorTest {
wifiDelegate.setWifiSSID("foo");
}
private NetworkMonitorAutoDetect.ConnectionType getCurrentConnectionType() {
final NetworkMonitorAutoDetect.NetworkState networkState = receiver.getCurrentNetworkState();
return NetworkMonitorAutoDetect.getConnectionType(networkState);
}
@Before
public void setUp() {
ContextUtils.initialize(InstrumentationRegistry.getTargetContext());

View File

@ -195,6 +195,7 @@ public class NativeTestWebrtc {
// Signal a failure of the native test loader to python scripts
// which run tests. For example, we look for
// RUNNER_FAILED build/android/test_package.py.
@SuppressWarnings("UnusedMethod")
private void nativeTestFailed() {
Log.e(TAG, "[ RUNNER_FAILED ] could not load native library");
}