summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amin Shaikh <ashaikh@google.com> 2018-04-18 17:45:43 -0700
committer android-build-merger <android-build-merger@google.com> 2018-04-18 17:45:43 -0700
commite30039258fb2f583e12d66ef169eb5f976f24b47 (patch)
tree1cacf396dd56e68efa116a19c41617ca1cd1e0c9
parent2dddea785c8c083ec036278ceb06f9a9d2251bb5 (diff)
parent418bf622471c8ebd685c54a8a801e12841121f44 (diff)
Merge "Rely on tile state for on/off a11y announcement." into pi-dev am: df173b59f6
am: 418bf62247 Change-Id: Ife23ad775b051e37718e24219fd865872ad1d447
-rw-r--r--packages/SystemUI/res/values/strings.xml8
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java23
3 files changed, 24 insertions, 24 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index ae40db0f2d53..6c507be44df3 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -515,16 +515,12 @@
<string name="accessibility_quick_settings_airplane_changed_off">Airplane mode turned off.</string>
<!-- Announcement made when the airplane mode changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_airplane_changed_on">Airplane mode turned on.</string>
- <!-- Content description of the do not disturb tile in quick settings when on in the default priority mode (not shown on the screen). [CHAR LIMIT=NONE] -->
- <string name="accessibility_quick_settings_dnd_priority_on">Do not disturb on.</string>
<!-- Content description of the do not disturb tile in quick settings when on in none (not shown on the screen). [CHAR LIMIT=NONE] -->
- <string name="accessibility_quick_settings_dnd_none_on">Do not disturb on, total silence.</string>
+ <string name="accessibility_quick_settings_dnd_none_on">total silence</string>
<!-- Content description of the do not disturb tile in quick settings when on in alarms only (not shown on the screen). [CHAR LIMIT=NONE] -->
- <string name="accessibility_quick_settings_dnd_alarms_on">Do not disturb on, alarms only.</string>
+ <string name="accessibility_quick_settings_dnd_alarms_on">alarms only</string>
<!-- Content description of the do not disturb tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_dnd">Do not disturb.</string>
- <!-- Content description of the do not disturb tile in quick settings when off (not shown on the screen). [CHAR LIMIT=NONE] -->
- <string name="accessibility_quick_settings_dnd_off">Do not disturb off.</string>
<!-- Announcement made when do not disturb changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_dnd_changed_off">Do not disturb turned off.</string>
<!-- Announcement made when do not disturb changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index 06183e917e96..0c7919d11042 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -28,6 +28,7 @@ import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.provider.Settings;
import android.service.quicksettings.Tile;
+import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Switch;
@@ -131,32 +132,32 @@ public class BluetoothTile extends QSTileImpl<BooleanState> {
}
state.slash.isSlashed = !enabled;
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
+ state.secondaryLabel = TextUtils.emptyIfNull(
+ getSecondaryLabel(enabled, connected, state.isTransient));
if (enabled) {
if (connected) {
state.icon = new BluetoothConnectedTileIcon();
- state.contentDescription = mContext.getString(
- R.string.accessibility_bluetooth_name, state.label);
-
state.label = mController.getLastDeviceName();
+ state.contentDescription =
+ mContext.getString(R.string.accessibility_bluetooth_name, state.label)
+ + ", " + state.secondaryLabel;
} else if (state.isTransient) {
state.icon = ResourceIcon.get(R.drawable.ic_bluetooth_transient_animation);
- state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_bluetooth_connecting);
+ state.contentDescription = state.secondaryLabel;
} else {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_on);
state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_bluetooth_on) + ","
+ R.string.accessibility_quick_settings_bluetooth) + ","
+ mContext.getString(R.string.accessibility_not_connected);
}
state.state = Tile.STATE_ACTIVE;
} else {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_on);
state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_bluetooth_off);
+ R.string.accessibility_quick_settings_bluetooth);
state.state = Tile.STATE_INACTIVE;
}
- state.secondaryLabel = getSecondaryLabel(enabled, connected, state.isTransient);
state.dualLabelContentDescription = mContext.getResources().getString(
R.string.accessibility_quick_settings_open_settings, getTileLabel());
state.expandedAccessibilityClassName = Switch.class.getName();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 4616d1eae4da..d1e33d3fb8d6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -36,6 +36,7 @@ import android.provider.Settings.Global;
import android.service.notification.ZenModeConfig;
import android.service.notification.ZenModeConfig.ZenRule;
import android.service.quicksettings.Tile;
+import android.text.TextUtils;
import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
@@ -224,25 +225,27 @@ public class DndTile extends QSTileImpl<BooleanState> {
state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
state.slash.isSlashed = !state.value;
state.label = getTileLabel();
- state.secondaryLabel = ZenModeConfig.getDescription(mContext,zen != Global.ZEN_MODE_OFF,
- mController.getConfig(), false);
+ state.secondaryLabel = TextUtils.emptyIfNull(ZenModeConfig.getDescription(mContext,
+ zen != Global.ZEN_MODE_OFF, mController.getConfig(), false));
state.icon = ResourceIcon.get(R.drawable.ic_qs_dnd_on);
checkIfRestrictionEnforcedByAdminOnly(state, UserManager.DISALLOW_ADJUST_VOLUME);
switch (zen) {
case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
- state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_dnd_priority_on) + ", "
+ state.contentDescription =
+ mContext.getString(R.string.accessibility_quick_settings_dnd) + ", "
+ state.secondaryLabel;
break;
case Global.ZEN_MODE_NO_INTERRUPTIONS:
- state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_dnd_none_on) + ", "
- + state.secondaryLabel;
+ state.contentDescription =
+ mContext.getString(R.string.accessibility_quick_settings_dnd) + ", " +
+ mContext.getString(R.string.accessibility_quick_settings_dnd_none_on)
+ + ", " + state.secondaryLabel;
break;
case ZEN_MODE_ALARMS:
- state.contentDescription = mContext.getString(
- R.string.accessibility_quick_settings_dnd_alarms_on) + ", "
- + state.secondaryLabel;
+ state.contentDescription =
+ mContext.getString(R.string.accessibility_quick_settings_dnd) + ", " +
+ mContext.getString(R.string.accessibility_quick_settings_dnd_alarms_on)
+ + ", " + state.secondaryLabel;
break;
default:
state.contentDescription = mContext.getString(