summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungsoo <sungsoo@google.com>2016-10-13 12:57:44 +0900
committerThe Android Automerger <android-build@android.com>2016-10-27 15:27:09 -0700
commita7179cdac15c1cd67652f5c32bb6be055ec4f78c (patch)
tree1f65578c02291a1b77a91007fe08f38b878c542d
parent4744ea74cdd52b691abf781b349203006ce107d8 (diff)
downloadbase-android-7.0.0_r24.tar.gz
ExifInterface: Provide backward compatibilityandroid-7.0.0_r24
Resolve merge conflict into nyc-release ExifInterface.saveAttribute() didn't throw UnsupportedOperationException before. Use IOException instead of UnsupportedOperationException for backward compatibility. Bug: 30936376, Bug: 32068647, Bug: 31319086 Change-Id: Ifb478db3af820eb846c5373d3a284367da3495a0 (cherry picked from commit 5a7bd1b9f09ed0b67b0807e12cf4b1e477af5f90) (cherry picked from commit 965e4f239208617cd9f202a82fee17188719369d)
-rw-r--r--media/java/android/media/ExifInterface.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 56af57aa8e96..6f24f763d6a6 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -1554,14 +1554,16 @@ public class ExifInterface {
* copying all the data from one file to another and deleting the old file and renaming the
* other. It's best to use {@link #setAttribute(String,String)} to set all attributes to write
* and make a single call rather than multiple calls for each attribute.
+ * <p>
+ * This method is only supported for JPEG files.
+ * </p>
*/
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.");
}