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

Commit f91017ec authored by Selim Cinek's avatar Selim Cinek
Browse files

Decorated custom views now behave better if no custom view is set

Bug: 27386952
Change-Id: I40ebd66830b1d0cb124e9a9019c6ead8dcf4d599
parent d191a178
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -4571,13 +4571,13 @@ public class Notification implements Parcelable

        private void buildIntoRemoteViewContent(RemoteViews remoteViews,
                RemoteViews customContent) {
            remoteViews.removeAllViews(R.id.notification_main_column);
            if (customContent != null) {
                // Need to clone customContent before adding, because otherwise it can no longer be
                // parceled independently of remoteViews.
            if (customContent != null) {
                customContent = customContent.clone();
            }
                remoteViews.removeAllViews(R.id.notification_main_column);
                remoteViews.addView(R.id.notification_main_column, customContent);
            }
            // also update the end margin if there is an image
            int endMargin = mBuilder.mContext.getResources().getDimensionPixelSize(
                    R.dimen.notification_content_margin_end);
@@ -4680,13 +4680,13 @@ public class Notification implements Parcelable

        private RemoteViews buildIntoRemoteView(RemoteViews remoteViews, int id,
                RemoteViews customContent) {
            remoteViews.removeAllViews(id);
            if (customContent != null) {
                // Need to clone customContent before adding, because otherwise it can no longer be
                // parceled independently of remoteViews.
            if (customContent != null) {
                customContent = customContent.clone();
            }
                remoteViews.removeAllViews(id);
                remoteViews.addView(id, customContent);
            }
            return remoteViews;
        }
    }