Bug 1454310 - Only call AccessibilityNodeInfo.getExtras on API >= 19. r=jchen

This commit is contained in:
Eitan Isaacson 2018-04-16 13:26:00 -04:00
Родитель 51f2b494ea
Коммит cef23f6914
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -107,10 +107,16 @@ public class SessionAccessibility {
// can get to by traversing down.
onInitializeAccessibilityNodeInfo(mView, info);
info.setClassName("android.webkit.WebView"); // TODO: WTF
Bundle bundle = info.getExtras();
bundle.putCharSequence(
"ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES",
"ARTICLE,BUTTON,CHECKBOX,COMBOBOX,CONTROL,FOCUSABLE,FRAME,GRAPHIC,H1,H2,H3,H4,H5,H6,HEADING,LANDMARK,LINK,LIST,LIST_ITEM,MAIN,MEDIA,RADIO,SECTION,TABLE,TEXT_FIELD,UNVISITED_LINK,VISITED_LINK");
if (Build.VERSION.SDK_INT >= 19) {
Bundle bundle = info.getExtras();
bundle.putCharSequence(
"ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES",
"ARTICLE,BUTTON,CHECKBOX,COMBOBOX,CONTROL," +
"FOCUSABLE,FRAME,GRAPHIC,H1,H2,H3,H4,H5,H6," +
"HEADING,LANDMARK,LINK,LIST,LIST_ITEM,MAIN," +
"MEDIA,RADIO,SECTION,TABLE,TEXT_FIELD," +
"UNVISITED_LINK,VISITED_LINK");
}
info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
info.addChild(hostView, VIRTUAL_CONTENT_ID);
break;