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

Commit 6892184b authored by Hiroki Sato's avatar Hiroki Sato Committed by Android (Google) Code Review
Browse files

Merge "Updates event source to important parent only when events are merged" into main

parents 0843c5a9 cfe91076
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -11550,15 +11550,6 @@ public final class ViewRootImpl implements ViewParent,
                event.setContentChangeTypes(mChangeTypes);
                if (mAction.isPresent()) event.setAction(mAction.getAsInt());
                if (AccessibilityEvent.DEBUG_ORIGIN) event.originStackTrace = mOrigin;
                if (fixMergedContentChangeEvent()) {
                    if ((mChangeTypes & AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) != 0) {
                        final View importantParent = source.getSelfOrParentImportantForA11y();
                        if (importantParent != null) {
                            source = importantParent;
                        }
                    }
                }
                source.sendAccessibilityEventUnchecked(event);
            } else {
                mLastEventTimeMillis = 0;
@@ -11595,6 +11586,9 @@ public final class ViewRootImpl implements ViewParent,
            if (mSource != null) {
                if (fixMergedContentChangeEvent()) {
                    View newSource = getCommonPredecessor(mSource, source);
                    if (newSource != null) {
                        newSource = newSource.getSelfOrParentImportantForA11y();
                    }
                    if (newSource == null) {
                        // If there is no common predecessor, then mSource points to
                        // a removed view, hence in this case always prefer the source.