Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for ImageReader#nativeImageSetup signature change in SDKs > T. #8040

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.robolectric.shadows;

import static android.os.Build.VERSION_CODES.CUR_DEVELOPMENT;
import static android.os.Build.VERSION_CODES.KITKAT;
import static android.os.Build.VERSION_CODES.S_V2;
import static android.os.Build.VERSION_CODES.TIRAMISU;
Expand All @@ -26,7 +27,7 @@
import org.robolectric.util.reflector.ForType;

/** Shadow for {@link android.media.ImageReader} */
@Implements(ImageReader.class)
@Implements(value = ImageReader.class, looseSignatures = true)
public class ShadowImageReader {
// Using same return codes as ImageReader.
private static final int ACQUIRE_SUCCESS = 0;
Expand Down Expand Up @@ -64,11 +65,16 @@ protected int nativeImageSetup(Image image) {
return ACQUIRE_SUCCESS;
}

@Implementation(minSdk = TIRAMISU)
@Implementation(minSdk = TIRAMISU, maxSdk = TIRAMISU)
protected int nativeImageSetup(Image image, boolean useLegacyImageFormat) {
return nativeImageSetup(image);
}

@Implementation(minSdk = CUR_DEVELOPMENT)
protected int nativeImageSetup(Object /* Image */ image) {
return nativeImageSetup((Image) image);
}

@Implementation(minSdk = KITKAT)
protected void nativeReleaseImage(Image i) {
openedImages.remove(i);
Expand Down