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

Commit 1e4c6589 authored by Svetoslav's avatar Svetoslav Committed by Android Git Automerger
Browse files

am b3c2b21b: Merge "Accessibility should not query for list items when data...

am b3c2b21b: Merge "Accessibility should not query for list items when data set changed." into jb-mr2-dev

* commit 'b3c2b21b':
  Accessibility should not query for list items when data set changed.
parents f420a36e b3c2b21b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15435,8 +15435,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *
     * @param accessibilityId The accessibility id.
     * @return The found view.
     *
     * @hide
     */
    View findViewByAccessibilityIdTraversal(int accessibilityId) {
    public View findViewByAccessibilityIdTraversal(int accessibilityId) {
        if (getAccessibilityViewId() == accessibilityId) {
            return this;
        }
+2 −1
Original line number Diff line number Diff line
@@ -933,8 +933,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        }
    }

    /** @hide */
    @Override
    View findViewByAccessibilityIdTraversal(int accessibilityId) {
    public View findViewByAccessibilityIdTraversal(int accessibilityId) {
        View foundView = super.findViewByAccessibilityIdTraversal(accessibilityId);
        if (foundView != null) {
            return foundView;
+16 −0
Original line number Diff line number Diff line
@@ -1407,6 +1407,22 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        return false;
    }

    /** @hide */
    @Override
    public View findViewByAccessibilityIdTraversal(int accessibilityId) {
        if (accessibilityId == getAccessibilityViewId()) {
            return this;
        }
        // If the data changed the children are invalid since the data model changed.
        // Hence, we pretend they do not exist. After a layout the children will sync
        // with the model at which point we notify that the accessibility state changed,
        // so a service will be able to re-fetch the views.
        if (mDataChanged) {
            return null;
        }
        return super.findViewByAccessibilityIdTraversal(accessibilityId);
    }

    /**
     * Indicates whether the children's drawing cache is used during a scroll.
     * By default, the drawing cache is enabled but this will consume more memory.