Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ platform_properties:
dependencies: >-
[
{"dependency": "android_sdk", "version": "version:36v3"},
{"dependency": "open_jdk", "version": "version:17"},
{"dependency": "open_jdk", "version": "version:21"},
{"dependency": "curl", "version": "version:7.64.0"},
{"dependency": "avd_cipd_version", "version": "build_id:8719362231152674241"}
]
Expand Down Expand Up @@ -127,7 +127,7 @@ targets:
dependencies: >-
[
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
{"dependency": "open_jdk", "version": "version:17"}
{"dependency": "open_jdk", "version": "version:21"}
]
env_variables: >-
{
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ buildFeatures {
dependencies {
implementation("androidx.annotation:annotation:1.9.1")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-inline:5.2.0")
testImplementation("org.mockito:mockito-core:5.17.0")
testImplementation("androidx.test:core:1.7.0")
testImplementation("org.robolectric:robolectric:4.15.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void setValue(@NonNull ResolutionPreset value) {
}

@Override
public boolean checkIsSupported() {
public final boolean checkIsSupported() {
return cameraId >= 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Integer getValue() {
}

@Override
public void setValue(@NonNull Integer value) {
public final void setValue(@NonNull Integer value) {
this.currentSetting = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.MockedStatic;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

public class ImageSaverTests {

Expand All @@ -32,7 +30,7 @@ public class ImageSaverTests {
ImageSaver.Callback mockCallback;
ImageSaver imageSaver;
Image.Plane mockPlane;
ByteBuffer mockBuffer;
ByteBuffer byteBuffer;
MockedStatic<ImageSaver.FileOutputStreamFactory> mockFileOutputStreamFactory;
FileOutputStream mockFileOutputStream;

Expand All @@ -42,24 +40,12 @@ public void setup() {
mockFile = mock(File.class);
when(mockFile.getAbsolutePath()).thenReturn("absolute/path");
mockPlane = mock(Image.Plane.class);
mockBuffer = mock(ByteBuffer.class);
when(mockBuffer.remaining()).thenReturn(3);
when(mockBuffer.get(any()))
.thenAnswer(
new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
byte[] bytes = invocation.getArgument(0);
bytes[0] = 0x42;
bytes[1] = 0x00;
bytes[2] = 0x13;
return mockBuffer;
}
});
byte[] desiredContent = {0x42, 0x00, 0x13};
byteBuffer = ByteBuffer.wrap(desiredContent);

// Set up mocked image dependency
mockImage = mock(Image.class);
when(mockPlane.getBuffer()).thenReturn(mockBuffer);
when(mockPlane.getBuffer()).thenReturn(byteBuffer);
when(mockImage.getPlanes()).thenReturn(new Image.Plane[] {mockPlane});

// Set up mocked FileOutputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ dependencies {
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.1")
implementation("com.google.android.gms:play-services-auth:21.4.0")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-inline:5.2.0")
testImplementation("org.mockito:mockito-core:5.17.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {
api("androidx.biometric:biometric:1.1.0")
api("androidx.fragment:fragment:1.8.9")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-inline:5.2.0")
testImplementation("org.mockito:mockito-core:5.17.0")
testImplementation("org.robolectric:robolectric:4.15.1")
androidTestImplementation("androidx.test:runner:1.7.0")
androidTestImplementation("androidx.test:rules:1.7.0")
Expand Down