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

Commit 6f02de08 authored by Junyeong Bak's avatar Junyeong Bak Committed by Tyler Gunn
Browse files

Handle potential IllegalArgumentException in Telecom



The Icon API can potentially throw an IllegalArgumentException in some cases.
Adding catch blocks to ensure they don't crash Telecom.

Test: Manual
Fixes: 151575635

Signed-off-by: default avatarJunyeong Bak <junyeong.bak@samsung.com>
Change-Id: Ia41032df7a013eb5ea7de4aa0a8cfe9031143365
parent 1c7fe33a
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1599,10 +1599,16 @@ public class PhoneAccountRegistrar {
            return BitmapFactory.decodeByteArray(imageByteArray, 0, imageByteArray.length);
        }

        @Nullable
        protected Icon readIcon(XmlPullParser parser) throws IOException {
            try {
                byte[] iconByteArray = Base64.decode(parser.getText(), 0);
                ByteArrayInputStream stream = new ByteArrayInputStream(iconByteArray);
                return Icon.createFromStream(stream);
            } catch (IllegalArgumentException e) {
                Log.e(this, e, "Bitmap must not be null.");
                return null;
            }
        }
    }