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

Commit f5c40426 authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

Trebuchet: don't crash when protecting all apps



Change-Id: Iba37f386574a6ebf19bfd2dc0e35262ec0540914
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent eaec663a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -860,6 +860,9 @@ public class AppDrawerListAdapter extends RecyclerView.Adapter<AppDrawerListAdap

    @Override
    public int getPositionForSection(int sectionIndex) {
        if (mSectionHeaders.isEmpty()) {
            return 0;
        }
        return mSectionHeaders.get(getSections()[sectionIndex]).mItemIndex;
    }

+5 −2
Original line number Diff line number Diff line
@@ -266,6 +266,9 @@ public class AppDrawerScrubber extends LinearLayout {
        }

        public String getHeader(int idx) {
            if (size() == 0) {
                return null;
            }
            return showLetters() ? mSections.get(idx).getText() : mHeaders[idx];
        }

@@ -277,7 +280,7 @@ public class AppDrawerScrubber extends LinearLayout {
         * @return the mHeaders index (aka the underlying adapter index).
         */
        public int getAdapterIndex(int prevIdx, int curIdx) {
            if (!showLetters()) {
            if (!showLetters() || size() == 0) {
                return curIdx;
            }

@@ -291,7 +294,7 @@ public class AppDrawerScrubber extends LinearLayout {
         * highlighted index
         */
        public int getDirectionalIndex(int prevIdx, int curIdx) {
            if (!showLetters() || mSections.get(curIdx).getHighlight()) {
            if (!showLetters() || size() == 0 || mSections.get(curIdx).getHighlight()) {
                return curIdx;
            }