diff options
author | Leon Scroggins III <scroggo@google.com> | 2019-11-19 13:53:29 -0500 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2019-11-19 13:53:29 -0500 |
commit | 637efbaa0a75c72461b325f3648ab4dababad0bb (patch) | |
tree | 238a5d6ba546d6e2b6c30000553f5bf8f5181e00 | |
parent | 2e82e39c56aa9b0f24af74fe27933de9f95c44a0 (diff) |
ImageDecoder: compare Strings with .equals()
Bug: 143231863
Test: Infeasible?
Previously we compared with "==", which requires that the two String
objects be the same to return true. We want to return true if the two
Strings are logically equal, even if they are different objects.
Prior to this commit, we may have accidentally called
openAssetFileDescriptor when we should have called
openTypedAssetFileDescriptor.
Change-Id: I9229039b752bafa9a9b85b914a62093dff1eec34
-rw-r--r-- | graphics/java/android/graphics/ImageDecoder.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java index 6619dba159c2..aaaa7491f2ef 100644 --- a/graphics/java/android/graphics/ImageDecoder.java +++ b/graphics/java/android/graphics/ImageDecoder.java @@ -270,7 +270,7 @@ public final class ImageDecoder implements AutoCloseable { public ImageDecoder createImageDecoder(boolean preferAnimation) throws IOException { AssetFileDescriptor assetFd = null; try { - if (mUri.getScheme() == ContentResolver.SCHEME_CONTENT) { + if (mUri.getScheme().equals(ContentResolver.SCHEME_CONTENT)) { assetFd = mResolver.openTypedAssetFileDescriptor(mUri, "image/*", null); } else { |