From 24e028e0ec533cb7304296118a73bdc03870d10d Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Tue, 13 Aug 2013 20:18:01 -0700 Subject: [PATCH] Defend against NPE. During SystemUI startup, populating accessibility for other views can race with attaching SignalClusterView to its parent. Bug: 9999664 Change-Id: Iba34a3edba403ae65ff3c37b953d0736068a67b9 --- .../src/com/android/systemui/statusbar/SignalClusterView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index f17b143e343d7..ff84243c69f54 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -135,9 +135,9 @@ public class SignalClusterView public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { // Standard group layout onPopulateAccessibilityEvent() implementations // ignore content description, so populate manually - if (mWifiVisible && mWifiGroup.getContentDescription() != null) + if (mWifiVisible && mWifiGroup != null && mWifiGroup.getContentDescription() != null) event.getText().add(mWifiGroup.getContentDescription()); - if (mMobileVisible && mMobileGroup.getContentDescription() != null) + if (mMobileVisible && mMobileGroup != null && mMobileGroup.getContentDescription() != null) event.getText().add(mMobileGroup.getContentDescription()); return super.dispatchPopulateAccessibilityEvent(event); }