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

Commit 4c4300c7 authored by Wu-cheng Li's avatar Wu-cheng Li
Browse files

Add Camera.getSupportedThumbnailSizes() and Size.equals().

bug:2375986
parent 4bc1772c
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -70360,6 +70360,17 @@
 visibility="public"
>
</method>
<method name="getSupportedJpegThumbnailSizes"
 return="java.util.List&lt;android.hardware.Camera.Size&gt;"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getSupportedPictureFormats"
 return="java.util.List&lt;java.lang.Integer&gt;"
 abstract="false"
@@ -340828,7 +340839,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="f" type="java.io.File">
<parameter name="uri" type="java.lang.String">
</parameter>
<exception name="IOException" type="java.io.IOException">
</exception>
@@ -340845,7 +340856,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="uri" type="java.lang.String">
<parameter name="f" type="java.io.File">
</parameter>
<exception name="IOException" type="java.io.IOException">
</exception>
+35 −1
Original line number Diff line number Diff line
@@ -658,6 +658,25 @@ public class Camera {
            width = w;
            height = h;
        }
        /**
         * Compares {@code obj} to this size.
         *
         * @param obj the object to compare this size with.
         * @return {@code true} if the width and height of {@code obj} is the
         *         same as those of this size. {@code false} otherwise.
         */
        @Override
        public boolean equals(Object obj) {
            if (!(obj instanceof Size)) {
                return false;
            }
            Size s = (Size) obj;
            return width == s.width && height == s.height;
        }
        @Override
        public int hashCode() {
            return width * 32713 + height;
        }
        /** width of the picture */
        public int width;
        /** height of the picture */
@@ -685,6 +704,7 @@ public class Camera {
        private static final String KEY_PREVIEW_FRAME_RATE = "preview-frame-rate";
        private static final String KEY_PICTURE_SIZE = "picture-size";
        private static final String KEY_PICTURE_FORMAT = "picture-format";
        private static final String KEY_JPEG_THUMBNAIL_SIZE = "jpeg-thumbnail-size";
        private static final String KEY_JPEG_THUMBNAIL_WIDTH = "jpeg-thumbnail-width";
        private static final String KEY_JPEG_THUMBNAIL_HEIGHT = "jpeg-thumbnail-height";
        private static final String KEY_JPEG_THUMBNAIL_QUALITY = "jpeg-thumbnail-quality";
@@ -954,7 +974,9 @@ public class Camera {
        }

        /**
         * Sets the dimensions for EXIF thumbnail in Jpeg picture.
         * Sets the dimensions for EXIF thumbnail in Jpeg picture. If
         * applications set both width and height to 0, EXIF will not contain
         * thumbnail.
         *
         * @param width  the width of the thumbnail, in pixels
         * @param height the height of the thumbnail, in pixels
@@ -975,6 +997,18 @@ public class Camera {
                            getInt(KEY_JPEG_THUMBNAIL_HEIGHT));
        }

        /**
         * Gets the supported jpeg thumbnail sizes.
         *
         * @return a List of Size object. This method will always return a list
         *         with at least two elements. Size 0,0 (no thumbnail) is always
         *         supported.
         */
        public List<Size> getSupportedJpegThumbnailSizes() {
            String str = get(KEY_JPEG_THUMBNAIL_SIZE + SUPPORTED_VALUES_SUFFIX);
            return splitSize(str);
        }

        /**
         * Sets the quality of the EXIF thumbnail in Jpeg picture.
         *