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); this.refCountDelegate = new RefCountDelegate(releaseCallback);
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private ByteBuffer getBuffer() { private ByteBuffer getBuffer() {
return buffer; return buffer;
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private int getEncodedWidth() { private int getEncodedWidth() {
return encodedWidth; return encodedWidth;
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private int getEncodedHeight() { private int getEncodedHeight() {
return encodedHeight; return encodedHeight;
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private long getCaptureTimeNs() { private long getCaptureTimeNs() {
return captureTimeNs; return captureTimeNs;
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private int getFrameType() { private int getFrameType() {
return frameType.getNative(); return frameType.getNative();
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private int getRotation() { private int getRotation() {
return rotation; return rotation;
} }
@SuppressWarnings("UnusedMethod")
@CalledByNative @CalledByNative
private @Nullable Integer getQp() { private @Nullable Integer getQp() {
return qp; return qp;

View File

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

View File

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

View File

@ -128,18 +128,6 @@ public class NetworkMonitorTest {
public void setNetworkType(int networkType) { public void setNetworkType(int networkType) {
this.networkType = 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"); wifiDelegate.setWifiSSID("foo");
} }
private NetworkMonitorAutoDetect.ConnectionType getCurrentConnectionType() {
final NetworkMonitorAutoDetect.NetworkState networkState = receiver.getCurrentNetworkState();
return NetworkMonitorAutoDetect.getConnectionType(networkState);
}
@Before @Before
public void setUp() { public void setUp() {
ContextUtils.initialize(InstrumentationRegistry.getTargetContext()); ContextUtils.initialize(InstrumentationRegistry.getTargetContext());

View File

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