summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/compat
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2019-01-15 11:33:53 -0800
committerHyunyoung Song <hyunyoungs@google.com>2019-01-15 11:45:33 -0800
commitcbd01fc3dcbedbdcd7eeff44749ba48e2755a70b (patch)
tree41adf37f5a1cbbc6d3c93f600fe835df645b268f /src/com/android/launcher3/compat
parentff9571b30f75c8575e441c5fb2e4211662dc7494 (diff)
downloadandroid_packages_apps_Trebuchet-cbd01fc3dcbedbdcd7eeff44749ba48e2755a70b.tar.gz
android_packages_apps_Trebuchet-cbd01fc3dcbedbdcd7eeff44749ba48e2755a70b.tar.bz2
android_packages_apps_Trebuchet-cbd01fc3dcbedbdcd7eeff44749ba48e2755a70b.zip
Handle null ItemInfo.title for widget list
Bug: 122809947 Change-Id: I2f72fb0e152e93adbb4bc4204d5d688b273452ad
Diffstat (limited to 'src/com/android/launcher3/compat')
-rw-r--r--src/com/android/launcher3/compat/AlphabeticIndexCompat.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
index 84e82e3eb..a7c0a4764 100644
--- a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
+++ b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
@@ -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";
@@ -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) {
@@ -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;
}