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

Commit 1e96ff75 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "AccessibilityEvents for visibility changes should be subtree events.""

parents 2758853c d9f2151a
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -15585,7 +15585,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    void setFlags(int flags, int mask) {
        final boolean accessibilityEnabled = AccessibilityManager.getInstance(mContext).isEnabled();
        final boolean accessibilityEnabled =
                AccessibilityManager.getInstance(mContext).isEnabled();
        final boolean oldIncludeForAccessibility = accessibilityEnabled && includeForAccessibility();
        int old = mViewFlags;
@@ -15800,14 +15801,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (accessibilityEnabled) {
            // If we're an accessibility pane and the visibility changed, we already have sent
            // a state change, so we really don't need to report other changes.
            // Accessibility Services aren't concerned with changes between GONE and INVISIBLE.
            boolean visibilityChanged = !isAccessibilityPane() && ((changed & VISIBILITY_MASK) != 0)
                    && ((old & VISIBILITY_MASK) == VISIBLE || newVisibility == VISIBLE);
            if (oldIncludeForAccessibility != includeForAccessibility() || visibilityChanged) {
                notifySubtreeAccessibilityStateChangedIfNeeded();
            } else if ((changed & ENABLED_MASK) != 0 || (changed & FOCUSABLE) != 0
            if (isAccessibilityPane()) {
                changed &= ~VISIBILITY_MASK;
            }
            if ((changed & FOCUSABLE) != 0 || (changed & VISIBILITY_MASK) != 0
                    || (changed & CLICKABLE) != 0 || (changed & LONG_CLICKABLE) != 0
                    || (changed & CONTEXT_CLICKABLE) != 0) {
                if (oldIncludeForAccessibility != includeForAccessibility()) {
                    notifySubtreeAccessibilityStateChangedIfNeeded();
                } else {
                    notifyViewAccessibilityStateChangedIfNeeded(
                            AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
                }
            } else if ((changed & ENABLED_MASK) != 0) {
                notifyViewAccessibilityStateChangedIfNeeded(
                        AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
            }