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

Commit 5fe8f909 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[MessagingNotification] Fix icon loading issue for legacy messaging

Fixes: 397399291
Test: Presubmit & post a legacy messaging notification with Notify1 and see the default icon.
Flag: EXEMPT trivial change
Change-Id: Icb2dab020fedcb71f9202f7e98b6ce8528d4b534
parent 09526194
Loading
Loading
Loading
Loading
+63 −10
Original line number Diff line number Diff line
@@ -121,22 +121,38 @@ public class MessagingLayout extends FrameLayout
        setMessagingClippingDisabled(false);
    }

    @RemotableViewMethod
    @RemotableViewMethod(asyncImpl = "setAvatarReplacementAsync")
    public void setAvatarReplacement(Icon icon) {
        mAvatarReplacement = icon;
    }

    @RemotableViewMethod
    /**
     * @hide
     */
    public Runnable setAvatarReplacementAsync(Icon icon) {
        mAvatarReplacement = icon;
        return () -> {};
    }

    @RemotableViewMethod(asyncImpl = "setNameReplacementAsync")
    public void setNameReplacement(CharSequence nameReplacement) {
        mNameReplacement = nameReplacement;
    }

    /**
     * @hide
     */
    public Runnable setNameReplacementAsync(CharSequence nameReplacement) {
        mNameReplacement = nameReplacement;
        return () -> {};
    }

    /**
     * Set this layout to show the collapsed representation.
     *
     * @param isCollapsed is it collapsed
     */
    @RemotableViewMethod
    @RemotableViewMethod(asyncImpl = "setIsCollapsedAsync")
    public void setIsCollapsed(boolean isCollapsed) {
        mIsCollapsed = isCollapsed;
    }
@@ -145,7 +161,6 @@ public class MessagingLayout extends FrameLayout
     * setDataAsync needs to do different stuff for the collapsed vs expanded view, so store the
     * collapsed state early.
     */
    @RemotableViewMethod(asyncImpl = "setIsCollapsedAsync")
    public Runnable setIsCollapsedAsync(boolean isCollapsed) {
        mIsCollapsed = isCollapsed;
        return () -> {};
@@ -161,11 +176,19 @@ public class MessagingLayout extends FrameLayout
     *
     * @param conversationTitle the conversation title
     */
    @RemotableViewMethod
    @RemotableViewMethod(asyncImpl = "setConversationTitleAsync")
    public void setConversationTitle(CharSequence conversationTitle) {
        mConversationTitle = conversationTitle;
    }

    /**
     * @hide
     */
    public Runnable setConversationTitleAsync(CharSequence conversationTitle) {
        mConversationTitle = conversationTitle;
        return ()->{};
    }

    /**
     * Set Messaging data
     * @param extras Bundle contains messaging data
@@ -417,22 +440,44 @@ public class MessagingLayout extends FrameLayout
        return mPeopleHelper.createAvatarSymbol(senderName, symbol, layoutColor);
    }

    @RemotableViewMethod
    @RemotableViewMethod(asyncImpl = "setLayoutColorAsync")
    public void setLayoutColor(int color) {
        mLayoutColor = color;
    }

    @RemotableViewMethod
    /**
     * @hide
     */
    public Runnable setLayoutColorAsync(int color) {
        mLayoutColor = color;
        return () -> {};
    }

    @RemotableViewMethod(asyncImpl = "setIsOneToOneAsync")
    public void setIsOneToOne(boolean oneToOne) {
        mIsOneToOne = oneToOne;
    }

    @RemotableViewMethod
    /**
     * @hide
     */
    public Runnable setIsOneToOneAsync(boolean oneToOne) {
        mIsOneToOne = oneToOne;
        return () -> {};
    }

    @RemotableViewMethod(asyncImpl = "setSenderTextColorAsync")
    public void setSenderTextColor(int color) {
        mSenderTextColor = color;
    }


    /**
     * @hide
     */
    public Runnable setSenderTextColorAsync(int color) {
        mSenderTextColor = color;
        return () -> {};
    }
    /**
     * @param color the color of the notification background
     */
@@ -441,11 +486,19 @@ public class MessagingLayout extends FrameLayout
        // Nothing to do with this
    }

    @RemotableViewMethod
    @RemotableViewMethod(asyncImpl = "setMessageTextColorAsync")
    public void setMessageTextColor(int color) {
        mMessageTextColor = color;
    }

    /**
     * @hide
     */
    public Runnable setMessageTextColorAsync(int color) {
        mMessageTextColor = color;
        return () -> {};
    }

    public void setUser(Person user) {
        mUser = user;
        if (mUser.getIcon() == null) {