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

Commit 2dbe1668 authored by Sungsoo's avatar Sungsoo
Browse files

ExifInterface: Provide backward compatibility

ExifInterface.saveAttribute() didn't throw UnsupportedOperationException
before. Use IOException instead of UnsupportedOperationException for
backward compatibility.

Bug: 30936376, Bug: 32068647, Bug: 31319086
Change-Id: Ifb478db3af820eb846c5373d3a284367da3495a0
parent 2acaf0a1
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1557,16 +1557,13 @@ public class ExifInterface {
     * <p>
     * This method is only supported for JPEG files.
     * </p>
     *
     * @throws UnsupportedOperationException If this method is called with unsupported files.
     */
    public void saveAttributes() throws IOException {
        if (!mIsSupportedFile || mIsRaw) {
            throw new UnsupportedOperationException(
                    "ExifInterface only supports saving attributes on JPEG formats.");
            throw new IOException("ExifInterface only supports saving attributes on JPEG formats.");
        }
        if (mIsInputStream || (mSeekableFileDescriptor == null && mFilename == null)) {
            throw new UnsupportedOperationException(
            throw new IOException(
                    "ExifInterface does not support saving attributes for the current input.");
        }