Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28a954aa authored by Biswarup Pal's avatar Biswarup Pal
Browse files

Remove VirtualCameraStreamConfig size upper bound check from java

Test: atest VirtualCameraConfigTest
Bug: 291736219
Change-Id: I433b898668e441f8519997bd25e4c5b9439885db
parent 0e75605d
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -237,19 +237,15 @@ public final class VirtualCameraConfig implements Parcelable {
                @IntRange(from = 1) int height,
                @ImageFormat.Format int format,
                @IntRange(from = 1) int maximumFramesPerSecond) {
            // TODO(b/310857519): Check dimension upper limits based on the maximum texture size
            // supported by the current device, instead of hardcoded limits.
            if (width <= 0 || width > VirtualCameraStreamConfig.DIMENSION_UPPER_LIMIT) {
            if (width <= 0) {
                throw new IllegalArgumentException(
                        "Invalid width passed for stream config: " + width
                                + ", must be between 1 and "
                                + VirtualCameraStreamConfig.DIMENSION_UPPER_LIMIT);
                                + ", must be greater than 0");
            }
            if (height <= 0 || height > VirtualCameraStreamConfig.DIMENSION_UPPER_LIMIT) {
            if (height <= 0) {
                throw new IllegalArgumentException(
                        "Invalid height passed for stream config: " + height
                                + ", must be between 1 and "
                                + VirtualCameraStreamConfig.DIMENSION_UPPER_LIMIT);
                                + ", must be greater than 0");
            }
            if (!isFormatSupported(format)) {
                throw new IllegalArgumentException(
+0 −5
Original line number Diff line number Diff line
@@ -39,11 +39,6 @@ import java.util.Objects;
public final class VirtualCameraStreamConfig implements Parcelable {
    // TODO(b/310857519): Check if we should increase the fps upper limit in future.
    static final int MAX_FPS_UPPER_LIMIT = 60;
    // This is the minimum guaranteed upper bound of texture size supported by all devices.
    // Keep this in sync with kMaxTextureSize from services/camera/virtualcamera/util/Util.cc
    // TODO(b/310857519): Remove this once we add support for fetching the maximum texture size
    // supported by the current device.
    static final int DIMENSION_UPPER_LIMIT = 2048;

    private final int mWidth;
    private final int mHeight;