Skip to content

Commit

Permalink
Settings: Fix off-by-one SectionIndexer in PrivacyGuard.
Browse files Browse the repository at this point in the history
Change-Id: If97876214d6f532ca4e5a09f09d881cd4fbf0231
  • Loading branch information
Adnan Begovic authored and PRJosh committed Jan 28, 2016
1 parent e60aa6c commit 354d52c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@ private PrivacyGuardAppListAdapter createAdapter() {
} else {
sectionIndex = app.title.substring(0, 1).toUpperCase();
}
if (lastSectionIndex == null) {
lastSectionIndex = sectionIndex;
}

if (!TextUtils.equals(sectionIndex, lastSectionIndex)) {
if (lastSectionIndex == null ||
!TextUtils.equals(sectionIndex, lastSectionIndex)) {
sections.add(sectionIndex);
positions.add(offset);
lastSectionIndex = sectionIndex;
Expand Down

0 comments on commit 354d52c

Please sign in to comment.