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

Commit 11007143 authored by Svetoslav's avatar Svetoslav
Browse files

Reverting changes to the accessibility layer.

1. Views not important for accessibility should still fire accessibility
   events as some accessibility service may be registered to introspect
   all views.

2. Reverting a correct fix from AccessibilityNodeInfoCache to port it in
   a separate change for cherry-pick.

Change-Id: If768259597ed1c884952209dad948c46dff14878
parent be85725e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -5136,8 +5136,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param text The announcement text.
     */
    public void announceForAccessibility(CharSequence text) {
        if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null
                && isImportantForAccessibility()) {
        if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null) {
            AccessibilityEvent event = AccessibilityEvent.obtain(
                    AccessibilityEvent.TYPE_ANNOUNCEMENT);
            onInitializeAccessibilityEvent(event);
@@ -5187,7 +5186,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * Note: Called from the default {@link AccessibilityDelegate}.
     */
    void sendAccessibilityEventUncheckedInternal(AccessibilityEvent event) {
        if (!isShown() || !isImportantForAccessibility()) {
        if (!isShown()) {
            return;
        }
        onInitializeAccessibilityEvent(event);
+5 −7
Original line number Diff line number Diff line
@@ -174,7 +174,6 @@ public class AccessibilityNodeInfoCache {
                    // subtrees in the cache.
                    // TODO: Runs in O(n^2), could optimize to O(n + n log n)
                    final LongArray newChildrenIds = info.getChildNodeIds();
                    if (newChildrenIds != null) {
                    final int oldChildCount = oldInfo.getChildCount();
                    for (int i = 0; i < oldChildCount; i++) {
                        final long oldChildId = oldInfo.getChildId(i);
@@ -182,7 +181,6 @@ public class AccessibilityNodeInfoCache {
                            clearSubTreeLocked(oldChildId);
                        }
                    }
                    }

                    // Also be careful if the parent has changed since the new
                    // parent may be a predecessor of the old parent which will