Merge "Removing checked state description text for accessibility from some widgets."
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 19fb7b1..233d892 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -227,16 +227,6 @@
}
@Override
- public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
- super.onPopulateAccessibilityEvent(event);
- if (isChecked()) {
- event.getText().add(mContext.getString(R.string.radiobutton_selected));
- } else {
- event.getText().add(mContext.getString(R.string.radiobutton_not_selected));
- }
- }
-
- @Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(CheckedTextView.class.getName());
diff --git a/core/java/android/widget/RadioButton.java b/core/java/android/widget/RadioButton.java
index b6dac3e..b1bb1c0 100644
--- a/core/java/android/widget/RadioButton.java
+++ b/core/java/android/widget/RadioButton.java
@@ -78,16 +78,6 @@
}
@Override
- public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
- super.onPopulateAccessibilityEvent(event);
- if (isChecked()) {
- event.getText().add(mContext.getString(R.string.radiobutton_selected));
- } else {
- event.getText().add(mContext.getString(R.string.radiobutton_not_selected));
- }
- }
-
- @Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setClassName(RadioButton.class.getName());
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 92ad88d..a897cc3 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -519,17 +519,8 @@
@Override
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
super.onPopulateAccessibilityEvent(event);
- if (isChecked()) {
- CharSequence text = mOnLayout.getText();
- if (TextUtils.isEmpty(text)) {
- text = mContext.getString(R.string.switch_on);
- }
- event.getText().add(text);
- } else {
- CharSequence text = mOffLayout.getText();
- if (TextUtils.isEmpty(text)) {
- text = mContext.getString(R.string.switch_off);
- }
+ CharSequence text = isChecked() ? mOnLayout.getText() : mOffLayout.getText();
+ if (!TextUtils.isEmpty(text)) {
event.getText().add(text);
}
}
diff --git a/core/java/android/widget/ToggleButton.java b/core/java/android/widget/ToggleButton.java
index a0edafe..4beee96 100644
--- a/core/java/android/widget/ToggleButton.java
+++ b/core/java/android/widget/ToggleButton.java
@@ -154,16 +154,6 @@
}
@Override
- public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
- super.onPopulateAccessibilityEvent(event);
- if (isChecked()) {
- event.getText().add(mContext.getString(R.string.togglebutton_pressed));
- } else {
- event.getText().add(mContext.getString(R.string.togglebutton_not_pressed));
- }
- }
-
- @Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setClassName(ToggleButton.class.getName());
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index c8df649..373e88c 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3194,30 +3194,6 @@
<!-- Description of the button to decrement the DatePicker's year value. [CHAR LIMIT=NONE] -->
<string name="date_picker_decrement_year_button">Decrement year</string>
- <!-- CheckBox - accessibility support -->
- <!-- Description of the checked state of a CheckBox. [CHAR LIMIT=NONE] -->
- <string name="checkbox_checked">checked</string>
- <!-- Description of the not checked state of a CheckBox. [CHAR LIMIT=NONE] -->
- <string name="checkbox_not_checked">not checked</string>
-
- <!-- RadioButton/CheckedTextView - accessibility support -->
- <!-- Description of the selected state of a RadioButton. [CHAR LIMIT=NONE] -->
- <string name="radiobutton_selected">selected</string>
- <!-- Description of the not selected state of a RadioButton. [CHAR LIMIT=NONE] -->
- <string name="radiobutton_not_selected">not selected</string>
-
- <!-- Switch - accessibility support -->
- <!-- Description of the on state of a Switch. [CHAR LIMIT=NONE] -->
- <string name="switch_on">on</string>
- <!-- Description of the off state of a Switch. [CHAR LIMIT=NONE] -->
- <string name="switch_off">off</string>
-
- <!-- ToggleButton - accessibility support -->
- <!-- Description of the pressed state of a ToggleButton. [CHAR LIMIT=NONE] -->
- <string name="togglebutton_pressed">pressed</string>
- <!-- Description of the not pressed state of a ToggleButton. [CHAR LIMIT=NONE] -->
- <string name="togglebutton_not_pressed">not pressed</string>
-
<!-- KeyboardView - accessibility support -->
<!-- Description of the Alt button in a KeyboardView. [CHAR LIMIT=NONE] -->
<string name="keyboardview_keycode_alt">Alt</string>