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

Commit e1d2d42a authored by Steve Elliott's avatar Steve Elliott Committed by Automerger Merge Worker
Browse files

Merge "Always use Shortcut Icon in conversation if available" into rvc-dev am:...

Merge "Always use Shortcut Icon in conversation if available" into rvc-dev am: cc193758 am: 841ddf9d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11662920

Change-Id: Id19536a8692c12dade68854a6fc37172e6cd54f4
parents 0a6f733a 841ddf9d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -7625,9 +7625,8 @@ public class Notification implements Parcelable
            }
            boolean isConversationLayout = mConversationType != CONVERSATION_TYPE_LEGACY;
            boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT;
            Icon largeIcon = isConversationLayout && mShortcutIcon != null
                    ? mShortcutIcon
                    : mBuilder.mN.mLargeIcon;
            Icon conversationIcon = mShortcutIcon;
            Icon largeIcon = mBuilder.mN.mLargeIcon;
            TemplateBindResult bindResult = new TemplateBindResult();
            StandardTemplateParams p = mBuilder.mParams.reset()
                    .hasProgress(false)
@@ -7671,6 +7670,8 @@ public class Notification implements Parcelable
            contentView.setCharSequence(R.id.status_bar_latest_event_content,
                    "setConversationTitle", conversationTitle);
            if (isConversationLayout) {
                contentView.setIcon(R.id.status_bar_latest_event_content,
                        "setConversationIcon", conversationIcon);
                contentView.setBoolean(R.id.status_bar_latest_event_content,
                        "setIsImportantConversation", isImportantConversation);
            }
+15 −8
Original line number Diff line number Diff line
@@ -480,23 +480,25 @@ public class ConversationLayout extends FrameLayout
                        // (This usually happens for most 1:1 conversations)
                        conversationText = messagingGroup.getSenderName();
                    }
                    if (mConversationIcon == null) {
                        Icon avatarIcon = messagingGroup.getAvatarIcon();
                        if (avatarIcon == null) {
                            avatarIcon = createAvatarSymbol(conversationText, "", mLayoutColor);
                        }
                        mConversationIcon = avatarIcon;
                    mConversationIconView.setImageIcon(mConversationIcon);
                    }
                    break;
                }
            }
        } else {
            if (mLargeIcon != null) {
            if (mConversationIcon == null && mLargeIcon != null) {
                mConversationIcon = mLargeIcon;
            }
            if (mConversationIcon != null) {
                mConversationIconView.setVisibility(VISIBLE);
                mConversationFacePile.setVisibility(GONE);
                mConversationIconView.setImageIcon(mLargeIcon);
                mConversationIconView.setImageIcon(mConversationIcon);
            } else {
                mConversationIcon = null;
                mConversationIconView.setVisibility(GONE);
                // This will also inflate it!
                mConversationFacePile.setVisibility(VISIBLE);
@@ -709,6 +711,11 @@ public class ConversationLayout extends FrameLayout
        mLargeIcon = largeIcon;
    }

    @RemotableViewMethod
    public void setConversationIcon(Icon conversationIcon) {
        mConversationIcon = conversationIcon;
    }

    /**
     * Sets the conversation title of this conversation.
     *