diff options
-rw-r--r-- | core/java/android/companion/virtual/camera/VirtualCameraConfig.java | 12 | ||||
-rw-r--r-- | core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java | 5 |
2 files changed, 4 insertions, 13 deletions
diff --git a/core/java/android/companion/virtual/camera/VirtualCameraConfig.java b/core/java/android/companion/virtual/camera/VirtualCameraConfig.java index 06a0f5c09e18..769b658c78ce 100644 --- a/core/java/android/companion/virtual/camera/VirtualCameraConfig.java +++ b/core/java/android/companion/virtual/camera/VirtualCameraConfig.java @@ -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( diff --git a/core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java b/core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java index 00a814e7a02e..6ab66b3d2309 100644 --- a/core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java +++ b/core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java @@ -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; |