[app] Don't show summary if null

Originally, we were showing "Unknown application" in English, no matter the user's locale. Then here we were actually showing "null". Both isn't good, so best to not show anything.
This commit is contained in:
Torsten Grote
2022-07-26 15:29:45 -03:00
committed by Hans-Christoph Steiner
parent 477436af68
commit 5cfdae0719

View File

@@ -604,8 +604,9 @@ public final class Utils {
* "sans-serif-light". Doesn't mandate any font sizes or any other styles, that is up to the
* {@link android.widget.TextView} which it ends up being displayed in.
*/
public static CharSequence formatAppNameAndSummary(String appName, String summary) {
String toFormat = appName + ' ' + summary;
public static CharSequence formatAppNameAndSummary(String appName, @Nullable String summary) {
String toFormat = appName;
if (summary != null) toFormat += ' ' + summary;
CharacterStyle normal = new TypefaceSpan("sans-serif");
CharacterStyle light = new TypefaceSpan("sans-serif-light");