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

Commit bab2a83b authored by Adrian Roos's avatar Adrian Roos Committed by Joey Rizzoli
Browse files

StatusBar: Catch OOM caused by third-party icons

Bug: 31825355
Change-Id: I3e2a8c3da43a572a026ea0bbe1d39234035a4801
Merged-In: I3e2a8c3da43a572a026ea0bbe1d39234035a4801
parent f3c85977
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -211,9 +211,16 @@ public class StatusBarIconView extends AnimatedImageView {
        if (mIcon == null) {
            return false;
        }
        Drawable drawable = getIcon(mIcon);
        Drawable drawable;
        try {
            drawable = getIcon(mIcon);
        } catch (OutOfMemoryError e) {
            Log.w(TAG, "OOM while inflating " + mIcon.icon + " for slot " + mSlot);
            return false;
        }

        if (drawable == null) {
            Log.w(TAG, "No icon for slot " + mSlot);
            Log.w(TAG, "No icon for slot " + mSlot + "; " + mIcon.icon);
            return false;
        }
        if (withClear) {