Merge "StatusBar: Catch OOM caused by third-party icons" am: ed112e3c11

am: 7135f5d2e5

Change-Id: I2b807be9ff69796ccc3dde64fb215250d9690717
This commit is contained in:
Adrian Roos
2017-05-02 21:14:20 +00:00
committed by android-build-merger

View File

@@ -188,9 +188,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) {