Skip to content

Commit bcf6ef0

Browse files
committed
Fix contentDescriptions in status bar.
- Strings for signal strength - Strings for the clear-all-notifications button - Adjust phrasing for the clear-one-notification button - Adjust phrasing for the settings button Bug: 5285136 Bug: 5325056 Change-Id: I489e49f3b3d88a6b599ababe68d0535302eb0ae2
1 parent 83a5926 commit bcf6ef0

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed

packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
android:paddingRight="15dp"
3535
android:src="@drawable/ic_notify_clear"
3636
android:visibility="invisible"
37+
android:contentDescription="@string/accessibility_clear_all"
3738
/>
3839

3940
<RelativeLayout

packages/SystemUI/res/layout/status_bar_expanded.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
android:paddingLeft="8dp"
6666
android:paddingRight="8dp"
6767
android:src="@drawable/ic_notify_quicksettings"
68+
android:contentDescription="@string/accessibility_settings_button"
6869
/>
6970

7071
<ImageView android:id="@+id/clear_all_button"
@@ -74,6 +75,7 @@
7475
android:paddingLeft="8dp"
7576
android:paddingRight="8dp"
7677
android:src="@drawable/ic_notify_clear"
78+
android:contentDescription="@string/accessibility_clear_all"
7779
/>
7880
</RelativeLayout>
7981

packages/SystemUI/res/values/strings.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@
280280
<string name="accessibility_battery_level">Battery <xliff:g id="number">%d</xliff:g> percent.</string>
281281

282282
<!-- Content description of the button for showing a settings panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
283-
<string name="accessibility_settings_button">Settings button.</string>
283+
<string name="accessibility_settings_button">System settings.</string>
284284

285285
<!-- Content description of the button for showing a notifications panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
286-
<string name="accessibility_notifications_button">Notifications button.</string>
286+
<string name="accessibility_notifications_button">Notifications.</string>
287287

288288
<!-- Content description of the button for removing a notification in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
289-
<string name="accessibility_remove_notification">Remove notification.</string>
289+
<string name="accessibility_remove_notification">Clear notification.</string>
290290

291291
<!-- Content description of the enabled GPS icon in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
292292
<string name="accessibility_gps_enabled">GPS enabled.</string>
@@ -334,4 +334,6 @@
334334
<!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] -->
335335
<string name="gps_notification_found_text">Location set by GPS</string>
336336

337+
<!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
338+
<string name="accessibility_clear_all">Clear all notifications.</string>
337339
</resources>

packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class SignalClusterView
4444
private boolean mMobileVisible = false;
4545
private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0;
4646
private boolean mIsAirplaneMode = false;
47+
private String mWifiDescription, mMobileDescription, mMobileTypeDescription;
4748

4849
ViewGroup mWifiGroup, mMobileGroup;
4950
ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType;
@@ -95,20 +96,24 @@ protected void onDetachedFromWindow() {
9596
super.onDetachedFromWindow();
9697
}
9798

98-
public void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon) {
99+
public void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon,
100+
String contentDescription) {
99101
mWifiVisible = visible;
100102
mWifiStrengthId = strengthIcon;
101103
mWifiActivityId = activityIcon;
104+
mWifiDescription = contentDescription;
102105

103106
apply();
104107
}
105108

106109
public void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
107-
int typeIcon) {
110+
int typeIcon, String contentDescription, String typeContentDescription) {
108111
mMobileVisible = visible;
109112
mMobileStrengthId = strengthIcon;
110113
mMobileActivityId = activityIcon;
111114
mMobileTypeId = typeIcon;
115+
mMobileDescription = contentDescription;
116+
mMobileTypeDescription = typeContentDescription;
112117

113118
apply();
114119
}
@@ -125,6 +130,7 @@ private void apply() {
125130
mWifiGroup.setVisibility(View.VISIBLE);
126131
mWifi.setImageResource(mWifiStrengthId);
127132
mWifiActivity.setImageResource(mWifiActivityId);
133+
mWifiGroup.setContentDescription(mWifiDescription);
128134
} else {
129135
mWifiGroup.setVisibility(View.GONE);
130136
}
@@ -139,6 +145,7 @@ private void apply() {
139145
mMobile.setImageResource(mMobileStrengthId);
140146
mMobileActivity.setImageResource(mMobileActivityId);
141147
mMobileType.setImageResource(mMobileTypeId);
148+
mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription);
142149
} else {
143150
mMobileGroup.setVisibility(View.GONE);
144151
}

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ public class NetworkController extends BroadcastReceiver {
139139
IBatteryStats mBatteryStats;
140140

141141
public interface SignalCluster {
142-
void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon);
142+
void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon,
143+
String contentDescription);
143144
void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
144-
int typeIcon);
145+
int typeIcon, String contentDescription, String typeContentDescription);
145146
void setIsAirplaneMode(boolean is);
146147
}
147148

@@ -235,12 +236,16 @@ public void addSignalCluster(SignalCluster cluster) {
235236
cluster.setWifiIndicators(
236237
mWifiConnected, // only show wifi in the cluster if connected
237238
mWifiIconId,
238-
mWifiActivityIconId);
239+
mWifiActivityIconId,
240+
mContentDescriptionWifi);
239241
cluster.setMobileDataIndicators(
240242
mHasMobileDataFeature,
241243
mPhoneSignalIconId,
242244
mMobileActivityIconId,
243-
mDataTypeIconId);
245+
mDataTypeIconId,
246+
mContentDescriptionPhoneSignal,
247+
mContentDescriptionDataType);
248+
244249
}
245250

246251
public void setStackedMode(boolean stacked) {
@@ -806,8 +811,8 @@ void refreshViews() {
806811
(mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) {
807812
// Only display the flight-mode icon if not in "emergency calls only" mode.
808813
label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
809-
mContentDescriptionCombinedSignal = mContext.getString(
810-
R.string.accessibility_airplane_mode);
814+
mContentDescriptionCombinedSignal = mContentDescriptionPhoneSignal
815+
= mContext.getString(R.string.accessibility_airplane_mode);
811816

812817
// look again; your radios are now airplanes
813818
mPhoneSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
@@ -862,12 +867,15 @@ else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered) {
862867
cluster.setWifiIndicators(
863868
mWifiConnected, // only show wifi in the cluster if connected
864869
mWifiIconId,
865-
mWifiActivityIconId);
870+
mWifiActivityIconId,
871+
mContentDescriptionWifi);
866872
cluster.setMobileDataIndicators(
867873
mHasMobileDataFeature,
868874
mPhoneSignalIconId,
869875
mMobileActivityIconId,
870-
mDataTypeIconId);
876+
mDataTypeIconId,
877+
mContentDescriptionPhoneSignal,
878+
mContentDescriptionDataType);
871879
cluster.setIsAirplaneMode(mAirplaneMode);
872880
}
873881
}

0 commit comments

Comments
 (0)