Merge "Fix missing icon for one-to-one convos" into rvc-dev am: 05e10b59af
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11727185 Change-Id: I8c430bb32412fca0af1efc5c3a13881af11a0884
This commit is contained in:
@@ -7625,7 +7625,6 @@ public class Notification implements Parcelable
|
||||
}
|
||||
boolean isConversationLayout = mConversationType != CONVERSATION_TYPE_LEGACY;
|
||||
boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT;
|
||||
Icon conversationIcon = mShortcutIcon;
|
||||
Icon largeIcon = mBuilder.mN.mLargeIcon;
|
||||
TemplateBindResult bindResult = new TemplateBindResult();
|
||||
StandardTemplateParams p = mBuilder.mParams.reset()
|
||||
@@ -7671,7 +7670,7 @@ public class Notification implements Parcelable
|
||||
"setConversationTitle", conversationTitle);
|
||||
if (isConversationLayout) {
|
||||
contentView.setIcon(R.id.status_bar_latest_event_content,
|
||||
"setConversationIcon", conversationIcon);
|
||||
"setShortcutIcon", mShortcutIcon);
|
||||
contentView.setBoolean(R.id.status_bar_latest_event_content,
|
||||
"setIsImportantConversation", isImportantConversation);
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ public class ConversationLayout extends FrameLayout
|
||||
private Rect mAppOpsTouchRect = new Rect();
|
||||
private float mMinTouchSize;
|
||||
private Icon mConversationIcon;
|
||||
private Icon mShortcutIcon;
|
||||
private View mAppNameDivider;
|
||||
|
||||
public ConversationLayout(@NonNull Context context) {
|
||||
@@ -465,10 +466,9 @@ public class ConversationLayout extends FrameLayout
|
||||
private void updateConversationLayout() {
|
||||
// Set avatar and name
|
||||
CharSequence conversationText = mConversationTitle;
|
||||
mConversationIcon = mShortcutIcon;
|
||||
if (mIsOneToOne) {
|
||||
// Let's resolve the icon / text from the last sender
|
||||
mConversationIconView.setVisibility(VISIBLE);
|
||||
mConversationFacePile.setVisibility(GONE);
|
||||
CharSequence userKey = getKey(mUser);
|
||||
for (int i = mGroups.size() - 1; i >= 0; i--) {
|
||||
MessagingGroup messagingGroup = mGroups.get(i);
|
||||
@@ -490,22 +490,21 @@ public class ConversationLayout extends FrameLayout
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mConversationIcon == null) {
|
||||
mConversationIcon = mLargeIcon;
|
||||
}
|
||||
if (mIsOneToOne || mConversationIcon != null) {
|
||||
mConversationIconView.setVisibility(VISIBLE);
|
||||
mConversationFacePile.setVisibility(GONE);
|
||||
mConversationIconView.setImageIcon(mConversationIcon);
|
||||
} else {
|
||||
if (mConversationIcon == null && mLargeIcon != null) {
|
||||
mConversationIcon = mLargeIcon;
|
||||
}
|
||||
if (mConversationIcon != null) {
|
||||
mConversationIconView.setVisibility(VISIBLE);
|
||||
mConversationFacePile.setVisibility(GONE);
|
||||
mConversationIconView.setImageIcon(mConversationIcon);
|
||||
} else {
|
||||
mConversationIconView.setVisibility(GONE);
|
||||
// This will also inflate it!
|
||||
mConversationFacePile.setVisibility(VISIBLE);
|
||||
// rebind the value to the inflated view instead of the stub
|
||||
mConversationFacePile = findViewById(R.id.conversation_face_pile);
|
||||
bindFacePile();
|
||||
}
|
||||
mConversationIconView.setVisibility(GONE);
|
||||
// This will also inflate it!
|
||||
mConversationFacePile.setVisibility(VISIBLE);
|
||||
// rebind the value to the inflated view instead of the stub
|
||||
mConversationFacePile = findViewById(R.id.conversation_face_pile);
|
||||
bindFacePile();
|
||||
}
|
||||
if (TextUtils.isEmpty(conversationText)) {
|
||||
conversationText = mIsOneToOne ? mFallbackChatName : mFallbackGroupChatName;
|
||||
@@ -712,7 +711,7 @@ public class ConversationLayout extends FrameLayout
|
||||
}
|
||||
|
||||
@RemotableViewMethod
|
||||
public void setConversationIcon(Icon conversationIcon) {
|
||||
public void setShortcutIcon(Icon conversationIcon) {
|
||||
mConversationIcon = conversationIcon;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user