From 2dbe166801c531474ce566f804660b58edab1bef Mon Sep 17 00:00:00 2001 From: Sungsoo Date: Thu, 13 Oct 2016 12:57:44 +0900 Subject: [PATCH] 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 --- media/java/android/media/ExifInterface.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java index 5e00dc1a4fa3..6f24f763d6a6 100644 --- a/media/java/android/media/ExifInterface.java +++ b/media/java/android/media/ExifInterface.java @@ -1557,16 +1557,13 @@ public class ExifInterface { *

* This method is only supported for JPEG files. *

- * - * @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."); } -- 2.11.0