Defend against NPE.
During SystemUI startup, populating accessibility for other
views can race with attaching SignalClusterView to its parent.
Bug: 9999664
Change-Id: Iba34a3edba403ae65ff3c37b953d0736068a67b9
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index f17b143e..ff84243 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 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);
}