Merge "StatusBar: Catch OOM caused by third-party icons"
This commit is contained in:
@@ -188,9 +188,16 @@ public class StatusBarIconView extends AnimatedImageView {
|
|||||||
if (mIcon == null) {
|
if (mIcon == null) {
|
||||||
return false;
|
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) {
|
if (drawable == null) {
|
||||||
Log.w(TAG, "No icon for slot " + mSlot);
|
Log.w(TAG, "No icon for slot " + mSlot + "; " + mIcon.icon);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (withClear) {
|
if (withClear) {
|
||||||
|
|||||||
Reference in New Issue
Block a user