diff options
author | Lucas Dupin <dupin@google.com> | 2018-12-26 10:15:51 -0800 |
---|---|---|
committer | Lucas Dupin <dupin@google.com> | 2018-12-26 10:15:51 -0800 |
commit | 2955bf1ec03c3bc532f1525b5b4069bd7e5abce4 (patch) | |
tree | a5ba740c4ed0050353916765f18e5be2abb65174 /packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | |
parent | 89e8be4121e09a60aa8adc7d74fb9236e5aec064 (diff) |
Fix issue where media icon cannot be loaded
Change-Id: Ie429cbb3e03674522bdc465cc630f44f12073983
Fixes: 121457418
Test: manual
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index 576660431d82..669e6fff525b 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -208,9 +208,11 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe android.app.slice.SliceItem.FORMAT_IMAGE); if (icon != null) { iconDrawable = icon.getIcon().loadDrawable(mContext); - final int width = (int) (iconDrawable.getIntrinsicWidth() - / (float) iconDrawable.getIntrinsicHeight() * mIconSize); - iconDrawable.setBounds(0, 0, Math.max(width, 1), mIconSize); + if (iconDrawable != null) { + final int width = (int) (iconDrawable.getIntrinsicWidth() + / (float) iconDrawable.getIntrinsicHeight() * mIconSize); + iconDrawable.setBounds(0, 0, Math.max(width, 1), mIconSize); + } } button.setCompoundDrawables(iconDrawable, null, null, null); button.setOnClickListener(this); |