Utilities.trim never returns null.
This fixes a crash loop I was seeing on my device and also
preemptively fixes similar NullPointerExceptions.
Bug: 213931730
Test: Manually verified crash loop stopped with this change.
Change-Id: I8d2fc8475d42ac60b7fdc9219421a8c9733c7b9f
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 5d41741..041bee9 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -37,6 +37,7 @@
import android.graphics.drawable.Drawable;
import android.icu.text.MessageFormat;
import android.text.TextPaint;
+import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.util.Property;
@@ -805,7 +806,7 @@
invalidate();
}
}
- if (itemInfo.contentDescription != null) {
+ if (!TextUtils.isEmpty(itemInfo.contentDescription)) {
if (itemInfo.isDisabled()) {
setContentDescription(getContext().getString(R.string.disabled_app_label,
itemInfo.contentDescription));