From e04ccb5260a6303f0997944e0d4803b1ae1f51d3 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 5 Feb 2021 12:00:22 -0800 Subject: [PATCH] Remove unncessary attachedToWindow check It was preventing icons from updating correctly bug: 168620505 Test: Repro steps in bug no longer repro Change-Id: I4f32dbd571b48f2e94aaff2a8be5f7e603407dba --- .../systemui/navigationbar/buttons/ContextualButton.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/ContextualButton.java b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/ContextualButton.java index 453e85ae25c76..517f8e7f0dac2 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/ContextualButton.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/ContextualButton.java @@ -51,7 +51,7 @@ public class ContextualButton extends ButtonDispatcher { * Reload the drawable from resource id, should reapply the previous dark intensity. */ public void updateIcon(int lightIconColor, int darkIconColor) { - if (getCurrentView() == null || !getCurrentView().isAttachedToWindow() || mIconResId == 0) { + if (mIconResId == 0) { return; } final KeyButtonDrawable currentDrawable = getImageDrawable();