Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32525d92 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Do not hide app name when title is empty.

This fixes an awkward edge case where apps omit a title because they depend on the app name to contextualize the text in the notification body.

Bug: 163626038
Test: manual
Change-Id: I452bdfcfd956d195aed575ace3b9f0556bc2d6df
parent 47d0450d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4901,7 +4901,7 @@ public class Notification implements Parcelable
            bindNotificationHeader(contentView, p);
            bindLargeIconAndApplyMargin(contentView, p, result);
            boolean showProgress = handleProgressBar(contentView, ex, p);
            if (p.title != null && p.title.length() > 0 && !p.mHasCustomContent) {
            if (p.hasTitle()) {
                contentView.setViewVisibility(R.id.title, View.VISIBLE);
                contentView.setTextViewText(R.id.title, processTextSpans(p.title));
                setTextViewColorPrimary(contentView, R.id.title, p);
@@ -5296,7 +5296,7 @@ public class Notification implements Parcelable
                contentView.setViewVisibility(R.id.app_name_text, View.GONE);
                return false;
            }
            if (p.mHeaderless && !p.mHasCustomContent) {
            if (p.mHeaderless && p.hasTitle()) {
                contentView.setViewVisibility(R.id.app_name_text, View.GONE);
                // the headerless template will have the TITLE in this position; return true to
                // keep the divider visible between that title and the next text element.
@@ -11073,6 +11073,10 @@ public class Notification implements Parcelable
            return this;
        }

        final boolean hasTitle() {
            return title != null && title.length() != 0 && !mHasCustomContent;
        }

        final StandardTemplateParams viewType(int viewType) {
            mViewType = viewType;
            return this;