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

Commit ee33ad24 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Settings crash after enabling TalkBack accessibility.

1. AccessibilityInput filter was not checking whether the touch
   explorer instance is not null before passing it an accessibility
   event. If the accessibility event is dispatched before the input
   filter is installed but after it is created we runt into this
   case.

2. Added a missing null check in accessibility node info.

bug:6635089

Change-Id: Ia389dc1f427427eb73794f6331ccb870e0b44c55
parent 4206ee2b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -432,9 +432,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        final int rootAccessibilityViewId =
            (root != null) ? root.getAccessibilityViewId() : UNDEFINED;
        mSourceNodeId = makeNodeId(rootAccessibilityViewId, virtualDescendantId);
        if (root != null) {
            mActualAndReportedWindowLeftDelta = root.getActualAndReportedWindowLeftDelta();
            mActualAndReportedWindowTopDelta = root.getActualAndReportedWindowTopDelta();
        }
    }

    /**
     * Find the view that has the specified focus type. The search starts from
+3 −1
Original line number Diff line number Diff line
@@ -123,6 +123,8 @@ public class AccessibilityInputFilter extends InputFilter {
    }

    public void onAccessibilityEvent(AccessibilityEvent event) {
        if (mTouchExplorer != null) {
            mTouchExplorer.onAccessibilityEvent(event);
        }
    }
}