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

Commit ef896948 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Fix condition check for min/max zoom ratios" into rvc-dev am:...

Merge "Camera: Fix condition check for min/max zoom ratios" into rvc-dev am: 72a3d447 am: ec138e61 am: c46e770e

Change-Id: I4bbf315dda36ed2a735881d2aa3322d0a7fe7906
parents b9fc016a c46e770e
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -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");
    }
    }


    /**
    /**