Skip to content

Commit 0aa4d9d

Browse files
authored
Bumping CI to Test Against JDK 21 (#10193)
Bumping CI to Test Against JDK 21. This is part of the setup to use a robolectric version that supports SDK 36. This new robolectric version requires JDK 21 at minimum. Edit: On JDK 21+ an error is thrown for this-escape warning due to: https://bugs.openjdk.org/browse/JDK-8015831. Addressing the warning requires removing the abstract funciton `createExoPlayerEventListener` in base class `VideoPlayer.java`, which could cause unknown regressions. Keeping the behavior as-is since the plugin works as expected. Addresses flutter/flutter#163071 Addresses flutter/flutter#177674 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 7063d75 commit 0aa4d9d

File tree

21 files changed

+42
-33
lines changed

21 files changed

+42
-33
lines changed

.ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ platform_properties:
2929
dependencies: >-
3030
[
3131
{"dependency": "android_sdk", "version": "version:36v3"},
32-
{"dependency": "open_jdk", "version": "version:17"},
32+
{"dependency": "open_jdk", "version": "version:21"},
3333
{"dependency": "curl", "version": "version:7.64.0"},
3434
{"dependency": "avd_cipd_version", "version": "build_id:8719362231152674241"},
3535
{"dependency": "ninja", "version": "version:1.9.0"}
@@ -129,7 +129,7 @@ targets:
129129
dependencies: >-
130130
[
131131
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
132-
{"dependency": "open_jdk", "version": "version:17"}
132+
{"dependency": "open_jdk", "version": "version:21"}
133133
]
134134
env_variables: >-
135135
{

packages/camera/camera_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.10.10+12
2+
3+
* Removed mockito-inline and updated to mockito-core 5.17.0.
4+
15
## 0.10.10+11
26

37
* Updates examples to use the new RadioGroup API instead of deprecated Radio parameters.

packages/camera/camera_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ buildFeatures {
6868
dependencies {
6969
implementation("androidx.annotation:annotation:1.9.1")
7070
testImplementation("junit:junit:4.13.2")
71-
testImplementation("org.mockito:mockito-inline:5.2.0")
71+
testImplementation("org.mockito:mockito-core:5.17.0")
7272
testImplementation("androidx.test:core:1.7.0")
7373
testImplementation("org.robolectric:robolectric:4.15.1")
7474
}

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void setValue(@NonNull ResolutionPreset value) {
112112
}
113113

114114
@Override
115-
public boolean checkIsSupported() {
115+
public final boolean checkIsSupported() {
116116
return cameraId >= 0;
117117
}
118118

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/sensororientation/SensorOrientationFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Integer getValue() {
5858
}
5959

6060
@Override
61-
public void setValue(@NonNull Integer value) {
61+
public final void setValue(@NonNull Integer value) {
6262
this.currentSetting = value;
6363
}
6464

packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/ImageSaverTests.java

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import org.junit.Before;
2323
import org.junit.Test;
2424
import org.mockito.MockedStatic;
25-
import org.mockito.invocation.InvocationOnMock;
26-
import org.mockito.stubbing.Answer;
2725

2826
public class ImageSaverTests {
2927

@@ -32,7 +30,7 @@ public class ImageSaverTests {
3230
ImageSaver.Callback mockCallback;
3331
ImageSaver imageSaver;
3432
Image.Plane mockPlane;
35-
ByteBuffer mockBuffer;
33+
ByteBuffer byteBuffer;
3634
MockedStatic<ImageSaver.FileOutputStreamFactory> mockFileOutputStreamFactory;
3735
FileOutputStream mockFileOutputStream;
3836

@@ -42,24 +40,12 @@ public void setup() {
4240
mockFile = mock(File.class);
4341
when(mockFile.getAbsolutePath()).thenReturn("absolute/path");
4442
mockPlane = mock(Image.Plane.class);
45-
mockBuffer = mock(ByteBuffer.class);
46-
when(mockBuffer.remaining()).thenReturn(3);
47-
when(mockBuffer.get(any()))
48-
.thenAnswer(
49-
new Answer<Object>() {
50-
@Override
51-
public Object answer(InvocationOnMock invocation) throws Throwable {
52-
byte[] bytes = invocation.getArgument(0);
53-
bytes[0] = 0x42;
54-
bytes[1] = 0x00;
55-
bytes[2] = 0x13;
56-
return mockBuffer;
57-
}
58-
});
43+
byte[] testData = {0x42, 0x00, 0x13};
44+
byteBuffer = ByteBuffer.wrap(testData);
5945

6046
// Set up mocked image dependency
6147
mockImage = mock(Image.class);
62-
when(mockPlane.getBuffer()).thenReturn(mockBuffer);
48+
when(mockPlane.getBuffer()).thenReturn(byteBuffer);
6349
when(mockImage.getPlanes()).thenReturn(new Image.Plane[] {mockPlane});
6450

6551
// Set up mocked FileOutputStream

packages/camera/camera_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
55

6-
version: 0.10.10+11
6+
version: 0.10.10+12
77

88
environment:
99
sdk: ^3.9.0

packages/file_selector/file_selector_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.2+2
2+
3+
* Removed mockito-inline and updated to mockito-core 5.17.0.
4+
15
## 0.5.2+1
26

37
* Resolves Gradle 9 deprecations.

packages/file_selector/file_selector_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ android {
3737
dependencies {
3838
implementation("androidx.annotation:annotation:1.9.1")
3939
testImplementation("junit:junit:4.13.2")
40-
testImplementation("org.mockito:mockito-inline:5.2.0")
40+
testImplementation("org.mockito:mockito-core:5.17.0")
4141
testImplementation("androidx.test:core:1.7.0")
4242
testImplementation("org.robolectric:robolectric:4.15.1")
4343
}

packages/file_selector/file_selector_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: file_selector_android
22
description: Android implementation of the file_selector package.
33
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
5-
version: 0.5.2+1
5+
version: 0.5.2+2
66

77
environment:
88
sdk: ^3.9.0

0 commit comments

Comments
 (0)