From 2f7dfa7afdaada78c46bd6fd7e307656ba3dd66a Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Wed, 16 May 2012 20:20:59 -0400 Subject: [PATCH] Status Bar: Include wifi/mobile state in touch exploration Bug: 5325056 Change-Id: Iefbd734344d3b70d3e0ebf6f0dffa55d89a054c7 --- .../systemui/statusbar/SignalClusterView.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 2f02d237078eb..1321adeafd0f1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -21,9 +21,9 @@ import android.util.AttributeSet; import android.util.Slog; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.TextView; import com.android.systemui.statusbar.policy.NetworkController; @@ -31,12 +31,12 @@ import com.android.systemui.R; // Intimately tied to the design of res/layout/signal_cluster_view.xml public class SignalClusterView - extends LinearLayout + extends LinearLayout implements NetworkController.SignalCluster { static final boolean DEBUG = false; static final String TAG = "SignalClusterView"; - + NetworkController mNC; private boolean mWifiVisible = false; @@ -132,6 +132,17 @@ public class SignalClusterView apply(); } + @Override + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { + // Standard group layout onPopulateAccessibilityEvent() implementations + // ignore content description, so populate manually + if (mWifiVisible && mWifiGroup.getContentDescription() != null) + event.getText().add(mWifiGroup.getContentDescription()); + if (mMobileVisible && mMobileGroup.getContentDescription() != null) + event.getText().add(mMobileGroup.getContentDescription()); + return super.dispatchPopulateAccessibilityEvent(event); + } + // Run after each indicator change. private void apply() { if (mWifiGroup == null) return;