From 0e87f757ca4c4275ca8a8c4f33232884beba1a92 Mon Sep 17 00:00:00 2001 From: yinxu Date: Thu, 21 Jan 2021 13:47:11 -0800 Subject: [PATCH] Check whether qsIcon is null before using it Bug: 176428921 Test: Unit Tests, Manual Tests Change-Id: Ic76e9ad4237b1a5bf71d1ee9801c91d0f3b6e476 --- .../SystemUI/src/com/android/systemui/qs/tiles/CastTile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java index a6c3221354edd..1dddc452ec1d9 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java @@ -274,7 +274,8 @@ public class CastTile extends QSTileImpl { NetworkController.IconState qsIcon, boolean activityIn, boolean activityOut, String description, boolean isTransient, String statusLabel) { // statusIcon.visible has the connected status information - boolean enabledAndConnected = enabled && qsIcon.visible; + boolean enabledAndConnected = + enabled && (qsIcon == null ? false : qsIcon.visible); if (enabledAndConnected != mWifiConnected) { mWifiConnected = enabledAndConnected; // Hotspot is not connected, so changes here should update