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

Commit 6419ebff authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Leon Scroggins
Browse files

Fix .equals call in ImageDecoder

Bug: 154954875
Bug: 143231863
Test: I93b01cb60a8c76110ea2ff4250d0048512629d8d

I9229039b752bafa9a9b85b914a62093dff1eec34 switched from "==" to
".equals", but it did not take into account that Uri#getScheme() can
return null. Switch around the .equals check so that it is called on
SCHEME_CONTENT, which will never be null.

Change-Id: I0df5d2407a32fad0e21e597697af293fbc2fb315
Merged-In: I0df5d2407a32fad0e21e597697af293fbc2fb315
parent 3b8aa159
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ public final class ImageDecoder implements AutoCloseable {
        public ImageDecoder createImageDecoder(boolean preferAnimation) throws IOException {
            AssetFileDescriptor assetFd = null;
            try {
                if (mUri.getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
                if (ContentResolver.SCHEME_CONTENT.equals(mUri.getScheme())) {
                    assetFd = mResolver.openTypedAssetFileDescriptor(mUri,
                            "image/*", null);
                } else {