From 7cdf920187dc34f0b710fa07319456eb0c137b09 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Mon, 14 Sep 2020 16:55:04 -0700 Subject: [PATCH] Check for null when getting PiP action item drawables. Upon loading the action item drawables, it's possible they end up returned as null. Bug: 167338598 Test: None Merged-In: Iff2b7d499cee275294075a37a4970dc2dbc97401 Change-Id: Iff2b7d499cee275294075a37a4970dc2dbc97401 (cherry picked from commit e09e8e8a182a9795dbbad78c41e1aea2be387425) --- .../src/com/android/systemui/pip/phone/PipMenuActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 2a83aa06a2378..586399c6dfd56 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -562,8 +562,10 @@ public class PipMenuActivity extends Activity { // TODO: Check if the action drawable has changed before we reload it action.getIcon().loadDrawableAsync(this, d -> { - d.setTint(Color.WHITE); - actionView.setImageDrawable(d); + if (d != null) { + d.setTint(Color.WHITE); + actionView.setImageDrawable(d); + } }, mHandler); actionView.setContentDescription(action.getContentDescription()); if (action.isEnabled()) {