CheckBox should not populate AccessibilityEvent with text.
1. Accessibility services are the ones that choose how to announces the checked state of a checkable control, so CheckBox should not add strings for its state to access events. 2. Removed some unused accessibility related strings. bug:6241115 Change-Id: I572b961191da4b3537fb6cad529d9764d39161ec
This commit is contained in:
@@ -21,8 +21,6 @@ import android.util.AttributeSet;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -70,16 +68,6 @@ public class CheckBox extends CompoundButton {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
|
||||
super.onPopulateAccessibilityEvent(event);
|
||||
if (isChecked()) {
|
||||
event.getText().add(mContext.getString(R.string.checkbox_checked));
|
||||
} else {
|
||||
event.getText().add(mContext.getString(R.string.checkbox_not_checked));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||
super.onInitializeAccessibilityEvent(event);
|
||||
|
||||
@@ -398,8 +398,6 @@
|
||||
<java-symbol type="string" name="cfTemplateNotForwarded" />
|
||||
<java-symbol type="string" name="cfTemplateRegistered" />
|
||||
<java-symbol type="string" name="cfTemplateRegisteredTime" />
|
||||
<java-symbol type="string" name="checkbox_checked" />
|
||||
<java-symbol type="string" name="checkbox_not_checked" />
|
||||
<java-symbol type="string" name="chooseActivity" />
|
||||
<java-symbol type="string" name="config_default_dns_server" />
|
||||
<java-symbol type="string" name="config_ethernet_iface_regex" />
|
||||
@@ -699,8 +697,6 @@
|
||||
<java-symbol type="string" name="preposition_for_time" />
|
||||
<java-symbol type="string" name="progress_erasing" />
|
||||
<java-symbol type="string" name="progress_unmounting" />
|
||||
<java-symbol type="string" name="radiobutton_not_selected" />
|
||||
<java-symbol type="string" name="radiobutton_selected" />
|
||||
<java-symbol type="string" name="relationTypeAssistant" />
|
||||
<java-symbol type="string" name="relationTypeBrother" />
|
||||
<java-symbol type="string" name="relationTypeChild" />
|
||||
@@ -795,8 +791,6 @@
|
||||
<java-symbol type="string" name="sms_control_title" />
|
||||
<java-symbol type="string" name="sms_control_yes" />
|
||||
<java-symbol type="string" name="submit" />
|
||||
<java-symbol type="string" name="switch_off" />
|
||||
<java-symbol type="string" name="switch_on" />
|
||||
<java-symbol type="string" name="sync_binding_label" />
|
||||
<java-symbol type="string" name="sync_do_nothing" />
|
||||
<java-symbol type="string" name="sync_really_delete" />
|
||||
@@ -818,8 +812,6 @@
|
||||
<java-symbol type="string" name="time_wday" />
|
||||
<java-symbol type="string" name="time_wday_date" />
|
||||
<java-symbol type="string" name="today" />
|
||||
<java-symbol type="string" name="togglebutton_not_pressed" />
|
||||
<java-symbol type="string" name="togglebutton_pressed" />
|
||||
<java-symbol type="string" name="tomorrow" />
|
||||
<java-symbol type="string" name="twelve_hour_time_format" />
|
||||
<java-symbol type="string" name="twenty_four_hour_time_format" />
|
||||
|
||||
@@ -3231,30 +3231,6 @@
|
||||
<!-- Description of the button to decrease the DatePicker's year value. [CHAR LIMIT=NONE] -->
|
||||
<string name="date_picker_decrement_year_button">Decrease 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>
|
||||
|
||||
Reference in New Issue
Block a user