am e136a728: Merge "Text layout in switch may be null when accessibility events are fired." into jb-mr1-dev
* commit 'e136a72810197029a01b4e30b2063d9993b7a9ad': Text layout in switch may be null when accessibility events are fired.
This commit is contained in:
@@ -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