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

Commit d4bdd6be authored by Svetoslav's avatar Svetoslav
Browse files

Temporary detached views not properly reported to accessibility layer.

A view may be temporary detached. While in this state the view
state may change for which we fire accessibility events. Clients
use them to know when the view changed and what the change is.
However, detached views do not fire accessibility events.
Hence, a client may hold a stale AccessibilityNodeInfo since
the changes to its source view happened in a temporary detached
state.

bug:11388752

Change-Id: I9052700ca9195841cc2881b65c17f5615e6f71fb
parent 6ce161d1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -6686,6 +6686,13 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te

            scrap.dispatchStartTemporaryDetach();

            // The the accessibility state of the view may change while temporary
            // detached and we do not allow detached views to fire accessibility
            // events. So we are announcing that the subtree changed giving a chance
            // to clients holding on to a view in this subtree to refresh it.
            notifyViewAccessibilityStateChangedIfNeeded(
                    AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);

            // Don't scrap views that have transient state.
            final boolean scrapHasTransientState = scrap.hasTransientState();
            if (scrapHasTransientState) {