|
21 | 21 | import android.util.Slog; |
22 | 22 | import android.view.View; |
23 | 23 | import android.view.ViewGroup; |
| 24 | +import android.view.accessibility.AccessibilityEvent; |
24 | 25 | import android.widget.ImageView; |
25 | 26 | import android.widget.LinearLayout; |
26 | | -import android.widget.TextView; |
27 | 27 |
|
28 | 28 | import com.android.systemui.statusbar.policy.NetworkController; |
29 | 29 |
|
30 | 30 | import com.android.systemui.R; |
31 | 31 |
|
32 | 32 | // Intimately tied to the design of res/layout/signal_cluster_view.xml |
33 | 33 | public class SignalClusterView |
34 | | - extends LinearLayout |
| 34 | + extends LinearLayout |
35 | 35 | implements NetworkController.SignalCluster { |
36 | 36 |
|
37 | 37 | static final boolean DEBUG = false; |
38 | 38 | static final String TAG = "SignalClusterView"; |
39 | | - |
| 39 | + |
40 | 40 | NetworkController mNC; |
41 | 41 |
|
42 | 42 | private boolean mWifiVisible = false; |
@@ -132,6 +132,17 @@ public void setIsAirplaneMode(boolean is, int airplaneIconId) { |
132 | 132 | apply(); |
133 | 133 | } |
134 | 134 |
|
| 135 | + @Override |
| 136 | + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { |
| 137 | + // Standard group layout onPopulateAccessibilityEvent() implementations |
| 138 | + // ignore content description, so populate manually |
| 139 | + if (mWifiVisible && mWifiGroup.getContentDescription() != null) |
| 140 | + event.getText().add(mWifiGroup.getContentDescription()); |
| 141 | + if (mMobileVisible && mMobileGroup.getContentDescription() != null) |
| 142 | + event.getText().add(mMobileGroup.getContentDescription()); |
| 143 | + return super.dispatchPopulateAccessibilityEvent(event); |
| 144 | + } |
| 145 | + |
135 | 146 | // Run after each indicator change. |
136 | 147 | private void apply() { |
137 | 148 | if (mWifiGroup == null) return; |
|
0 commit comments