summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Biswarup Pal <biswarupp@google.com> 2024-04-23 21:50:25 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-04-23 21:50:25 +0000
commit87fedd8e8e41a6620331ef99a78dff42c85efc16 (patch)
tree6781659315d57aed2722815b0bfd5995f277ef89
parent66799ad93f83896d15a7362ccd02cf0b99298f49 (diff)
parent28a954aa9c936cd22a99739d78bc4f1cf6ec5a1c (diff)
Merge "Remove VirtualCameraStreamConfig size upper bound check from java" into main
-rw-r--r--core/java/android/companion/virtual/camera/VirtualCameraConfig.java12
-rw-r--r--core/java/android/companion/virtual/camera/VirtualCameraStreamConfig.java5
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;