Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed9a34d5 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Refatoring a bit of accessibility code"

parents 9c539cce bad9d976
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -2571,17 +2571,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        return false;
    }

    @Override
    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
        // Add a record for ourselves as well.
        AccessibilityEvent record = AccessibilityEvent.obtain();
        // Set the class since it is not populated in #dispatchPopulateAccessibilityEvent
        record.setClassName(getClass().getName());
        child.dispatchPopulateAccessibilityEvent(record);
        event.appendRecord(record);
        return true;
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return false;
+16 −2
Original line number Diff line number Diff line
@@ -887,14 +887,28 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup {
        // We first get a chance to populate the event.
        onPopulateAccessibilityEvent(event);

        return false;
    }

    @Override
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
        // We send selection events only from AdapterView to avoid
        // generation of such event for each child.
        View selectedView = getSelectedView();
        if (selectedView != null) {
            return selectedView.dispatchPopulateAccessibilityEvent(event);
            selectedView.dispatchPopulateAccessibilityEvent(event);
        }
    }

        return false;
    @Override
    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
        // Add a record for ourselves as well.
        AccessibilityEvent record = AccessibilityEvent.obtain();
        // Set the class since it is not populated in #dispatchPopulateAccessibilityEvent
        record.setClassName(getClass().getName());
        child.dispatchPopulateAccessibilityEvent(record);
        event.appendRecord(record);
        return true;
    }

    @Override