Merge "Text layout in switch may be null when accessibility events are fired." into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e136a72810
@@ -508,9 +508,9 @@ public class Switch extends CompoundButton {
|
||||
@Override
|
||||
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
|
||||
super.onPopulateAccessibilityEvent(event);
|
||||
CharSequence text = isChecked() ? mOnLayout.getText() : mOffLayout.getText();
|
||||
if (!TextUtils.isEmpty(text)) {
|
||||
event.getText().add(text);
|
||||
Layout layout = isChecked() ? mOnLayout : mOffLayout;
|
||||
if (layout != null && !TextUtils.isEmpty(layout.getText())) {
|
||||
event.getText().add(layout.getText());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user