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

Commit 19ea52b1 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Correct the way of avoiding crash

Bug: 24098561
Change-Id: I38374eaeef0d26b2f3b3963d0e36f77947463e41
parent e04ea602
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -128,9 +128,10 @@ public class MultiSelectContactsListFragment extends DefaultContactBrowseListFra
                getAdapter().toggleSelectionOfContactId(Long.valueOf(contactId));
                // Manually send clicked event if there is a checkbox.
                // See b/24098561.  TalkBack will not read it otherwise.
                final int adjPosition = position + getListView().getHeaderViewsCount();
                if (getListView() != null && adjPosition < getListView().getChildCount()) {
                    getListView().getChildAt(adjPosition).sendAccessibilityEvent(AccessibilityEvent
                final int index = position + getListView().getHeaderViewsCount() - getListView()
                        .getFirstVisiblePosition();
                if (index >= 0 && index < getListView().getChildCount()) {
                    getListView().getChildAt(index).sendAccessibilityEvent(AccessibilityEvent
                            .TYPE_VIEW_CLICKED);
                }
            }