Loading src/com/android/launcher3/compat/AlphabeticIndexCompat.java +4 −2 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ import com.android.launcher3.Utilities; import java.lang.reflect.Method; import java.util.Locale; import androidx.annotation.NonNull; public class AlphabeticIndexCompat { private static final String TAG = "AlphabeticIndexCompat"; Loading Loading @@ -53,7 +55,7 @@ public class AlphabeticIndexCompat { /** * Computes the section name for an given string {@param s}. */ public String computeSectionName(CharSequence cs) { public String computeSectionName(@NonNull CharSequence cs) { String s = Utilities.trim(cs); String sectionName = mBaseIndex.getBucketLabel(mBaseIndex.getBucketIndex(s)); if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) { Loading Loading @@ -89,7 +91,7 @@ public class AlphabeticIndexCompat { /** * Returns the index of the bucket in which the given string should appear. */ protected int getBucketIndex(String s) { protected int getBucketIndex(@NonNull String s) { if (s.isEmpty()) { return UNKNOWN_BUCKET_INDEX; } Loading src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java +2 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ public class WidgetsModel { WidgetItemComparator widgetComparator = new WidgetItemComparator(); for (Map.Entry<PackageItemInfo, ArrayList<WidgetItem>> entry : mWidgetsList.entrySet()) { WidgetListRowEntry row = new WidgetListRowEntry(entry.getKey(), entry.getValue()); row.titleSectionName = indexer.computeSectionName(row.pkgItem.title); row.titleSectionName = (row.pkgItem.title == null) ? "" : indexer.computeSectionName(row.pkgItem.title); Collections.sort(row.widgets, widgetComparator); result.add(row); } Loading Loading
src/com/android/launcher3/compat/AlphabeticIndexCompat.java +4 −2 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ import com.android.launcher3.Utilities; import java.lang.reflect.Method; import java.util.Locale; import androidx.annotation.NonNull; public class AlphabeticIndexCompat { private static final String TAG = "AlphabeticIndexCompat"; Loading Loading @@ -53,7 +55,7 @@ public class AlphabeticIndexCompat { /** * Computes the section name for an given string {@param s}. */ public String computeSectionName(CharSequence cs) { public String computeSectionName(@NonNull CharSequence cs) { String s = Utilities.trim(cs); String sectionName = mBaseIndex.getBucketLabel(mBaseIndex.getBucketIndex(s)); if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) { Loading Loading @@ -89,7 +91,7 @@ public class AlphabeticIndexCompat { /** * Returns the index of the bucket in which the given string should appear. */ protected int getBucketIndex(String s) { protected int getBucketIndex(@NonNull String s) { if (s.isEmpty()) { return UNKNOWN_BUCKET_INDEX; } Loading
src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java +2 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ public class WidgetsModel { WidgetItemComparator widgetComparator = new WidgetItemComparator(); for (Map.Entry<PackageItemInfo, ArrayList<WidgetItem>> entry : mWidgetsList.entrySet()) { WidgetListRowEntry row = new WidgetListRowEntry(entry.getKey(), entry.getValue()); row.titleSectionName = indexer.computeSectionName(row.pkgItem.title); row.titleSectionName = (row.pkgItem.title == null) ? "" : indexer.computeSectionName(row.pkgItem.title); Collections.sort(row.widgets, widgetComparator); result.add(row); } Loading