Skip to content

Commit 354d52c

Browse files
Adnan BegovicPRJosh
authored andcommitted
Settings: Fix off-by-one SectionIndexer in PrivacyGuard.
Change-Id: If97876214d6f532ca4e5a09f09d881cd4fbf0231
1 parent e60aa6c commit 354d52c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/com/android/settings/privacyguard/PrivacyGuardManager.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,9 @@ private PrivacyGuardAppListAdapter createAdapter() {
252252
} else {
253253
sectionIndex = app.title.substring(0, 1).toUpperCase();
254254
}
255-
if (lastSectionIndex == null) {
256-
lastSectionIndex = sectionIndex;
257-
}
258255

259-
if (!TextUtils.equals(sectionIndex, lastSectionIndex)) {
256+
if (lastSectionIndex == null ||
257+
!TextUtils.equals(sectionIndex, lastSectionIndex)) {
260258
sections.add(sectionIndex);
261259
positions.add(offset);
262260
lastSectionIndex = sectionIndex;

0 commit comments

Comments
 (0)