From e3819f6ac341a08c358f1af0de35006e13c1d3a4 Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Tue, 8 Oct 2024 16:20:30 +0200 Subject: [PATCH] Fix java errors that used to be disabled. This is https://chromium-review.googlesource.com/c/chromium/src/+/5901711 hitting WebRTC. Change-Id: Ifedd949965a85b29364455a244edab1352f4fcea Bug: None Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364940 Reviewed-by: Harald Alvestrand Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#43193} --- .../org/appspot/apprtc/AppRTCBluetoothManager.java | 2 +- .../org/webrtc/CallSessionFileRotatingLogSink.java | 1 + .../api/org/webrtc/PeerConnectionFactory.java | 1 + .../org/webrtc/DefaultVideoEncoderFactoryTest.java | 6 +++--- .../src/org/webrtc/GlRectDrawerTest.java | 4 +--- .../webrtc/SurfaceViewRendererOnMeasureTest.java | 5 ++--- .../src/org/webrtc/VideoFrameBufferTest.java | 14 +++++++------- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java b/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java index e9077d8bd6..1415f4724f 100644 --- a/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java +++ b/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java @@ -111,7 +111,7 @@ public class AppRTCBluetoothManager { } @Override - /** Notifies the client when the proxy object has been disconnected from the service. */ + // Notifies the client when the proxy object has been disconnected from the service. public void onServiceDisconnected(int profile) { if (profile != BluetoothProfile.HEADSET || bluetoothState == State.UNINITIALIZED) { return; diff --git a/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java b/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java index f4edb58847..6683fc9da6 100644 --- a/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java +++ b/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java @@ -20,6 +20,7 @@ public class CallSessionFileRotatingLogSink { return nativeGetLogData(dirPath); } + @SuppressWarnings("EnumOrdinal") public CallSessionFileRotatingLogSink( String dirPath, int maxFileSize, Logging.Severity severity) { if (dirPath == null) { diff --git a/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/sdk/android/api/org/webrtc/PeerConnectionFactory.java index c46718fdd6..7f360eb452 100644 --- a/sdk/android/api/org/webrtc/PeerConnectionFactory.java +++ b/sdk/android/api/org/webrtc/PeerConnectionFactory.java @@ -291,6 +291,7 @@ public class PeerConnectionFactory { * PeerConnectionFactory. Replaces all the old initialization methods. Must not be called while * a PeerConnectionFactory is alive. */ + @SuppressWarnings("EnumOrdinal") public static void initialize(InitializationOptions options) { ContextUtils.initialize(options.applicationContext); NativeLibrary.initialize(options.nativeLibraryLoader, options.nativeLibraryName); diff --git a/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java b/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java index fe608c794e..86978c993b 100644 --- a/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java +++ b/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java @@ -60,9 +60,9 @@ public class DefaultVideoEncoderFactoryTest { @SmallTest @Test public void getSupportedCodecs_hwVp8WithDifferentParams_twoVp8() { - VideoCodecInfo hwVp8Encoder = new VideoCodecInfo("VP8", new HashMap() { - { put("param", "value"); } - }); + HashMap hwVp8EncoderParams = new HashMap(1); + hwVp8EncoderParams.put("param", "value"); + VideoCodecInfo hwVp8Encoder = new VideoCodecInfo("VP8", hwVp8EncoderParams); VideoEncoderFactory hwFactory = new CustomHardwareVideoEncoderFactory(hwVp8Encoder); DefaultVideoEncoderFactory defFactory = new DefaultVideoEncoderFactory(hwFactory); VideoCodecInfo[] supportedCodecs = defFactory.getSupportedCodecs(); diff --git a/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java b/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java index b067909a8d..a9d9d7be6e 100644 --- a/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java +++ b/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java @@ -227,9 +227,7 @@ public class GlRectDrawerTest { @Test @MediumTest public void testOesRendering() throws InterruptedException { - /** - * Stub class to convert RGB ByteBuffers to OES textures by drawing onto a SurfaceTexture. - */ + // Stub class to convert RGB ByteBuffers to OES textures by drawing onto a SurfaceTexture. class StubOesTextureProducer { private final EglBase eglBase; private final GlRectDrawer drawer; diff --git a/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java b/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java index 2e3ab405ce..b4a645ed44 100644 --- a/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java +++ b/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java @@ -126,9 +126,8 @@ public class SurfaceViewRendererOnMeasureTest { public void testFrame1280x720() throws InterruptedException { final SurfaceViewRenderer surfaceViewRenderer = new SurfaceViewRenderer(InstrumentationRegistry.getContext()); - /** - * Mock renderer events with blocking wait functionality for frame size changes. - */ + + // Mock renderer events with blocking wait functionality for frame size changes. class MockRendererEvents implements RendererCommon.RendererEvents { private int frameWidth; private int frameHeight; diff --git a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java index 43f5acea0a..a29e358b76 100644 --- a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java +++ b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java @@ -460,7 +460,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test calling toI420() and comparing pixel content against I420 reference. */ + // Test calling toI420() and comparing pixel content against I420 reference. public void testToI420() { final VideoFrame.I420Buffer referenceI420Buffer = createTestI420Buffer(); final VideoFrame.Buffer bufferToTest = createBufferToTest(referenceI420Buffer); @@ -476,7 +476,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Pure 2x scaling with no cropping. */ + // Pure 2x scaling with no cropping. public void testScale2x() { testCropAndScale(0 /* cropX= */, 0 /* cropY= */, /* cropWidth= */ 16, /* cropHeight= */ 16, /* scaleWidth= */ 8, /* scaleHeight= */ 8); @@ -484,7 +484,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test cropping only X direction, with no scaling. */ + // Test cropping only X direction, with no scaling. public void testCropX() { testCropAndScale(8 /* cropX= */, 0 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 16, /* scaleWidth= */ 8, /* scaleHeight= */ 16); @@ -492,7 +492,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test cropping only Y direction, with no scaling. */ + // Test cropping only Y direction, with no scaling. public void testCropY() { testCropAndScale(0 /* cropX= */, 8 /* cropY= */, /* cropWidth= */ 16, /* cropHeight= */ 8, /* scaleWidth= */ 16, /* scaleHeight= */ 8); @@ -500,7 +500,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test center crop, with no scaling. */ + // Test center crop, with no scaling. public void testCenterCrop() { testCropAndScale(4 /* cropX= */, 4 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 8, /* scaleWidth= */ 8, /* scaleHeight= */ 8); @@ -508,7 +508,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test non-center crop for right bottom corner, with no scaling. */ + // Test non-center crop for right bottom corner, with no scaling. public void testRightBottomCornerCrop() { testCropAndScale(8 /* cropX= */, 8 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 8, /* scaleWidth= */ 8, /* scaleHeight= */ 8); @@ -516,7 +516,7 @@ public class VideoFrameBufferTest { @Test @SmallTest - /** Test combined cropping and scaling. */ + // Test combined cropping and scaling. public void testCropAndScale() { testCropAndScale(4 /* cropX= */, 4 /* cropY= */, /* cropWidth= */ 12, /* cropHeight= */ 12, /* scaleWidth= */ 8, /* scaleHeight= */ 8);