diff --git a/src/com/android/settings/privacyguard/PrivacyGuardManager.java b/src/com/android/settings/privacyguard/PrivacyGuardManager.java index e535ec10fa7..44e8bbd4be6 100644 --- a/src/com/android/settings/privacyguard/PrivacyGuardManager.java +++ b/src/com/android/settings/privacyguard/PrivacyGuardManager.java @@ -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;