Loading core/java/android/companion/virtual/camera/VirtualCameraConfig.java +4 −8 Original line number Diff line number Diff line Loading @@ -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( Loading core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java +0 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
core/java/android/companion/virtual/camera/VirtualCameraConfig.java +4 −8 Original line number Diff line number Diff line Loading @@ -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( Loading
core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java +0 −5 Original line number Diff line number Diff line Loading @@ -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; Loading