return new AccessibilityNodeProvider() {
@Override
public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
return (AccessibilityNodeInfo) bridge.createAccessibilityNodeInfo(virtualViewId);
}
@Override
@SuppressWarnings("unchecked")
public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(
String text, int virtualViewId) {
// Use some voodoo to avoid creating intermediary instances.
return (List<AccessibilityNodeInfo>) (List<?>)
bridge.findAccessibilityNodeInfosByText(text, virtualViewId);
}
@Override
public boolean performAction(int virtualViewId, int action, Bundle arguments) {
return bridge.performAction(virtualViewId, action, arguments);
}
};