Merge "Camera: Fix condition check for min/max zoom ratios" into rvc-dev am: 72a3d44773 am: ec138e6171
Change-Id: I2a6fcf7f40596cde52db13fa0373980a22b3f876
This commit is contained in:
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package android.hardware.camera2.params;
|
package android.hardware.camera2.params;
|
||||||
|
|
||||||
import static com.android.internal.util.Preconditions.checkArgumentInRange;
|
|
||||||
import static com.android.internal.util.Preconditions.checkArgumentNonnegative;
|
import static com.android.internal.util.Preconditions.checkArgumentNonnegative;
|
||||||
|
import static com.android.internal.util.Preconditions.checkArgumentPositive;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.hardware.camera2.CameraCharacteristics;
|
import android.hardware.camera2.CameraCharacteristics;
|
||||||
@@ -64,9 +64,15 @@ public final class Capability {
|
|||||||
"maxStreamingWidth must be nonnegative");
|
"maxStreamingWidth must be nonnegative");
|
||||||
mMaxStreamingHeight = checkArgumentNonnegative(maxStreamingHeight,
|
mMaxStreamingHeight = checkArgumentNonnegative(maxStreamingHeight,
|
||||||
"maxStreamingHeight must be nonnegative");
|
"maxStreamingHeight must be nonnegative");
|
||||||
mMinZoomRatio = checkArgumentInRange(minZoomRatio, 0.0f, 1.0f,
|
|
||||||
"minZoomRatio must be between 0.0f and 1.0f");
|
if (minZoomRatio > maxZoomRatio) {
|
||||||
mMaxZoomRatio = maxZoomRatio;
|
throw new IllegalArgumentException("minZoomRatio " + minZoomRatio
|
||||||
|
+ " is greater than maxZoomRatio " + maxZoomRatio);
|
||||||
|
}
|
||||||
|
mMinZoomRatio = checkArgumentPositive(minZoomRatio,
|
||||||
|
"minZoomRatio must be positive");
|
||||||
|
mMaxZoomRatio = checkArgumentPositive(maxZoomRatio,
|
||||||
|
"maxZoomRatio must be positive");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user